-
Notifications
You must be signed in to change notification settings - Fork 76
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
Questions on importing #108
Comments
Can you please post the error messages too? eg. julia> using ScikitLearn
julia> @sk_import linear_model: LinearRegression
ERROR: LoadError: UndefVarError: @sk_import not defined
in expression starting at REPL[9]:1 |
(1) I'm only getting an error if @sk_import is within a try-catch statement:
If @sk_import is placed outside a try-catch, then I only get a warning (on a re-run). Note that I'm actually trying to load MLPClassifier and not LinearRegression (just wanted to be consistent with your webpage).
Btw, how do I silence such warnings? (2) The error for my second question (again, when within a try-catch):
|
If Please post the full code + error message next time. To quote code, you can use
Suppressor.jl, maybe? |
Ok, so @sk_import does not work within try-catch at all? Yes, I've tried Suppressor.jl but it gives an error when around @sk_import. So no -silence mode or similar? Could this be a general issue, @sk_import just doesn't work well in blocks? |
Quite likely. It's not a typical use case. It could probably be fixed, but it would be complicated macro work, so I wouldn't count on it, and I would look for other ways of achieving the same outcome if I were you. |
I have a couple of basic questions regarding the instructions on the page: ScikitLearn.jl > Python models.
(1) How do you run the following command from a .jl file? It throws me an error if I just paste it into a file, though runs fine in the REPL.
@sk_import linear_model: LinearRegression
(2) The following command runs fine from a .jl file, but I get an error that LinearRegression is undefined when I try to use it.
Conda.add("scikit-learn")
Do I need to add more code to import a subroutine like LinearRegression?
The text was updated successfully, but these errors were encountered: