-2

I need to get the parameters to use the model in another program.

I tried cat_model.coef_, cat_model.intercept_ or what I think. is that possible to catch the params ?

I totally solved this problem, what i was tryna do is named 'saving model'.

 cat_model.save_model('cat_model.cbm')
sametsokel
  • 334
  • 3
  • 11

2 Answers2

1

Attributes .coef_ and .intercept_ only exist in sklearn applications of linear regression and logistic regression and will give you the slopes and the intercept (if fitted). You can use .feature_importances_ instead.

  • I solved my little problem, just wanted to use a model permanently. CatBoost already has an option for my wish. Teşekkür ederim yine de.. – sametsokel Jun 01 '20 at 21:13
0

For catboost, your model has something called feature importances, given that it's a gradient boosting tree model what you get back is how heavy certain features are in splitting the tree up.

cat_model.feature_importances_

will tell you that. Though you should do more research into how the model works and what it will give you back because interpreting these features can be somewhat deceptive.

DejaVuSansMono
  • 787
  • 5
  • 14
  • all what I want to do is fix my model, i didn't find any `random_state` parameters. I try to do that when i open my project and get some predict, I wanna take always the same predictions. How ? is that possible ? – sametsokel Jun 01 '20 at 17:15
  • That isn't what the original question was. But what do you think is wrong with your model? – DejaVuSansMono Jun 01 '20 at 17:23
  • actually questions are the same, i want to know the coefficients because i want to use the model somewhere else. Like a CART model's if structure, or coefficients of a stats model from sklearn – sametsokel Jun 01 '20 at 17:43