-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please add some example with real Dataset, it is not working. #17
Comments
Is there an example or tutorial you like for the python interface to CatBoost? This is just a light wrapper of the python interface so any examples there should translate pretty easily. If you link one you are having trouble translating I could help. If you are getting errors, please post them as minimal examples with the error message and stack trace. It could be a bug in the wrapper code here. |
I have dataFrame data, Pylist is not working. Please add any example with these features (https://github.com/catboost/tutorials/tree/master/regression) input feature data, lable data , is hard to define. Catboost is best, nothing comparable to catboost. Thank you. |
If you want to work with DataFrames.jl/Tables.jl, you have to convert it to a python table using the https://cjdoris.github.io/PythonCall.jl/stable/compat/#PythonCall.pytable Here is an example: using CatBoost
using DataFrames
using PythonCall
df_train = DataFrame(a=[1,4,30], b=[4,5,40], c=[5,6,50], d=[6,7,60])
train_data = pytable(df_train)
df_eval = DataFrame(a=[2,1], b=[4,4], c=[6,50], d=[8,60])
eval_data = pytable(df_eval)
train_labels = PyList([10, 20, 30])
# Initialize CatBoostRegressor
model = CatBoostRegressor(; iterations=2, learning_rate=1, depth=2)
# Fit model
fit!(model, train_data, train_labels)
# Get predictions
preds = predict(model, eval_data) Additionally, you should be able to leave the dataframe as a DataFrames.jl object. Here is an example: using CatBoost
using DataFrames
using PythonCall
train_data= DataFrame(a=[1,4,30], b=[4,5,40], c=[5,6,50], d=[6,7,60])
eval_data= DataFrame(a=[2,1], b=[4,4], c=[6,50], d=[8,60])
train_labels = PyList([10, 20, 30])
# Initialize CatBoostRegressor
model = CatBoostRegressor(; iterations=2, learning_rate=1, depth=2)
# Fit model
fit!(model, train_data, train_labels)
# Get predictions
preds = predict(model, eval_data) |
Thank you . it is working. |
I can not replicate this. What platform are you on? Can you try in a fresh environment with just CatBoost, DataFrames, PythonCall? Does the test suite pass for you? |
When following an example in CatBoost:
When running this I end up with the following error:
Is "using CatBoost" trying to run the python version of catboost? I do have the python version installed, but I don't see why it would shoot this error at me.. If I run the "using CatBoost" again it gives no error, but when I run the model line:
the terminal crashes and spits out this error:
Running a test on CatBoost in pkg fails I believe due to:
As this process installs 15 packages on a mini-conda but can't get catboost from libmamda... I have Anaconda installed with catboost - why does this check here instead of my local? Is there a way to fix this?
|
PythonCall.jl automatically creates a python environment. Here is a guide on using your own conda environments with PythonCall.jl: https://cjdoris.github.io/PythonCall.jl/stable/pythoncall/#If-you-already-have-a-Conda-environment
Yes it is. From your error output, it appears that PythonCall.jl is failing when importing catboost. Can you try manually installing catboost via CondaPkg.jl? I am unable to replicate the issue Here is the CondaPkg command to install catboost: CondaPkg.add("catboost", channel="conda-forge")
The error wont appear the second time, because the python imports are run when initializing the CatBoost module. https://github.com/beacon-biosignals/CatBoost.jl/blob/9cab2d6ebce3cf205923a26140b4bda2443907b3/src/CatBoost.jl#L30-L33 |
Thanks @tylerjthomas9 this was a huge help! It now works. Maybe we should add some of these parts to the landing page on how to get this up and running and how to use native dataframes. I know there are many like myself and @MrBenzWorld who really want to use Julia but documentation is either outdated or missing altogether. Just my $0.02 |
What do you mean by native dataframes? Pandas or DataFrames.jl? I will look into adding more documentation, especially on getting started and troubleshooting PythonCall.jl issues. If you come up with other things, feel free to open another issue where we can track potential documentation deficiencies in one place. |
Thanks for the added documentation & sorry for not being concise - I meant DataFrames.jl - it would be great to see how this package works from start to finish including getting plots up and running (I have, after many hours, gotten everything to work except plots = true despite having all of the necessary libraries installed). |
Please , use some real dataset ( Ex : which are avaible Kaggle, House pricing .etc..)
we are getting problem in giving features and target tata.
Catboost is giving best results in python.
Please fix it in julia and add some examples with hyper parameter tuning.
Please help,
Thank you
The text was updated successfully, but these errors were encountered: