# MLJ w/Scikitlearn: passing return\_std to predict

**URL:** <https://discourse.julialang.org/t/mlj-w-scikitlearn-passing-return-std-to-predict/91654>\
**Category:** Machine Learning\
**Tags:** mlj, scikitlearn\
**Created:** [December 14, 2022, 7:52pm UTC](https://discourse.julialang.org/t/mlj-w-scikitlearn-passing-return-std-to-predict/91654 "2022-12-14T19:52:26Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![evolbio](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evolbio/32/30793_2.png) [@evolbio](https://discourse.julialang.org/u/evolbio)\
**Post date:** [December 19, 2022, 1:51pm UTC](https://discourse.julialang.org/t/mlj-w-scikitlearn-passing-return-std-to-predict/91654/6 "2022-12-19T13:51:07Z")

</div>

Thank you, I appreciate all of the help you have given on this. I agree that all of the Bayesian routines in SLK should probabilistic models in MLJ, that would be best in the long run.

For now, I managed to call ScikitLearn.jl directly. In doing that, I found that calling ScilearnKit.jl is easy from REPL, but to make the call from a function in the way that I needed, I had to resort to an obscure workaround:

> [@Error when calling ScikitLearn from a function in a Package](https://discourse.julialang.org/t/error-when-calling-scikitlearn-from-a-function-in-a-package/46131/8):
>
> Thanks! This works, using ScikitLearn, PyCall const LogisticRegression = PyNULL() function \_\_init\_\_() @eval @sk\_import linear\_model: LogisticRegression end function logistic\_skl(points::AbstractMatrix{\<:Real}, labels::AbstractVector{Bool}) log\_reg = fit!(LogisticRegression(penalty="l2"), points', labels) w = vec(log\_reg.coef\_) b = only(log\_reg.intercept\_) return w, b end However, I do get a warning from modifying the const: WARNING: redefinition of constant LogisticReg…

Perhaps there is some other way, but I could not find it. It seems strange that something as basic as calling via a function requires an undocumented hack. In any case, I have a simple workaround for now that allows me to move ahead.

---

_[View the full topic](https://discourse.julialang.org/t/mlj-w-scikitlearn-passing-return-std-to-predict/91654)._
