-
Notifications
You must be signed in to change notification settings - Fork 7
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
Naive passing of Julia class_weight
dictionary does not work
#63
Comments
PythonCall.jl doesn't automatically convert Dicts to Python. You can manually do it with using MLJ
using PythonCall
X, y = @load_iris
Forest = @load RandomForestClassifier pkg=MLJScikitLearnInterface
w = Dict(1=>0.2, 2=>0.7, 3=>0.1)
forest = Forest(class_weight=pydict(w))
mach = machine(forest, X, y) |> fit! One thing to note, it is that we convert the |
@tylerjthomas9 Thanks for the quick response and the workaround. |
Closed by #64 |
At least it doesn't work for RandomForestClassifier:
Currently the
struct
hasclass_weight::Any
. I wonder if it makes any difference if this isUnion{Nothing, AbstractDict}
.@tylerjthomas9 Is there an easy fix for this? Workaround?
The text was updated successfully, but these errors were encountered: