cstjean / ScikitLearn.jl

Julia implementation of the scikit-learn API https://cstjean.github.io/ScikitLearn.jl/dev/
Other
547 stars 75 forks source link

ScikitLearn.jl doesn't work in Pluto notebook #91

Closed yusri-dh closed 3 years ago

yusri-dh commented 3 years ago

I have an error when import ScikitLearn model on Pluto.jl notebook. I already sent a github issue to Pluto jl, however they said the problem come from ScikitLearn side.

Here is the code:

using ScikitLearn

x = begin
    @sk_import linear_model: LogisticRegression
end

showable(MIME"text/html"(), x)

The error:

PyError ($(Expr(:escape, :(ccall(#= /home/yusri/.julia/packages/PyCall/zqDXB/src/pyfncall.jl:43 =# @pysym(:PyObject_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw))))) <class 'TypeError'>

TypeError("'property' object is not callable")

    pyerr_check@exception.jl:60[inlined]
    pyerr_check@exception.jl:64[inlined]
    _handle_error(::String)@exception.jl:81
    macro expansion@exception.jl:95[inlined]
    #110@pyfncall.jl:43[inlined]
    disable_sigint@c.jl:446[inlined]
    __pycall!@pyfncall.jl:42[inlined]
    _pycall!(::PyCall.PyObject, ::PyCall.PyObject, ::Tuple{}, ::Int64, ::Ptr{Nothing})@pyfncall.jl:29
    _pycall!@pyfncall.jl:11[inlined]
    #pycall#115@pyfncall.jl:80[inlined]
    pycall@pyfncall.jl:80[inlined]
    showable(::MIME{Symbol("text/html")}, ::PyCall.PyObject)@PyCall.jl:894
    #invokelatest#1(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(Base.invokelatest), ::Any, ::Any, ::Vararg{Any,N} where N)@essentials.jl:710
    invokelatest(::Any, ::Any, ::Vararg{Any,N} where N)@essentials.jl:709
    top-level scope@Local: 1

The code is working well in my repl, however it is not working in Pluto jl. Is there any advice?

cstjean commented 3 years ago

Could you give a link to the Pluto.jl issue?

yusri-dh commented 3 years ago

@cstjean sure, here it is fonsp/Pluto.jl#412

cstjean commented 3 years ago

https://github.com/JuliaPy/PyCall.jl/issues/816