We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Problem: not saving model correctly catboost version: 0.21 python 3.7.6 Operating System: Win 10 CPU: i7 Commandline:
python test.py
result:
{} None {} None
test.zip (with saved model files)
test.py:
import pickle import pandas as pd from catboost import Pool, CatBoostRegressor from sklearn.datasets import load_boston from sklearn.model_selection import train_test_split boston = load_boston() X = boston.data y = boston.target X = pd.DataFrame(X, columns=boston.feature_names) X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=1/10, random_state=1) X_train, X_val, y_train, y_val = train_test_split(X_train, y_train, test_size=1/9) c = CatBoostRegressor(early_stopping_rounds=50, verbose=0) c.fit( Pool(X_train, y_train), eval_set=Pool(X_val, y_val), ) c.save_model('model.cbm') with open('model.pkl', 'wb') as f: pickle.dump(c, f, pickle.HIGHEST_PROTOCOL) c_load = CatBoostRegressor() c_load.load_model('model.cbm') with open('model.pkl', 'rb') as f: c_load_pkl = pickle.load(f) print(c_load.get_best_score(), c_load.get_best_iteration()) print(c_load_pkl.get_best_score(), c_load_pkl.get_best_iteration())
The text was updated successfully, but these errors were encountered:
@LSinev Hi, did they solve this or did you find a way?
Sorry, something went wrong.
Didn't find a way. The problem still exists.
catboost version: 0.24 python 3.7.9 Operating System: Win 10
catboost024_test.zip
1df1f72
No branches or pull requests
Problem: not saving model correctly
catboost version: 0.21
python 3.7.6
Operating System: Win 10
CPU: i7
Commandline:
result:
test.zip (with saved model files)
test.py:
The text was updated successfully, but these errors were encountered: