MCPcopy Create free account
hub / github.com/catboost/catboost / fit

Method fit

catboost/python-package/catboost/core.py:5435–5550  ·  view source on GitHub ↗

Fit the CatBoostClassifier model. Parameters ---------- X : catboost.Pool or list or numpy.ndarray or pandas.DataFrame or pandas.Series or polars.DataFrame If not catboost.Pool, 2 dimensional Feature matrix or string - file with dataset. y : lis

(self, X, y=None, cat_features=None, text_features=None, embedding_features=None, graph=None, sample_weight=None, baseline=None, use_best_model=None,
            eval_set=None, verbose=None, logging_level=None, plot=False, plot_file=None, column_description=None,
            verbose_eval=None, metric_period=None, silent=None, early_stopping_rounds=None,
            save_snapshot=None, snapshot_file=None, snapshot_interval=None, init_model=None, callbacks=None,
            log_cout=None, log_cerr=None)

Source from the content-addressed store, hash-verified

5433 super(CatBoostClassifier, self).__init__(params)
5434
5435 def fit(self, X, y=None, cat_features=None, text_features=None, embedding_features=None, graph=None, sample_weight=None, baseline=None, use_best_model=None,
5436 eval_set=None, verbose=None, logging_level=None, plot=False, plot_file=None, column_description=None,
5437 verbose_eval=None, metric_period=None, silent=None, early_stopping_rounds=None,
5438 save_snapshot=None, snapshot_file=None, snapshot_interval=None, init_model=None, callbacks=None,
5439 log_cout=None, log_cerr=None):
5440 """
5441 Fit the CatBoostClassifier model.
5442
5443 Parameters
5444 ----------
5445 X : catboost.Pool or list or numpy.ndarray or pandas.DataFrame or pandas.Series or polars.DataFrame
5446 If not catboost.Pool, 2 dimensional Feature matrix or string - file with dataset.
5447
5448 y : list or numpy.ndarray or pandas.DataFrame or pandas.Series or polars.DataFrame or polars.Series, optional (default=None)
5449 Labels of the training data.
5450 If not None, can be a single- or two- dimensional array with either:
5451 - numerical values - for binary classification problems
5452 - class labels (boolean, integer or string)
5453 Use only if X is not catboost.Pool and does not point to a file.
5454
5455 cat_features : list or numpy.ndarray, optional (default=None)
5456 If not None, giving the list of Categ columns indices.
5457 Use only if X is not catboost.Pool.
5458
5459 text_features : list or numpy.ndarray, optional (default=None)
5460 If not None, giving the list of Text columns indices.
5461 Use only if X is not catboost.Pool.
5462
5463 embedding_features : list or numpy.ndarray, optional (default=None)
5464 If not None, giving the list of Embedding columns indices.
5465 Use only if X is not catboost.Pool.
5466
5467 graph : list or numpy.ndarray or pandas.DataFrame or polars.DataFrame
5468 The graph edges list description.
5469 If list or numpy.ndarrays or pandas.DataFrame, giving 2 dimensional.
5470
5471 sample_weight : list or numpy.ndarray or pandas.DataFrame or pandas.Series or polars.Series, optional (default=None)
5472 Instance weights, 1 dimensional array like.
5473
5474 baseline : list or numpy.ndarray or polars.DataFrame or polars.Series, optional (default=None)
5475 If not None, giving 2 dimensional array like data.
5476 Use only if X is not catboost.Pool.
5477
5478 use_best_model : bool, optional (default=None)
5479 Flag to use best model
5480
5481 eval_set : catboost.Pool or list of catboost.Pool or tuple (X, y) or list [(X, y)], optional (default=None)
5482 Validation dataset or datasets for metrics calculation and possibly early stopping.
5483
5484 metric_period : int
5485 Frequency of evaluating metrics.
5486
5487 verbose : bool or int
5488 If verbose is bool, then if set to True, logging_level is set to Verbose,
5489 if set to False, logging_level is set to Silent.
5490 If verbose is int, it determines the frequency of writing metrics to output and
5491 logging_level is set to Verbose.
5492

Calls 3

_get_canonized_paramsMethod · 0.80
_fitMethod · 0.45