Git Product home page Git Product logo

Comments (6)

sylvaticus avatar sylvaticus commented on June 14, 2024

going to check, thanks to report....

from betaml.jl.

sylvaticus avatar sylvaticus commented on June 14, 2024

Hello, I can't reproduce... this script, where I used your code, works as expected...

using Pkg
Pkg.activate(temp=true)
Pkg.add("MLJ")
using DelimitedFiles,MLJ


# Iris dataset
X, y        = @load_iris

# Your code...
modelType = @load RandomForestClassifier pkg = "BetaML" verbosity=1
mod = modelType(
n_trees = 2,
max_depth = 10
)

mach        = machine(mod, X, y)
fit!(mach)
cat_est    = predict(mach, X)
ŷ =   MLJ.mode.(cat_est)
accuracy = sum(y .== ŷ) / length(y) # 0.95

Be sure you have the latest versions of both MLJ and BetaML (respectively v0.20.2 and v0.11.3)

from betaml.jl.

sylvaticus avatar sylvaticus commented on June 14, 2024

Hello, do you still have the issue after updating to latest versions?

from betaml.jl.

JoshuaBillson avatar JoshuaBillson commented on June 14, 2024

I found this issue because I was having a similar problem. Attempting to load the RandomForestClassifier model directly was failing to resolve, but doing so with @load worked. On further analysis, it appears that RandomForestClassifier is in the sub-module Bmlj, which needs to be explicitly included. For example:

# This Works
model = (MLJ.@load RandomForestClassifier pkg = "BetaML")()

# Also Works
model = BetaML.Bmlj.RandomForestClassifier()

# Doesn't Work
model = BetaML.RandomForestClassifier()

Moreover, the links to the MLJ models appear to be broken in the README.

I'm assuming this is a recent change? It would be nice to be able to access the MLJ models directly from the BetaML module. Alternatively, the documentation should be clearer to avoid confusion.

from betaml.jl.

sylvaticus avatar sylvaticus commented on June 14, 2024

Hi, model = BetaML.RandomForestClassifier() is NOT supposed to work.
You can access RandomForestClassifier and RandomForestRegressor trought the MLJ @load method, or the RandomForestEstimator trought the BetaML interface (the first two are just wrappers to the third one).
While names are different in this case, sometimes the names of the models are the same, this is why BetaML does NOT export the MLJ-interface models.
If you want the MLJ interface models without using @load, you can do:

using BetaML # or import
m = BetaML.Bmlj.RandomForestClassifier()

Thanks for the report on the links and let me know if I can close this issue...

from betaml.jl.

sylvaticus avatar sylvaticus commented on June 14, 2024

..closing... feel free to reopen if needed...

from betaml.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.