Closed liuyxpp closed 4 months ago
I forgot to update the readme example when I split up the MLJ interface into its own module. Here is the working version of this example. I will update the readme. Thank you for bringing this to my attention. Let me know if this does not work for you.
module Regression
using CatBoost.MLJCatBoostInterface
using DataFrames
using MLJBase
using PythonCall
# Initialize data
train_data = DataFrame([[1, 4, 30], [4, 5, 40], [5, 6, 50], [6, 7, 60]], :auto)
train_labels = [10.0, 20.0, 30.0]
eval_data = DataFrame([[2, 1], [4, 4], [6, 50], [8, 60]], :auto)
# Initialize CatBoostClassifier
model = CatBoostRegressor(; iterations=2, learning_rate=1.0, depth=2)
mach = machine(model, train_data, train_labels)
# Fit model
MLJBase.fit!(mach)
# Get predictions
preds_class = MLJBase.predict(mach, eval_data)
end # module
Great! It now works like a charm. Thank you!
Closed with #31
Julia version:
CatBoost version: v0.3.3 MLJBase version: v1.1.1
The following line errored:
Do I have to install any other packages?