Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: OutOfMemoryError()Worker 2 terminated. #3

Open
drcxcruz opened this issue Jun 28, 2020 · 2 comments
Open

ERROR: OutOfMemoryError()Worker 2 terminated. #3

drcxcruz opened this issue Jun 28, 2020 · 2 comments

Comments

@drcxcruz
Copy link

hi ,

I am doing a random forest tree with data file: https://www.openml.org/d/179

my code worked in many smaller data files. but this the largest data file I tried so far. do you know if ShapML might have a limit in the number of file rows?

@Everywhere function predict_function_mode(model, data)
ŷ = MLJ.predict(model, data)
ŷMode = [convert(Int64, mode(ŷ[i])) for i in 1:length(ŷ)]
data_pred = DataFrame(y_pred = ŷMode)
return data_pred
end # predict_function_mode

    @everywhere pipeRandomForestClassifier = @pipeline RandomForestClassifierPipe(
        selector = FeatureSelector(),
        hot = OneHotEncoder(),
        tree = RandomForestClassifier()) prediction_type = :probabilistic

    cases = [[Symbol(names(X)[j]) for j in 1:i] for i in 1:ncol(X)]   
    r1 = range(pipeRandomForestClassifier, :(selector.features), values = cases)

    tmRandomForestClassifier = TunedModel(
        model = pipeRandomForestClassifier,
        range = r1,
        measures = [cross_entropy, BrierScore()],
        resampling = CV(nfolds = 5)
    )
    mtm = machine(tmRandomForestClassifier, setScientificTypes!(X), categorical(y[:, 1]))
    Base.invokelatest(MLJ.fit!, mtm)

    predictor = predict_function_mode

r = Int(round(nrow(X) / 2))
explain = copy(X[1:r, :])   # Compute Shapley feature-level predictions 
reference = copy(X)         # An optional reference population to compute the baseline prediction.
sample_size = 10            # Number of Monte Carlo samples for Shapley

println("Computing Shapley Effect of Random Forest")
dataShap = ShapML.shap( explain = explain,
                        reference = reference,
                        model = mtm,
                        predict_function = predictor,
                        sample_size = sample_size,
                        parallel = :samples,  # Parallel computation over "sample_size"
                        seed = 20200628
    )

Worker 5 terminated.
ERROR: OutOfMemoryError()Worker 2 terminated.
Stacktrace:

[1] Worker 4 terminated.Array{Float64,2}
(::Worker 3 terminated.UndefInitializer
, ::Int64, ::Int64) at .\boot.jl:407
[2] matrix(::DataFrame; transpose::Bool) at C:\Users\BCP.julia\packages\Tables\okt7x\src\matrix.jl:73
[3] matrix at C:\Users\BCP.julia\packages\Tables\okt7x\src\matrix.jl:68 [inlined]
[4] #matrix#11 at C:\Users\BCP.julia\packages\MLJBase\O5b6j\src\interface\data_utils.jl:9 [inlined]
[5] matrix at C:\Users\BCP.julia\packages\MLJBase\O5b6j\src\interface\data_utils.jl:9 [inlined]
[6] matrix(::DataFrame; kw::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{,Tuple{}}}) at C:\Users\BCP.julia\packages\MLJModelInterface\aA1k2\src\data_utils.jl:27
[7] matrix at C:\Users\BCP.julia\packages\MLJModelInterface\aA1k2\src\data_utils.jl:27 [inlined]
[8] predict(::RandomForestClassifier, ::Tuple{DecisionTree.Ensemble{Float64,UInt32},CategoricalArray{Int64,1,UInt32,Int64,CategoricalValue{Int64,UInt32},Union{}},Array{UInt32,1}}, ::DataFrame) at C:\Users\BCP.julia\packages\MLJModels\i4XcU\src\DecisionTree.jl:188
[9] predict(::NodalMachine{RandomForestClassifier}, ::DataFrame) at C:\Users\BCP.julia\packages\MLJBase\O5b6j\src\operations.jl:29
[10] (::Node{NodalMachine{RandomForestClassifier}})(::DataFrame) at C:\Users\BCP.julia\packages\MLJBase\O5b6j\src\composition\networks.jl:302
[11] predict(::RandomForestClassifierPipe, ::Node{NodalMachine{RandomForestClassifier}}, ::DataFrame) at C:\Users\BCP.julia\packages\MLJBase\O5b6j\src\composition\composites.jl:45
[12] predict(::Machine{RandomForestClassifierPipe}, ::DataFrame) at C:\Users\BCP.julia\packages\MLJBase\O5b6j\src\operations.jl:29
[13] predict(::MLJTuning.ProbabilisticTunedModel{Grid,RandomForestClassifierPipe,CPU1{Nothing},CPU1{Nothing}}, ::Machine{RandomForestClassifierPipe}, ::DataFrame) at C:\Users\BCP.julia\packages\MLJTuning\JZ7ZX\src\tuned_models.jl:597
[14] predict(::Machine{MLJTuning.ProbabilisticTunedModel{Grid,RandomForestClassifierPipe,CPU1{Nothing},CPU1{Nothing}}}, ::DataFrame) at C:\Users\BCP.julia\packages\MLJBase\O5b6j\src\operations.jl:29
[15] predict_function_mode(::Machine{MLJTuning.ProbabilisticTunedModel{Grid,RandomForestClassifierPipe,CPU1{Nothing},CPU1{Nothing}}}, ::DataFrame) at C:\Users\BCP\github\ICP\GetBlankets.jl:180
[16] _shap_sample(::DataFrame, ::DataFrame, ::Int64, ::Int64, ::Int64, ::Int64, ::Array{String,1}, ::Array{String,1}, ::Array{Symbol,1}, ::Int64, ::Symbol, ::Array{Int64,1}, ::Bool, ::Machine{MLJTuning.ProbabilisticTunedModel{Grid,RandomForestClassifierPipe,CPU1{Nothing},CPU1{Nothing}}}, ::typeof(predict_function_mode), ::Nothing) at C:\Users\BCP.julia\packages\ShapML\sceNA\src\shap_sample.jl:97
[17] shap(; explain::DataFrame, reference::DataFrame, model::Machine{MLJTuning.ProbabilisticTunedModel{Grid,RandomForestClassifierPipe,CPU1{Nothing},CPU1{Nothing}}}, predict_function::Function, target_features::Nothing, sample_size::Int64, parallel::Nothing, seed::Int64, precision::Nothing, chunk::Bool) at C:\Users\BCP.julia\packages\ShapML\sceNA\src\ShapML.jl:117
[18] trainRandomForest(::DataFrame, ::DataFrame) at C:\Users\BCP\github\ICP\GetBlankets.jl:248
[19] selectRandomForest(::DataFrame, ::DataFrame, ::Int64) at C:\Users\BCP\github\ICP\GetBlankets.jl:155
[20] getBlanketRandomForest(::DataFrame, ::DataFrame, ::String, ::Int64) at C:\Users\BCP\github\ICP\GetBlankets.jl:135
[21] getBlanketRandomForest at C:\Users\BCP\github\ICP\GetBlankets.jl:129 [inlined]
[22] ForestInvariantCausalPrediction(::DataFrame, ::DataFrame, ::DataFrame; α::Float64, selection::String, verbose::Bool) at C:\Users\BCP\github\ICP\InvariantCausalPrediction.jl:305
[23] top-level scope at REPL[10]:1
caused by [exception 1]
ProcessExitedException(2)
Stacktrace:
[1] (::Base.var"#726#728")(::Task) at .\asyncmap.jl:178
[2] foreach(::Base.var"#726#728", ::Array{Any,1}) at .\abstractarray.jl:1919
[3] maptwice(::Function, ::Channel{Any}, ::Array{Any,1}, ::UnitRange{Int64}) at .\asyncmap.jl:178
[4] wrap_n_exec_twice(::Channel{Any}, ::Array{Any,1}, ::Distributed.var"#204#207"{WorkerPool}, ::Function, ::UnitRange{Int64}) at .\asyncmap.jl:154
[5] async_usemap(::Distributed.var"#188#190"{Distributed.var"#188#189#191"{WorkerPool,ShapML.var"#13#15"{DataFrame,Machine{MLJTuning.ProbabilisticTunedModel{Grid,RandomForestClassifierPipe,CPU1{Nothing},CPU1{Nothing}}},typeof(predict_function_mode),Int64,Nothing,Bool,Array{String,1},Array{Symbol,1},Int64,Int64,Int64,Int64,Array{Int64,1}}}}, ::UnitRange{Int64}; ntasks::Function, batch_size::Nothing) at .\asyncmap.jl:103
[6] #asyncmap#710 at .\asyncmap.jl:81 [inlined]
[7] pmap(::Function, ::WorkerPool, ::UnitRange{Int64}; distributed::Bool, batch_size::Int64, on_error::Nothing, retry_delays::Array{Any,1}, retry_check::Nothing) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Distributed\src\pmap.jl:126
[8] pmap(::Function, ::WorkerPool, ::UnitRange{Int64}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Distributed\src\pmap.jl:101
[9] pmap(::Function, ::UnitRange{Int64}; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{,Tuple{}}}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Distributed\src\pmap.jl:156
[10] pmap at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Distributed\src\pmap.jl:156 [inlined]
[11] shap(; explain::DataFrame, reference::DataFrame, model::Machine{MLJTuning.ProbabilisticTunedModel{Grid,RandomForestClassifierPipe,CPU1{Nothing},CPU1{Nothing}}}, predict_function::Function, target_features::Nothing, sample_size::Int64, parallel::Symbol, seed::Int64, precision::Nothing, chunk::Bool) at C:\Users\BCP.julia\packages\ShapML\sceNA\src\ShapML.jl:137
[12] trainRandomForest(::DataFrame, ::DataFrame) at C:\Users\BCP\github\ICP\GetBlankets.jl:238
[13] selectRandomForest(::DataFrame, ::DataFrame, ::Int64) at C:\Users\BCP\github\ICP\GetBlankets.jl:155
[14] getBlanketRandomForest(::DataFrame, ::DataFrame, ::String, ::Int64) at C:\Users\BCP\github\ICP\GetBlankets.jl:135
[15] getBlanketRandomForest at C:\Users\BCP\github\ICP\GetBlankets.jl:129 [inlined]
[16] ForestInvariantCausalPrediction(::DataFrame, ::DataFrame, ::DataFrame; α::Float64, selection::String, verbose::Bool) at C:\Users\BCP\github\ICP\InvariantCausalPrediction.jl:305
[17] top-level scope at REPL[10]:1

@drcxcruz
Copy link
Author

hi,

the non parallel version is also running out of memory. Perhaps, your code needs to call GC.gc( ) at certain places. thanks

Computing Shapley Effect of Random Forest
ERROR: OutOfMemoryError()
Stacktrace:
[1] copy(::Array{Float64,1}) at .\array.jl:352
[2] DataFrame(::Array{AbstractArray{T,1} where T,1}, ::DataFrames.Index; copycols::Bool) at C:\Users\BCP.julia\packages\DataFrames\S3ZFo\src\dataframe\dataframe.jl:126
[3] fromcolumns(::NamedTuple{(:age, :sex, :capital_gain, :capital_loss, :hours_per_week, Symbol("workclass__ ?"), Symbol("workclass__ Federal-gov"), Symbol("workclass__ Local-gov"), Symbol("workclass__ Never-worked"), Symbol("workclass__ Private"), Symbol("workclass__ Self-emp-inc"), Symbol("workclass__ Self-emp-not-inc"), Symbol("workclass__ State-gov"), Symbol("marital_status__ Divorced"), Symbol("marital_status__ Married-AF-spouse"), Symbol("marital_status__ Married-civ-spouse"), Symbol("marital_status__ Married-spouse-absent"), Symbol("marital_status__ Never-married"), Symbol("marital_status__ Separated"), Symbol("occupation__ ?"), Symbol("occupation__ Adm-clerical"), Symbol("occupation__ Armed-Forces"), Symbol("occupation__ Craft-repair"), Symbol("occupation__ Exec-managerial"), Symbol("occupation__ Farming-fishing"), Symbol("occupation__ Handlers-cleaners"), Symbol("occupation__ Machine-op-inspct"), Symbol("occupation__ Other-service"), Symbol("occupation__ Priv-house-serv"), Symbol("occupation__ Prof-specialty"), Symbol("occupation__ Protective-serv"), Symbol("occupation__ Sales"), Symbol("occupation__ Tech-support"), Symbol("relationship__ Husband"), Symbol("relationship__ Not-in-family"), Symbol("relationship__ Other-relative"), Symbol("relationship__ Own-child"), Symbol("relationship__ Unmarried"), Symbol("race__ Amer-Indian-Eskimo"), Symbol("race__ Asian-Pac-Islander"), Symbol("race__ Black"), Symbol("race__ Other"), Symbol("native_country__ ?"), Symbol("native_country__ Cambodia"), Symbol("native_country__ Canada"), Symbol("native_country__ China"), Symbol("native_country__ Columbia"), Symbol("native_country__ Cuba"), Symbol("native_country__ Dominican-Republic"), Symbol("native_country__ Ecuador"), Symbol("native_country__ El-Salvador"), Symbol("native_country__ England"), Symbol("native_country__ France"), Symbol("native_country__ Germany"), Symbol("native_country__ Greece"), Symbol("native_country__ Guatemala"), Symbol("native_country__ Haiti"), Symbol("native_country__ Holand-Netherlands"), Symbol("native_country__ Honduras"), Symbol("native_country__ Hong"), Symbol("native_country__ Hungary"), Symbol("native_country__ India"), Symbol("native_country__ Iran"), Symbol("native_country__ Ireland"), Symbol("native_country__ Italy"), Symbol("native_country__ Jamaica"), Symbol("native_country__ Japan"), Symbol("native_country__ Laos"), Symbol("native_country__ Mexico"), Symbol("native_country__ Nicaragua"), Symbol("native_country__ Outlying-US(Guam-USVI-etc)"), Symbol("native_country__ Peru"), Symbol("native_country__ Philippines"), Symbol("native_country__ Poland"), Symbol("native_country__ Portugal"), Symbol("native_country__ Puerto-Rico"), Symbol("native_country__ Scotland"), Symbol("native_country__ South"), Symbol("native_country__ Taiwan"), Symbol("native_country__ Thailand"), Symbol("native_country__ Trinadad&Tobago"), Symbol("native_country__ United-States")),NTuple{82,Array{Float64,1}}}, ::Array{Symbol,1}; copycols::Bool) at C:\Users\BCP.julia\packages\DataFrames\S3ZFo\src\other\tables.jl:25
[4] DataFrame(::NamedTuple{(:age, :sex, :capital_gain, :capital_loss, :hours_per_week, Symbol("workclass__ ?"), Symbol("workclass__ Federal-gov"), Symbol("workclass__ Local-gov"), Symbol("workclass__ Never-worked"), Symbol("workclass__ Private"), Symbol("workclass__ Self-emp-inc"), Symbol("workclass__ Self-emp-not-inc"), Symbol("workclass__ State-gov"), Symbol("marital_status__ Divorced"), Symbol("marital_status__ Married-AF-spouse"), Symbol("marital_status__ Married-civ-spouse"), Symbol("marital_status__ Married-spouse-absent"), Symbol("marital_status__ Never-married"), Symbol("marital_status__ Separated"), Symbol("occupation__ ?"), Symbol("occupation__ Adm-clerical"), Symbol("occupation__ Armed-Forces"), Symbol("occupation__ Craft-repair"), Symbol("occupation__ Exec-managerial"), Symbol("occupation__ Farming-fishing"), Symbol("occupation__ Handlers-cleaners"), Symbol("occupation__ Machine-op-inspct"), Symbol("occupation__ Other-service"), Symbol("occupation__ Priv-house-serv"), Symbol("occupation__ Prof-specialty"), Symbol("occupation__ Protective-serv"), Symbol("occupation__ Sales"), Symbol("occupation__ Tech-support"), Symbol("relationship__ Husband"), Symbol("relationship__ Not-in-family"), Symbol("relationship__ Other-relative"), Symbol("relationship__ Own-child"), Symbol("relationship__ Unmarried"), Symbol("race__ Amer-Indian-Eskimo"), Symbol("race__ Asian-Pac-Islander"), Symbol("race__ Black"), Symbol("race__ Other"), Symbol("native_country__ ?"), Symbol("native_country__ Cambodia"), Symbol("native_country__ Canada"), Symbol("native_country__ China"), Symbol("native_country__ Columbia"), Symbol("native_country__ Cuba"), Symbol("native_country__ Dominican-Republic"), Symbol("native_country__ Ecuador"), Symbol("native_country__ El-Salvador"), Symbol("native_country__ England"), Symbol("native_country__ France"), Symbol("native_country__ Germany"), Symbol("native_country__ Greece"), Symbol("native_country__ Guatemala"), Symbol("native_country__ Haiti"), Symbol("native_country__ Holand-Netherlands"), Symbol("native_country__ Honduras"), Symbol("native_country__ Hong"), Symbol("native_country__ Hungary"), Symbol("native_country__ India"), Symbol("native_country__ Iran"), Symbol("native_country__ Ireland"), Symbol("native_country__ Italy"), Symbol("native_country__ Jamaica"), Symbol("native_country__ Japan"), Symbol("native_country__ Laos"), Symbol("native_country__ Mexico"), Symbol("native_country__ Nicaragua"), Symbol("native_country__ Outlying-US(Guam-USVI-etc)"), Symbol("native_country__ Peru"), Symbol("native_country__ Philippines"), Symbol("native_country__ Poland"), Symbol("native_country__ Portugal"), Symbol("native_country__ Puerto-Rico"), Symbol("native_country__ Scotland"), Symbol("native_country__ South"), Symbol("native_country__ Taiwan"), Symbol("native_country__ Thailand"), Symbol("native_country__ Trinadad&Tobago"), Symbol("native_country__ United-States")),NTuple{82,Array{Float64,1}}}; copycols::Bool) at C:\Users\BCP.julia\packages\DataFrames\S3ZFo\src\other\tables.jl:42
[5] DataFrame at C:\Users\BCP.julia\packages\DataFrames\S3ZFo\src\other\tables.jl:31 [inlined]
[6] #table#15 at C:\Users\BCP.julia\packages\MLJBase\O5b6j\src\interface\data_utils.jl:64 [inlined]
[7] table(::NamedTuple{(:age, :sex, :capital_gain, :capital_loss, :hours_per_week, Symbol("workclass__ ?"), Symbol("workclass__ Federal-gov"), Symbol("workclass__ Local-gov"), Symbol("workclass__ Never-worked"), Symbol("workclass__ Private"), Symbol("workclass__ Self-emp-inc"), Symbol("workclass__ Self-emp-not-inc"), Symbol("workclass__ State-gov"), Symbol("marital_status__ Divorced"), Symbol("marital_status__ Married-AF-spouse"), Symbol("marital_status__ Married-civ-spouse"), Symbol("marital_status__ Married-spouse-absent"), Symbol("marital_status__ Never-married"), Symbol("marital_status__ Separated"), Symbol("occupation__ ?"), Symbol("occupation__ Adm-clerical"), Symbol("occupation__ Armed-Forces"), Symbol("occupation__ Craft-repair"), Symbol("occupation__ Exec-managerial"), Symbol("occupation__ Farming-fishing"), Symbol("occupation__ Handlers-cleaners"), Symbol("occupation__ Machine-op-inspct"), Symbol("occupation__ Other-service"), Symbol("occupation__ Priv-house-serv"), Symbol("occupation__ Prof-specialty"), Symbol("occupation__ Protective-serv"), Symbol("occupation__ Sales"), Symbol("occupation__ Tech-support"), Symbol("relationship__ Husband"), Symbol("relationship__ Not-in-family"), Symbol("relationship__ Other-relative"), Symbol("relationship__ Own-child"), Symbol("relationship__ Unmarried"), Symbol("race__ Amer-Indian-Eskimo"), Symbol("race__ Asian-Pac-Islander"), Symbol("race__ Black"), Symbol("race__ Other"), Symbol("native_country__ ?"), Symbol("native_country__ Cambodia"), Symbol("native_country__ Canada"), Symbol("native_country__ China"), Symbol("native_country__ Columbia"), Symbol("native_country__ Cuba"), Symbol("native_country__ Dominican-Republic"), Symbol("native_country__ Ecuador"), Symbol("native_country__ El-Salvador"), Symbol("native_country__ England"), Symbol("native_country__ France"), Symbol("native_country__ Germany"), Symbol("native_country__ Greece"), Symbol("native_country__ Guatemala"), Symbol("native_country__ Haiti"), Symbol("native_country__ Holand-Netherlands"), Symbol("native_country__ Honduras"), Symbol("native_country__ Hong"), Symbol("native_country__ Hungary"), Symbol("native_country__ India"), Symbol("native_country__ Iran"), Symbol("native_country__ Ireland"), Symbol("native_country__ Italy"), Symbol("native_country__ Jamaica"), Symbol("native_country__ Japan"), Symbol("native_country__ Laos"), Symbol("native_country__ Mexico"), Symbol("native_country__ Nicaragua"), Symbol("native_country__ Outlying-US(Guam-USVI-etc)"), Symbol("native_country__ Peru"), Symbol("native_country__ Philippines"), Symbol("native_country__ Poland"), Symbol("native_country__ Portugal"), Symbol("native_country__ Puerto-Rico"), Symbol("native_country__ Scotland"), Symbol("native_country__ South"), Symbol("native_country__ Taiwan"), Symbol("native_country__ Thailand"), Symbol("native_country__ Trinadad&Tobago"), Symbol("native_country__ United-States")),NTuple{82,Array{Float64,1}}}; kw::Base.Iterators.Pairs{Symbol,DataFrame,Tuple{Symbol},NamedTuple{(:prototype,),Tuple{DataFrame}}}) at C:\Users\BCP.julia\packages\MLJModelInterface\aA1k2\src\data_utils.jl:210
[8] transform(::OneHotEncoder, ::MLJModels.OneHotEncoderResult, ::DataFrame) at C:\Users\BCP.julia\packages\MLJModels\i4XcU\src\builtins\Transformers.jl:831
[9] transform(::NodalMachine{OneHotEncoder}, ::DataFrame) at C:\Users\BCP.julia\packages\MLJBase\O5b6j\src\operations.jl:29
[10] (::Node{NodalMachine{OneHotEncoder}})(::DataFrame) at C:\Users\BCP.julia\packages\MLJBase\O5b6j\src\composition\networks.jl:302
[11] #57 at .\none:0 [inlined]
[12] iterate at .\generator.jl:47 [inlined]
[13] collect(::Base.Generator{Tuple{Node{NodalMachine{OneHotEncoder}}},MLJBase.var"#57#58"{DataFrame}}) at .\array.jl:665
[14] (::Node{NodalMachine{RandomForestClassifier}})(::DataFrame) at C:\Users\BCP.julia\packages\MLJBase\O5b6j\src\composition\networks.jl:302
[15] predict(::RandomForestClassifierPipe, ::Node{NodalMachine{RandomForestClassifier}}, ::DataFrame) at C:\Users\BCP.julia\packages\MLJBase\O5b6j\src\composition\composites.jl:45
[16] predict(::Machine{RandomForestClassifierPipe}, ::DataFrame) at C:\Users\BCP.julia\packages\MLJBase\O5b6j\src\operations.jl:29
[17] predict(::MLJTuning.ProbabilisticTunedModel{Grid,RandomForestClassifierPipe,CPU1{Nothing},CPU1{Nothing}}, ::Machine{RandomForestClassifierPipe}, ::DataFrame) at C:\Users\BCP.julia\packages\MLJTuning\JZ7ZX\src\tuned_models.jl:597
[18] predict(::Machine{MLJTuning.ProbabilisticTunedModel{Grid,RandomForestClassifierPipe,CPU1{Nothing},CPU1{Nothing}}}, ::DataFrame) at C:\Users\BCP.julia\packages\MLJBase\O5b6j\src\operations.jl:29
[19] predict_function_mode(::Machine{MLJTuning.ProbabilisticTunedModel{Grid,RandomForestClassifierPipe,CPU1{Nothing},CPU1{Nothing}}}, ::DataFrame) at .\REPL[12]:2
[20] _shap_sample(::DataFrame, ::DataFrame, ::Int64, ::Int64, ::Int64, ::Int64, ::Array{String,1}, ::Array{String,1}, ::Array{Symbol,1}, ::Int64, ::Symbol, ::Array{Int64,1}, ::Bool, ::Machine{MLJTuning.ProbabilisticTunedModel{Grid,RandomForestClassifierPipe,CPU1{Nothing},CPU1{Nothing}}}, ::typeof(predict_function_mode), ::Nothing) at C:\Users\BCP.julia\packages\ShapML\sceNA\src\shap_sample.jl:97
[21] shap(; explain::DataFrame, reference::DataFrame, model::Machine{MLJTuning.ProbabilisticTunedModel{Grid,RandomForestClassifierPipe,CPU1{Nothing},CPU1{Nothing}}}, predict_function::Function, target_features::Nothing, sample_size::Int64, parallel::Nothing, seed::Int64, precision::Nothing, chunk::Bool) at C:\Users\BCP.julia\packages\ShapML\sceNA\src\ShapML.jl:117
[22] trainRandomForest(::DataFrame, ::DataFrame) at .\REPL[13]:53
[23] selectRandomForest(::DataFrame, ::DataFrame, ::Int64) at C:\Users\BCP\github\ICP\GetBlankets.jl:157
[24] getBlanketRandomForest(::DataFrame, ::DataFrame, ::String, ::Int64) at C:\Users\BCP\github\ICP\GetBlankets.jl:137
[25] getBlanketRandomForest at C:\Users\BCP\github\ICP\GetBlankets.jl:131 [inlined]
[26] ForestInvariantCausalPrediction(::DataFrame, ::DataFrame, ::DataFrame; α::Float64, selection::String, verbose::Bool) at C:\Users\BCP\github\ICP\InvariantCausalPrediction.jl:305
[27] top-level scope at REPL[14]:1

julia>

@drcxcruz
Copy link
Author

Hi,

do we must hot encode categorical variables? or does ShapML handle categorical variables?

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant