class CatBoost(params=None)
Purpose
Training and applying models.
Parameters params DescriptionThe list of parameters to start training with.
If omitted, default values are used.
Note
Some parameters duplicate the ones specified for the fit method. In these cases the values specified for the fit method take precedence.
Possible types: dict
Default value
None
Return the number of trees in the model.
This number can differ from the value specified in the --iterations
training parameter in the following cases:
--use-best-model
training parameter is set to True.
Return the calculated feature importances. The output data depends on the type of the model's loss function:
The random seed used for training.
learning_rate_The learning rate used for training.
feature_names_The names of features in the dataset.
evals_result_Return the values of metrics calculated during the training.
best_score_Return the best result for each metric calculated on each validation dataset.
best_iteration_Return the identifier of the iteration with the best result of the evaluation metric or loss function on the last validation set.
classes_Return the names of classes for classification models. An empty list is returned for all other models.
The order of classes in this list corresponds to the order of classes in resulting predictions.
Methods fitTrain a model.
predictApply the model to the given dataset.
calc_feature_statisticsCalculate and plot a set of statistics for the chosen feature.
calc_leaf_indexesReturns indexes of leafs to which objects from pool are mapped by model trees.
compareDraw train and evaluation metrics in Jupyter Notebook for two trained models.
copyCopy the CatBoost object.
eval_metricsCalculate the specified metrics for the specified dataset.
get_all_paramsReturn the values of all training parameters (including the ones that are not explicitly specified by users).
get_best_iterationReturn the identifier of the iteration with the best result of the evaluation metric or loss function on the last validation set.
get_best_scoreReturn the best result for each metric calculated on each validation dataset.
get_bordersReturn the list of borders for numerical features.
get_evals_resultReturn the values of metrics calculated during the training.
get_feature_importanceCalculate and return the feature importances.
get_metadataReturn a proxy object with metadata from the model's internal key-value string storage.
get_object_importanceCalculate the effect of objects from the train dataset on the optimized metric values for the objects from the input dataset:
Return the value of the given parameter if it is explicitly by the user before starting the training. If this parameter is used with the default value, this function returns None.
get_paramsReturn the values of training parameters that are explicitly specified by the user. If all parameters are used with their default values, this function returns an empty dict.
get_scale_and_biasReturn the scale and bias of the model.
These values affect the results of applying the model, since the model prediction results are calculated as follows:
∑ l e a f _ v a l u e s ⋅ s c a l e + b i a s \sum leaf\_values \cdot scale + bias ∑leaf_values⋅scale+bias
Return the formula values that were calculated for the objects from the validation dataset provided for training.
grid_searchA simple grid search over specified parameter values for a model.
load_modelLoad the model from a file.
plot_predictionsSequentially vary the value of the specified features to put them into all buckets and calculate predictions for the input objects accordingly.
plot_treeVisualize the CatBoost decision trees.
randomized_searchA simple randomized search on hyperparameters.
save_bordersSave the model borders to a file.
save_modelSave the model to a file.
select_featuresSelect the best features from the dataset using the Recursive Feature Elimination algorithm.
set_feature_namesSet names for all features in the model.
set_paramsSet the training parameters.
set_scale_and_biasSet the scale and bias.
shrinkShrink the model. Only trees with indices from the range [ntree_start, ntree_end)
are kept.
Apply the model to the given dataset and calculate the results taking into consideration only the trees in the range [0; i).
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4