You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Good afternoon,
I like MLJ more and more, thanks to the developers.
I'm still in a learning process, and I had an error with MLJTunning, when I'm working with Random Forest, I do the following for max_depth:
"r5 = range (model, :max_depth, lower = 1, upper = 5)" and I get the following:
ERROR: ArgumentError: The inferred hyper-parameter type is Nothing, which is nominal. If this is true, you must specify values=... If this is false, specify the correct type as first argument of range, as in the example, range(Int, :dummy, lower=1, upper=10).
Stacktrace:
Could you help me with a solution.
Thanks a lot
Hugs
The text was updated successfully, but these errors were encountered:
Yes, thanks for reporting, and thanks for the positive feedback.
What is likely happening is that model.max_depth === nothing because this is the default value. (I cannot say for sure without knowing which RandomForest you are using. Is ScikitLearn, DecisionTree or BetaML?) Of course, it can also take integer values.
But range is inferring the type from the current value, and so thinks :max_depth is a nominal hyper-parameter, rather than a numeric one.
There is a work-around suggested in the error message report:
If this is false, specify the correct type as first argument of range, as in the example, range(Int, :dummy, lower=1, upper=10).
That is, instead of model specify the type for the range of values (Int in this case):
Good afternoon,
I like MLJ more and more, thanks to the developers.
I'm still in a learning process, and I had an error with MLJTunning, when I'm working with Random Forest, I do the following for max_depth:
"r5 = range (model, :max_depth, lower = 1, upper = 5)" and I get the following:
ERROR: ArgumentError: The inferred hyper-parameter type is Nothing, which is nominal. If this is true, you must specify values=... If this is false, specify the correct type as first argument of
range
, as in the example,range(Int, :dummy, lower=1, upper=10)
.Stacktrace:
Could you help me with a solution.
Thanks a lot
Hugs
The text was updated successfully, but these errors were encountered: