Predict with data. Parameters ---------- X : catboost.Pool or list of features or list of lists or numpy.ndarray or pandas.DataFrame or pandas.Series or polars.DataFrame or polars.Series or catboost.FeaturesData Data to apply model on.
(self, X, ntree_start=0, ntree_end=0, thread_count=-1, verbose=None)
| 6590 | return self |
| 6591 | |
| 6592 | def predict(self, X, ntree_start=0, ntree_end=0, thread_count=-1, verbose=None): |
| 6593 | """ |
| 6594 | Predict with data. |
| 6595 | Parameters |
| 6596 | ---------- |
| 6597 | X : catboost.Pool or list of features or list of lists or numpy.ndarray or pandas.DataFrame or pandas.Series |
| 6598 | or polars.DataFrame or polars.Series or catboost.FeaturesData |
| 6599 | Data to apply model on. |
| 6600 | If data is a simple list (not list of lists) or a one-dimensional numpy.ndarray it is interpreted |
| 6601 | as a list of features for a single object. |
| 6602 | ntree_start: int, optional (default=0) |
| 6603 | Model is applied on the interval [ntree_start, ntree_end) (zero-based indexing). |
| 6604 | ntree_end: int, optional (default=0) |
| 6605 | Model is applied on the interval [ntree_start, ntree_end) (zero-based indexing). |
| 6606 | If value equals to 0 this parameter is ignored and ntree_end equal to tree_count_. |
| 6607 | thread_count : int (default=-1) |
| 6608 | The number of threads to use when applying the model. |
| 6609 | Allows you to optimize the speed of execution. This parameter doesn't affect results. |
| 6610 | If -1, then the number of threads is set to the number of CPU cores. |
| 6611 | verbose : bool |
| 6612 | If True, writes the evaluation metric measured set to stderr. |
| 6613 | Returns |
| 6614 | ------- |
| 6615 | prediction : |
| 6616 | If data is for a single object, the return value is single float formula return value |
| 6617 | otherwise one-dimensional numpy.ndarray of formula return values for each object. |
| 6618 | """ |
| 6619 | return self._predict(X, 'RawFormulaVal', ntree_start, ntree_end, thread_count, verbose, 'predict') |
| 6620 | |
| 6621 | def staged_predict(self, X, ntree_start=0, ntree_end=0, eval_period=1, thread_count=-1, verbose=None): |
| 6622 | """ |