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: LoadError: BoundsError: pkg = DecisionTree #607

Closed
drcxcruz opened this issue Jul 21, 2020 · 10 comments
Closed

ERROR: LoadError: BoundsError: pkg = DecisionTree #607

drcxcruz opened this issue Jul 21, 2020 · 10 comments

Comments

@drcxcruz
Copy link
Contributor

drcxcruz commented Jul 21, 2020

Describe the bug
hello again,

I am puzzled as to why I am getting the following error. My data seems fine and the code works with the load_crabs test set. It could be a data type issue. Do you have any comments, please? Thank you so much. (The @Everywhere are a must)

To Reproduce

    @everywhere forest_model = MLJ.@load RandomForestClassifier pkg = DecisionTree

    @everywhere pipeRandomForestClassifier = @pipeline FeatureSelector RandomForestClassifier 
    cases = [[Symbol(names(X)[j]) for j in 1:i] for i in 1:ncol(X)]   
    r1 = range(pipeRandomForestClassifier, :(feature_selector.features), values=cases)
    tmRandomForestClassifier = TunedModel(
        model = pipeRandomForestClassifier,
        range = r1,
        measures = [cross_entropy, BrierScore()],
        resampling = CV(nfolds = 10)  
    )  



println(names(X), typeof(X))
println(unique(X[:,1]), " ", typeof(X[:,1]))
println(unique(X[:,2]), " ", typeof(X[:,2]))
println(unique(y), typeof(y))
	

["age", "f1"] DataFrame

[35.0, 33.0, 54.0, 20.0, 49.0, 68.0, 42.0, 61.0, 77.0, 40.0, 30.0, 37.0, 48.0, 18.0, 67.0, 73.0, 22.0, 43.0, 60.0, 55.0, 41.0, 23.0, 56.0, 74.0, 80.0, 72.0, 39.0, 57.0, 51.0, 25.0, 58.0, 38.0, 46.0, 50.0, 75.0, 59.0, 53.0, 29.0, 19.0, 31.0, 32.0, 45.0, 28.0, 76.0, 36.0, 27.0, 64.0, 17.0, 52.0, 65.0, 24.0, 66.0, 47.0, 44.0, 62.0, 26.0, 34.0, 71.0, 63.0, 21.0, 69.0, 79.0, 70.0, 90.0, 81.0, 78.0, 82.0, 83.0, 85.0, 84.0, 89.0, 88.0, 87.0, 86.0] Array{Float64,1}

[0.0, 1.0] Array{Float64,1}

[0, 1] CategoricalArray{Int64,1,UInt32,Int64,CategoricalValue{Int64,UInt32},Union{}}



	mtm = machine(tmRandomForestClassifier, X, y)

    Base.invokelatest( fit!, mtm)

[ Info: Training Machine{ProbabilisticTunedModel{Grid,…}} @120.
[ Info: Attempting to evaluate 2 models.
Evaluating over 2 metamodels: 0%[> ] ETA: N/A ERROR: LoadError: BoundsError
Stacktrace:
[1] getindex at .\number.jl:78 [inlined]
[2] getter at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\univariate_finite\arrays.jl:137 [inlined]
[3] _broadcast_getindex_evalf at .\broadcast.jl:631 [inlined]
[4] _broadcast_getindex at .\broadcast.jl:604 [inlined]
[5] getindex at .\broadcast.jl:564 [inlined]
[6] macro expansion at .\broadcast.jl:910 [inlined]
[7] macro expansion at .\simdloop.jl:77 [inlined]
[8] copyto! at .\broadcast.jl:909 [inlined]
[9] copyto! at .\broadcast.jl:864 [inlined]
[10] copy at .\broadcast.jl:840 [inlined]
[11] materialize at .\broadcast.jl:820 [inlined]
[12] broadcasted(::typeof(pdf), ::MLJBase.UnivariateFiniteArray{Multiclass{2},Int64,UInt32,Float64,1}, ::CategoricalArray{Int64,1,UInt32,Int64,CategoricalValue{Int64,UInt32},Union{}}) at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\univariate_finite\arrays.jl:138
[13] broadcast at .\broadcast.jl:758 [inlined]
[14] (::BrierScore{UnivariateFinite})(::MLJBase.UnivariateFiniteArray{Multiclass{2},Int64,UInt32,Float64,1}, ::CategoricalArray{Int64,1,UInt32,Int64,CategoricalValue{Int64,UInt32},Union{}}, ::Nothing) at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\measures\finite.jl:183
[15] BrierScore at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\measures\finite.jl:173 [inlined]
[16] value at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\measures\measures.jl:78 [inlined]
[17] value(::BrierScore{UnivariateFinite}, ::MLJBase.UnivariateFiniteArray{Multiclass{2},Int64,UInt32,Float64,1}, ::DataFrame, ::CategoricalArray{Int64,1,UInt32,Int64,CategoricalValue{Int64,UInt32},Union{}}, ::Nothing) at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\measures\measures.jl:64
[18] (::MLJBase.var"#264#269"{DataFrame,CategoricalArray{Int64,1,UInt32,Int64,CategoricalValue{Int64,UInt32},Union{}},MLJBase.UnivariateFiniteArray{Multiclass{2},Int64,UInt32,Float64,1}})(::BrierScore{UnivariateFinite}) at .\none:0
[19] iterate at .\generator.jl:47 [inlined]
[20] collect_to!(::Array{Array{Float64,1},1}, ::Base.Generator{Array{MLJBase.Measure,1},MLJBase.var"#264#269"{DataFrame,CategoricalArray{Int64,1,UInt32,Int64,CategoricalValue{Int64,UInt32},Union{}},MLJBase.UnivariateFiniteArray{Multiclass{2},Int64,UInt32,Float64,1}}}, ::Int64, ::Int64) at .\array.jl:711
[21] collect_to_with_first!(::Array{Array{Float64,1},1}, ::Array{Float64,1}, ::Base.Generator{Array{MLJBase.Measure,1},MLJBase.var"#264#269"{DataFrame,CategoricalArray{Int64,1,UInt32,Int64,CategoricalValue{Int64,UInt32},Union{}},MLJBase.UnivariateFiniteArray{Multiclass{2},Int64,UInt32,Float64,1}}}, ::Int64) at .\array.jl:689
[22] collect(::Base.Generator{Array{MLJBase.Measure,1},MLJBase.var"#264#269"{DataFrame,CategoricalArray{Int64,1,UInt32,Int64,CategoricalValue{Int64,UInt32},Union{}},MLJBase.UnivariateFiniteArray{Multiclass{2},Int64,UInt32,Float64,1}}}) at .\array.jl:670
[23] (::MLJBase.var"#get_measurements#268"{Array{Tuple{Array{Int64,1},UnitRange{Int64}},1},Nothing,Int64,Array{MLJBase.Measure,1},typeof(predict),Bool,DataFrame,CategoricalArray{Int64,1,UInt32,Int64,CategoricalValue{Int64,UInt32},Union{}}})(::Machine{Pipeline407}, ::Int64) at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\resampling.jl:779
[24] #248 at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\resampling.jl:644 [inlined]
[25] _mapreduce(::MLJBase.var"#248#249"{MLJBase.var"#get_measurements#268"{Array{Tuple{Array{Int64,1},UnitRange{Int64}},1},Nothing,Int64,Array{MLJBase.Measure,1},typeof(predict),Bool,DataFrame,CategoricalArray{Int64,1,UInt32,Int64,CategoricalValue{Int64,UInt32},Union{}}},Machine{Pipeline407},Int64,ProgressMeter.Progress}, ::typeof(vcat), ::IndexLinear, ::UnitRange{Int64}) at .\reduce.jl:400
[26] _mapreduce_dim at .\reducedim.jl:312 [inlined]
[27] #mapreduce#580 at .\reducedim.jl:307 [inlined]
[28] mapreduce at .\reducedim.jl:307 [inlined]
[29] _evaluate!(::MLJBase.var"#get_measurements#268"{Array{Tuple{Array{Int64,1},UnitRange{Int64}},1},Nothing,Int64,Array{MLJBase.Measure,1},typeof(predict),Bool,DataFrame,CategoricalArray{Int64,1,UInt32,Int64,CategoricalValue{Int64,UInt32},Union{}}}, ::Machine{Pipeline407}, ::CPU1{Nothing}, ::Int64, ::Int64) at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\resampling.jl:643
[30] evaluate!(::Machine{Pipeline407}, ::Array{Tuple{Array{Int64,1},UnitRange{Int64}},1}, ::Nothing, ::Nothing, ::Int64, ::Int64, ::Array{MLJBase.Measure,1}, ::typeof(predict), ::CPU1{Nothing}, ::Bool) at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\resampling.jl:796
[31] evaluate!(::Machine{Pipeline407}, ::CV, ::Nothing, ::Nothing, ::Int64, ::Int64, ::Array{MLJBase.Measure,1}, ::Function, ::CPU1{Nothing}, ::Bool) at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\resampling.jl:859
[32] fit(::Resampler{CV,Pipeline407}, ::Int64, ::DataFrame, ::CategoricalArray{Int64,1,UInt32,Int64,CategoricalValue{Int64,UInt32},Union{}}) at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\resampling.jl:959
[33] fit_only!(::Machine{Resampler{CV,Pipeline407}}; rows::Nothing, verbosity::Int64, force::Bool) at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\machines.jl:416
[34] #fit!#80 at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\machines.jl:461 [inlined]
[35] event(::Pipeline407, ::Machine{Resampler{CV,Pipeline407}}, ::Int64, ::Grid, ::Nothing, ::NamedTuple{(:models, :fields, :parameter_scales),Tuple{Array{Pipeline407,1},Array{Expr,1},Array{Symbol,1}}}) at C:\Users\BCP.julia\packages\MLJTuning\TShXP\src\tuned_models.jl:257
[36] #6 at C:\Users\BCP.julia\packages\MLJTuning\TShXP\src\tuned_models.jl:291 [inlined]
[37] iterate at .\generator.jl:47 [inlined]
[38] _collect(::Array{Pipeline407,1}, ::Base.Generator{Array{Pipeline407,1},MLJTuning.var"#6#7"{Machine{Resampler{CV,Pipeline407}},Int64,Grid,Nothing,NamedTuple{(:models, :fields, :parameter_scales),Tuple{Array{Pipeline407,1},Array{Expr,1},Array{Symbol,1}}},ProgressMeter.Progress}}, ::Base.EltypeUnknown, ::Base.HasShape{1}) at .\array.jl:678
[39] collect_similar at .\array.jl:607 [inlined]
[40] map at .\abstractarray.jl:2072 [inlined]
[41] assemble_events(::Array{Pipeline407,1}, ::Machine{Resampler{CV,Pipeline407}}, ::Int64, ::Grid, ::Nothing, ::NamedTuple{(:models, :fields, :parameter_scales),Tuple{Array{Pipeline407,1},Array{Expr,1},Array{Symbol,1}}}, ::CPU1{Nothing}) at C:\Users\BCP.julia\packages\MLJTuning\TShXP\src\tuned_models.jl:290
[42] build(::Nothing, ::Int64, ::Grid, ::Pipeline407, ::NamedTuple{(:models, :fields, :parameter_scales),Tuple{Array{Pipeline407,1},Array{Expr,1},Array{Symbol,1}}}, ::Int64, ::CPU1{Nothing}, ::Machine{Resampler{CV,Pipeline407}}) at C:\Users\BCP.julia\packages\MLJTuning\TShXP\src\tuned_models.jl:454
[43] fit(::MLJTuning.ProbabilisticTunedModel{Grid,Pipeline407}, ::Int64, ::DataFrame, ::CategoricalArray{Int64,1,UInt32,Int64,CategoricalValue{Int64,UInt32},Union{}}) at C:\Users\BCP.julia\packages\MLJTuning\TShXP\src\tuned_models.jl:491
[44] fit_only!(::Machine{MLJTuning.ProbabilisticTunedModel{Grid,Pipeline407}}; rows::Nothing, verbosity::Int64, force::Bool) at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\machines.jl:416
[45] fit_only! at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\machines.jl:384 [inlined]
[46] #fit!#80 at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\machines.jl:461 [inlined]
[47] fit!(::Machine{MLJTuning.ProbabilisticTunedModel{Grid,Pipeline407}}) at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\machines.jl:459
[48] #invokelatest#1 at .\essentials.jl:712 [inlined]
[49] invokelatest at .\essentials.jl:711 [inlined]
[50] fitAndPredict(::MLJTuning.ProbabilisticTunedModel{Grid,Pipeline407}, ::DataFrame, ::CategoricalArray{Int64,1,UInt32,Int64,CategoricalValue{Int64,UInt32},Union{}}) at C:\Users\BCP.julia\dev\

Expected behavior
no error or a clearer error message as to what is wrong :)

Additional context

Versions
(@v1.4) pkg> status
Status C:\Users\BCP\.julia\environments\v1.4\Project.toml
[336ed68f] CSV v0.7.4
[324d7699] CategoricalArrays v0.8.1
[aaaa29a8] Clustering v0.14.1
[861a8166] Combinatorics v1.0.2
[a93c6f00] DataFrames v0.21.4
[7806a523] DecisionTree v0.10.7
[31c24e10] Distributions v0.23.5
[f6006082] EvoTrees v0.4.9
[da1fdf0e] FreqTables v0.4.0
[38e38edf] GLM v1.3.9
[0e44f5e4] Hwloc v1.0.3
[09f84164] HypothesisTests v0.10.0
[7073ff75] IJulia v1.21.2
[b1bec4e5] LIBSVM v0.4.0
[7acf609c] LightGBM v0.3.1
[add582a8] MLJ v0.12.0
[6ee0df7b] MLJLinearModels v0.5.0
[d491faf4] MLJModels v0.11.2
[e1d29d7a] Missings v0.4.3
[42b8e9d4] ParallelKMeans v0.1.8
[14b8a8f1] PkgTemplates v0.7.6
[54e16d92] PrettyPrinting v0.2.0
[1a8c2f83] Query v0.12.2
[612083be] Queryverse v0.6.1
[8523bd24] ShapML v0.3.0 #master (https://github.com/nredell/ShapML.jl)
[2913bbd2] StatsBase v0.33.0
[bd369af6] Tables v1.0.4
[112f6efa] VegaLite v2.2.0
[009559a3] XGBoost v1.1.1

@OkonSamuel
Copy link
Member

OkonSamuel commented Jul 21, 2020

The above code works well with the Crabs dataset. It's probably an issue with your dataset. Can you share your dataset??
Also is there any reason for using invokelatest or did you modify fit! method

@drcxcruz
Copy link
Contributor Author

drcxcruz commented Jul 21, 2020

hi there,

issue.zip

Thank you for your time. Here are two files. X.csv was created with CSV.write and it is the X data frame. The y.csv file was created by saving the categorical vector to data frame and then CSV.write it. Do not get confuse that the X dataframe as a column named y which is NOT the target.

I am using Base.invokelatest because fit!(mtm) is generating error

ERROR: LoadError: MethodError: no method matching fit(::Pipeline565, ::Int64, ::DataFrame, ::CategoricalArray{Int64,1,UInt32,Int64,CategoricalValue{Int64,UInt32},Union{}})
The applicable method may be too new: running in world age 28058, while current world is 28090.
Closest candidates are:
fit(::Pipeline565, ::Integer, ::Any...) at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\composition\models\from_network.jl:168 (method too new to be called from this world context.)
fit(::Supervised, ::Integer, ::Any, ::Any, ::Any) at C:\Users\BCP.julia\packages\MLJModelInterface\DJKg2\src\model_api.jl:11
fit(::MLJModels.DeterministicConstantRegressor, ::Int64, ::Any, ::Any) at C:\Users\BCP.julia\packages\MLJModels\BQAzu\src\builtins\Constant.jl:43
...
Stacktrace:
[1] fit_only!(::Machine{Pipeline565}; rows::Array{Int64,1}, verbosity::Int64, force::Bool) at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\machines.jl:416
[2] #fit!#80 at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\machines.jl:461 [inlined]
[3] (::MLJBase.var"#get_measurements#268"{Array{Tuple{Array{Int64,1},UnitRange{Int64}},1},Nothing,Int64,Array{MLJBase.Measure,1},typeof(predict),Bool,DataFrame,CategoricalArray{Int64,1,UInt32,Int64,CategoricalValue{Int64,UInt32},Union{}}})(::Machine{Pipeline565}, ::Int64) at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\resampling.jl:770
[4] #248 at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\resampling.jl:644 [inlined]
[5] _mapreduce(::MLJBase.var"#248#249"{MLJBase.var"#get_measurements#268"{Array{Tuple{Array{Int64,1},UnitRange{Int64}},1},Nothing,Int64,Array{MLJBase.Measure,1},typeof(predict),Bool,DataFrame,CategoricalArray{Int64,1,UInt32,Int64,CategoricalValue{Int64,UInt32},Union{}}},Machine{Pipeline565},Int64,ProgressMeter.Progress}, ::typeof(vcat), ::IndexLinear, ::UnitRange{Int64}) at .\reduce.jl:400
[6] _mapreduce_dim at .\reducedim.jl:312 [inlined]
[7] #mapreduce#580 at .\reducedim.jl:307 [inlined]
[8] mapreduce at .\reducedim.jl:307 [inlined]
[9] _evaluate!(::MLJBase.var"#get_measurements#268"{Array{Tuple{Array{Int64,1},UnitRange{Int64}},1},Nothing,Int64,Array{MLJBase.Measure,1},typeof(predict),Bool,DataFrame,CategoricalArray{Int64,1,UInt32,Int64,CategoricalValue{Int64,UInt32},Union{}}}, ::Machine{Pipeline565}, ::CPU1{Nothing}, ::Int64, ::Int64) at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\resampling.jl:643
[10] evaluate!(::Machine{Pipeline565}, ::Array{Tuple{Array{Int64,1},UnitRange{Int64}},1}, ::Nothing, ::Nothing, ::Int64, ::Int64, ::Array{MLJBase.Measure,1}, ::typeof(predict), ::CPU1{Nothing}, ::Bool) at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\resampling.jl:796
[11] evaluate!(::Machine{Pipeline565}, ::CV, ::Nothing, ::Nothing, ::Int64, ::Int64, ::Array{MLJBase.Measure,1}, ::Function, ::CPU1{Nothing}, ::Bool) at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\resampling.jl:859
[12] fit(::Resampler{CV,Pipeline565}, ::Int64, ::DataFrame, ::CategoricalArray{Int64,1,UInt32,Int64,CategoricalValue{Int64,UInt32},Union{}}) at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\resampling.jl:959
[13] fit_only!(::Machine{Resampler{CV,Pipeline565}}; rows::Nothing, verbosity::Int64, force::Bool) at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\machines.jl:416
[14] #fit!#80 at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\machines.jl:461 [inlined]
[15] event(::Pipeline565, ::Machine{Resampler{CV,Pipeline565}}, ::Int64, ::Grid, ::Nothing, ::NamedTuple{(:models, :fields, :parameter_scales),Tuple{Array{Pipeline565,1},Array{Expr,1},Array{Symbol,1}}}) at C:\Users\BCP.julia\packages\MLJTuning\TShXP\src\tuned_models.jl:257
[16] #6 at C:\Users\BCP.julia\packages\MLJTuning\TShXP\src\tuned_models.jl:291 [inlined]
[17] iterate at .\generator.jl:47 [inlined]
[18] _collect(::Array{Pipeline565,1}, ::Base.Generator{Array{Pipeline565,1},MLJTuning.var"#6#7"{Machine{Resampler{CV,Pipeline565}},Int64,Grid,Nothing,NamedTuple{(:models, :fields, :parameter_scales),Tuple{Array{Pipeline565,1},Array{Expr,1},Array{Symbol,1}}},ProgressMeter.Progress}}, ::Base.EltypeUnknown, ::Base.HasShape{1}) at .\array.jl:678
[19] collect_similar at .\array.jl:607 [inlined]
[20] map at .\abstractarray.jl:2072 [inlined]
[21] assemble_events(::Array{Pipeline565,1}, ::Machine{Resampler{CV,Pipeline565}}, ::Int64, ::Grid, ::Nothing, ::NamedTuple{(:models, :fields, :parameter_scales),Tuple{Array{Pipeline565,1},Array{Expr,1},Array{Symbol,1}}}, ::CPU1{Nothing}) at C:\Users\BCP.julia\packages\MLJTuning\TShXP\src\tuned_models.jl:290
[22] build(::Nothing, ::Int64, ::Grid, ::Pipeline565, ::NamedTuple{(:models, :fields, :parameter_scales),Tuple{Array{Pipeline565,1},Array{Expr,1},Array{Symbol,1}}}, ::Int64, ::CPU1{Nothing}, ::Machine{Resampler{CV,Pipeline565}}) at C:\Users\BCP.julia\packages\MLJTuning\TShXP\src\tuned_models.jl:454
[23] fit(::MLJTuning.ProbabilisticTunedModel{Grid,Pipeline565}, ::Int64, ::DataFrame, ::CategoricalArray{Int64,1,UInt32,Int64,CategoricalValue{Int64,UInt32},Union{}}) at C:\Users\BCP.julia\packages\MLJTuning\TShXP\src\tuned_models.jl:491
[24] fit_only!(::Machine{MLJTuning.ProbabilisticTunedModel{Grid,Pipeline565}}; rows::Nothing, verbosity::Int64, force::Bool) at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\machines.jl:416
[25] fit_only! at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\machines.jl:384 [inlined]
[26] #fit!#80 at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\machines.jl:461 [inlined]
[27] fit! at C:\Users\BCP.julia\packages\MLJBase\CcEkh\src\machines.jl:459 [inlined]
[28] fitAndPredict(::MLJTuning.ProbabilisticTunedModel{Grid,Pipeline565}, ::DataFrame, ::CategoricalArray{Int64,1,UInt32,Int64,CategoricalValue{Int64,UInt32},Union{}}) at C:\Users\BCP.julia\dev...

@drcxcruz
Copy link
Contributor Author

hi

to make a bit it more clear, perhaps. here is my function that calls the fit

@Everywhere function fitAndPredict(
tmRandomForestClassifier,
X::DataFrame,
y::CategoricalArray{Int64,1,UInt32,Int64,CategoricalValue{Int64,UInt32},Union{}},
)

mtm = machine(tmRandomForestClassifier, X, y)
Base.invokelatest( fit!, mtm)

#fit!(mtm)

ŷ = MLJ.predict(mtm, X)
ŷMode = [mode(ŷ[i]) for i in 1:length(ŷ)]
return ((ŷMode = ŷMode, mtm = mtm))

end

@OkonSamuel
Copy link
Member

OkonSamuel commented Jul 21, 2020

@drcxcruz thanks for reporting. I can reproduce the error on my PC. It occurs when BrierScore() is used as a measure. This looks like a bug in UnivariateFinite(I will look into it) for now removing BrierScore avoids the error.

@drcxcruz
Copy link
Contributor Author

you are very good! thank you so much! I am glad we found it!

no rush from my side, just curious, when could we expect a fix in production?

@OkonSamuel
Copy link
Member

OkonSamuel commented Jul 21, 2020

when could we expect a fix in production?

Hopefully soon.

Had a second look at it and found that the issue was ultimately caused by resampling. During cross-validation some samples only had a single class causing trouble when computing

@ablaom
Copy link
Member

ablaom commented Jul 22, 2020

@OkonSamuel Thanks for investigating. In principle we should not have a problem with missing classes, because the measure takes a categorical array and a UnivariateFiniteArray which track all the classes. Do you have a minimum working example?

@OkonSamuel
Copy link
Member

OkonSamuel commented Jul 22, 2020

@ablaom I just opened a PR at MLJBase#fixes branch with the solution.
PS
I just tested the above example using MLJ with MLJBase#fixes branch and everything works perfectly

@ablaom
Copy link
Member

ablaom commented Jul 22, 2020

@drcxcruz This new version of MLJBase should hopefully fix the problem: JuliaRegistries/General#18317

If so please close.

@drcxcruz
Copy link
Contributor Author

thank you for fixing this so quickly!

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

3 participants