using ScikitLearn: @sk_import
@sk_import linear_model: LogisticRegression
When the above TestMod is imported, LogisticRegressionis imported and printed:
PyObject <class ‘sklearn.linear_model.logistic.LogisticRegression’>
But after that, strangely LogisticRegression becomes NULL:
Yeah that’s tricky, you need to place the import in the init function, see how I did it here
@baggepinnen, it works very well! I don’t know what to say. Thank you so much!
Here is some small questions:
- what benefit would the use of @eval give us? On the surface, all is fine without @eval.
- How does the trick work?
You’ll find more info here
It seems there is a recommended approach slightly different from mine.
Aha, I understood what is happening now. Thank you!