ℹ️ Skipped - page is already crawled
| Filter | Status | Condition | Details |
|---|---|---|---|
| HTTP status | PASS | download_http_code = 200 | HTTP 200 |
| Age cutoff | PASS | download_stamp > now() - 6 MONTH | 0 months ago |
| History drop | PASS | isNull(history_drop_reason) | No drop reason |
| Spam/ban | PASS | fh_dont_index != 1 AND ml_spam_score = 0 | ml_spam_score=0 |
| Canonical | PASS | meta_canonical IS NULL OR = '' OR = src_unparsed | Not set |
| Property | Value |
|---|---|
| URL | https://catboost.ai/docs/en/concepts/python-reference_catboostregressor_staged_predict |
| Last Crawled | 2026-04-08 13:54:42 (6 hours ago) |
| First Indexed | 2024-11-18 16:19:28 (1 year ago) |
| HTTP Status Code | 200 |
| Meta Title | staged_predict | CatBoost |
| Meta Description | Apply the model to the given dataset and calculate the results taking into consideration only the trees in the range [0; i). Note. |
| Meta Canonical | null |
| Boilerpipe Text | Apply the model to the given dataset and calculate the results taking into consideration only the trees in the range [0; i).
Note
The model prediction results will be correct only if the
data
parameter with feature values contains all the features used in the model. Typically, the order of these features must match the order of the corresponding columns that is provided during the training. But if feature names are provided both during the training and when applying the model, they can be matched by names instead of columns order. Feature names can be specified if the
data
parameter has one of the following types:
FeaturesData
catboost.Pool
pandas.DataFrame
(in this case, feature names are taken from column names)
polars.DataFrame
(in this case, feature names are taken from column names)
Method call format
staged_predict(data,
prediction_type=
None
,
ntree_start=
0
,
ntree_end=
0
,
eval_period=
1
,
thread_count=-
1
,
verbose=
False
)
Parameters
data
Description
Feature values data.
The format depends on the number of input objects:
Multiple — Matrix-like data of shape
(object_count, feature_count)
Single — An array
Possible types
For multiple objects:
catboost.Pool
list of lists
numpy.ndarray of shape
(object_count, feature_count)
pandas.DataFrame
pandas.SparseDataFrame
pandas.Series
polars.DataFrame
catboost.FeaturesData
scipy.sparse.spmatrix (all subclasses except dia_matrix)
For a single object:
list of feature values
one-dimensional numpy.ndarray with feature values
Default value
Required parameter
prediction_type
Description
The required prediction type.
Supported prediction types:
Probability
Class
RawFormulaVal
Exponent
LogProbability
Possible types
string
Default value
None (Exponent for Poisson and Tweedie, RawFormulaVal for all other loss functions)
ntree_start
Description
To reduce the number of trees to use when the model is applied or the metrics are calculated, set the range of the tree indices to
[ntree_start; ntree_end)
and the
eval_period
parameter toÂ
k
to calculate metrics on every
k
-th iteration.
This parameter defines the index of the first tree to be used when applying the model or calculating the metrics (the inclusive left border of the range). Indices are zero-based.
Possible types
int
Default value
0
ntree_end
Description
To reduce the number of trees to use when the model is applied or the metrics are calculated, set the range of the tree indices to
[ntree_start; ntree_end)
and the
eval_period
parameter toÂ
k
to calculate metrics on every
k
-th iteration.
This parameter defines the index of the first tree not to be used when applying the model or calculating the metrics (the exclusive right border of the range). Indices are zero-based.
Possible types
int
Default value
0 (the index of the last tree to use equals to the number of trees in the
model minus one)
eval_period
Description
To reduce the number of trees to use when the model is applied or the metrics are calculated, set the range of the tree indices to
[ntree_start; ntree_end)
and the
eval_period
parameter toÂ
k
to calculate metrics on every
k
-th iteration.
This parameter defines the step to iterate over the range
[
ntree_start
;
ntree_end
)
. For example, let's assume that the following parameter values are set:
ntree_start
is set 0
ntree_end
is set to N (the total tree count)
eval_period
is set to 2
In this case, the metrics are calculated for the following tree ranges:
[0, 2)
,
[0, 4)
, ... ,
[0, N)
Possible types
int
Default value
1 (the trees are applied sequentially: the first tree, then the first two
trees, etc.)
thread_count
Description
The number of threads to use.
Optimizes the speed of execution. This parameter doesn't affect results.
Possible types
int
Default value
-1 (the number of threads is equal to the number of processor cores)
verbose
Description
Output the measured evaluation metric to stderr.
Possible types
bool
Default value
None
Return value
Generator that produces predictions with a sequentially growing subset of trees from the model. The type of generated values depends on the number of input objects:
Single object — Single float formula return value
Multiple objects — One-dimensional numpy.ndarray of formula values for each object. |
| Markdown | [](https://catboost.ai/ "CatBoost")
- Installation
- [Overview](https://catboost.ai/docs/en/concepts/en/concepts/installation)
- Python package installation
- CatBoost for Apache Spark installation
- R package installation
- Command-line version binary
- Build from source
- Key Features
- Training parameters
- Python package
- [Quick start](https://catboost.ai/docs/en/concepts/en/concepts/python-quickstart)
- CatBoost
- CatBoostClassifier
- CatBoostRanker
- CatBoostRegressor
- [Overview](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor)
- [fit](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_fit)
- [predict](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_predict)
- [Attributes](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_attributes)
- [calc\_leaf\_indexes](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboost_calc_leaf_indexes)
- [calc\_feature\_statistics](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_calc_feature_statistics)
- [copy](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_copy)
- [compare](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_modelcompare)
- [eval\_metrics](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_eval-metrics)
- [get\_all\_params](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_get_all_params)
- [get\_best\_iteration](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_get_best_iteration)
- [get\_best\_score](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_get_best_score)
- [get\_borders](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_get_borders)
- [get\_evals\_result](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_get_evals_result)
- [get\_feature\_importance](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_get_feature_importance)
- [get\_metadata](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_metadata)
- [get\_object\_importance](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_get_object_importance)
- [get\_param](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_get_param)
- [get\_params](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_get_params)
- [get\_scale\_and\_bias](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_get_scale_and_bias)
- [get\_test\_eval](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_get_test_eval)
- [grid\_search](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_grid_search)
- [is\_fitted](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_is_fitted)
- [load\_model](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_load_model)
- [plot\_predictions](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_plot_predictions)
- [plot\_tree](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_plot_tree)
- [randomized\_search](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_randomized_search)
- [save\_borders](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_save_borders)
- [save\_model](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_save_model)
- [score](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_score)
- [select\_features](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_select_features)
- [set\_feature\_names](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_set_feature_names)
- [set\_params](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_set_params)
- [set\_scale\_and\_bias](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_set_scale_and_bias)
- [shrink](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_shrink)
- [staged\_predict](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_staged_predict)
- [cv](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_cv)
- datasets
- FeaturesData
- MetricVisualizer
- Pool
- [sample\_gaussian\_process](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_sample_gaussian_process)
- [sum\_models](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_sum_models)
- [to\_classifier](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_to_classifier)
- [to\_regressor](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_to_regressor)
- [train](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_train)
- Text processing
- utils
- [Usage examples](https://catboost.ai/docs/en/concepts/en/concepts/python-usages-examples)
- CatBoost for Apache Spark
- R package
- Command-line version
- Applying models
- Objectives and metrics
- Model analysis
- Data format description
- [Parameter tuning](https://catboost.ai/docs/en/concepts/en/concepts/parameter-tuning)
- [Speeding up the training](https://catboost.ai/docs/en/concepts/en/concepts/speed-up-training)
- Data visualization
- Algorithm details
- [FAQ](https://catboost.ai/docs/en/concepts/en/concepts/faq)
- Educational materials
- [Development and contributions](https://catboost.ai/docs/en/concepts/en/concepts/development-and-contributions)
- [Contacts](https://catboost.ai/docs/en/concepts/en/concepts/contacts)
staged\_predict
## In this article:
- [Method call format](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_staged_predict#call-format)
- [Parameters](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_staged_predict#parameters)
- [data](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_staged_predict#data)
- [prediction\_type](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_staged_predict#prediction_type)
- [ntree\_start](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_staged_predict#ntree_start)
- [ntree\_end](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_staged_predict#ntree_end)
- [eval\_period](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_staged_predict#eval_period)
- [thread\_count](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_staged_predict#thread_count)
- [verbose](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_staged_predict#verbose)
- [Return value](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_staged_predict#output-format)
1. Python package
2. [CatBoostRegressor](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor)
3. staged\_predict
# staged\_predict
- [Method call format](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_staged_predict#call-format)
- [Parameters](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_staged_predict#parameters)
- [data](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_staged_predict#data)
- [prediction\_type](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_staged_predict#prediction_type)
- [ntree\_start](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_staged_predict#ntree_start)
- [ntree\_end](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_staged_predict#ntree_end)
- [eval\_period](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_staged_predict#eval_period)
- [thread\_count](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_staged_predict#thread_count)
- [verbose](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_staged_predict#verbose)
- [Return value](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_staged_predict#output-format)
Apply the model to the given dataset and calculate the results taking into consideration only the trees in the range \[0; i).
Note
The model prediction results will be correct only if the `data` parameter with feature values contains all the features used in the model. Typically, the order of these features must match the order of the corresponding columns that is provided during the training. But if feature names are provided both during the training and when applying the model, they can be matched by names instead of columns order. Feature names can be specified if the `data` parameter has one of the following types:
- [FeaturesData](https://catboost.ai/docs/en/concepts/en/concepts/python-features-data__desc)
- [catboost.Pool](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_pool)
- [pandas.DataFrame](https://pandas.pydata.org/pandas-docs/stable/reference/frame.html) (in this case, feature names are taken from column names)
- [polars.DataFrame](https://docs.pola.rs/api/python/stable/reference/dataframe/index.html) (in this case, feature names are taken from column names)
## Method call format
```
staged_predict(data,
prediction_type=None,
ntree_start=0,
ntree_end=0,
eval_period=1,
thread_count=-1,
verbose=False)
```
## Parameters
### data
#### Description
Feature values data.
The format depends on the number of input objects:
- Multiple — Matrix-like data of shape `(object_count, feature_count)`
- Single — An array
**Possible types**
For multiple objects:
- catboost.Pool
- list of lists
- numpy.ndarray of shape `(object_count, feature_count)`
- pandas.DataFrame
- pandas.SparseDataFrame
- pandas.Series
- [polars.DataFrame](https://docs.pola.rs/api/python/stable/reference/dataframe/index.html)
- [catboost.FeaturesData](https://catboost.ai/docs/en/concepts/en/concepts/python-features-data__desc)
- scipy.sparse.spmatrix (all subclasses except dia\_matrix)
For a single object:
- list of feature values
- one-dimensional numpy.ndarray with feature values
**Default value**
Required parameter
### prediction\_type
#### Description
The required prediction type.
Supported prediction types:
- Probability
- Class
- RawFormulaVal
- Exponent
- LogProbability
**Possible types**
string
**Default value**
None (Exponent for Poisson and Tweedie, RawFormulaVal for all other loss functions)
### ntree\_start
#### Description
To reduce the number of trees to use when the model is applied or the metrics are calculated, set the range of the tree indices to`[ntree_start; ntree_end)` and the `eval_period` parameter to *k* to calculate metrics on every *k*\-th iteration.
This parameter defines the index of the first tree to be used when applying the model or calculating the metrics (the inclusive left border of the range). Indices are zero-based.
**Possible types**
int
**Default value**
0
### ntree\_end
#### Description
To reduce the number of trees to use when the model is applied or the metrics are calculated, set the range of the tree indices to`[ntree_start; ntree_end)` and the `eval_period` parameter to *k* to calculate metrics on every *k*\-th iteration.
This parameter defines the index of the first tree not to be used when applying the model or calculating the metrics (the exclusive right border of the range). Indices are zero-based.
**Possible types**
int
**Default value**
0 (the index of the last tree to use equals to the number of trees in the
model minus one)
### eval\_period
#### Description
To reduce the number of trees to use when the model is applied or the metrics are calculated, set the range of the tree indices to`[ntree_start; ntree_end)` and the `eval_period` parameter to *k* to calculate metrics on every *k*\-th iteration.
This parameter defines the step to iterate over the range `[`ntree\_start`;`ntree\_end`)`. For example, let's assume that the following parameter values are set:
- `ntree_start` is set 0
- `ntree_end` is set to N (the total tree count)
- `eval_period` is set to 2
In this case, the metrics are calculated for the following tree ranges: `[0, 2)`, `[0, 4)`, ... , `[0, N)`
**Possible types**
int
**Default value**
1 (the trees are applied sequentially: the first tree, then the first two
trees, etc.)
### thread\_count
#### Description
The number of threads to use.
Optimizes the speed of execution. This parameter doesn't affect results.
**Possible types**
int
**Default value**
\-1 (the number of threads is equal to the number of processor cores)
### verbose
#### Description
Output the measured evaluation metric to stderr.
**Possible types**
bool
**Default value**
None
## Return value
Generator that produces predictions with a sequentially growing subset of trees from the model. The type of generated values depends on the number of input objects:
- Single object — Single float formula return value
- Multiple objects — One-dimensional numpy.ndarray of formula values for each object.
### Was the article helpful?
Yes
No
Previous
[shrink](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_catboostregressor_shrink)
Next
[cv](https://catboost.ai/docs/en/concepts/en/concepts/python-reference_cv)
 |
| Readable Markdown | Apply the model to the given dataset and calculate the results taking into consideration only the trees in the range \[0; i).
Note
The model prediction results will be correct only if the `data` parameter with feature values contains all the features used in the model. Typically, the order of these features must match the order of the corresponding columns that is provided during the training. But if feature names are provided both during the training and when applying the model, they can be matched by names instead of columns order. Feature names can be specified if the `data` parameter has one of the following types:
- [FeaturesData](https://catboost.ai/docs/en/concepts/python-features-data__desc)
- [catboost.Pool](https://catboost.ai/docs/en/concepts/python-reference_pool)
- [pandas.DataFrame](https://pandas.pydata.org/pandas-docs/stable/reference/frame.html) (in this case, feature names are taken from column names)
- [polars.DataFrame](https://docs.pola.rs/api/python/stable/reference/dataframe/index.html) (in this case, feature names are taken from column names)
## Method call format
```
staged_predict(data,
prediction_type=None,
ntree_start=0,
ntree_end=0,
eval_period=1,
thread_count=-1,
verbose=False)
```
## Parameters
### data
#### Description
Feature values data.
The format depends on the number of input objects:
- Multiple — Matrix-like data of shape `(object_count, feature_count)`
- Single — An array
**Possible types**
For multiple objects:
- catboost.Pool
- list of lists
- numpy.ndarray of shape `(object_count, feature_count)`
- pandas.DataFrame
- pandas.SparseDataFrame
- pandas.Series
- [polars.DataFrame](https://docs.pola.rs/api/python/stable/reference/dataframe/index.html)
- [catboost.FeaturesData](https://catboost.ai/docs/en/concepts/python-features-data__desc)
- scipy.sparse.spmatrix (all subclasses except dia\_matrix)
For a single object:
- list of feature values
- one-dimensional numpy.ndarray with feature values
**Default value**
Required parameter
### prediction\_type
#### Description
The required prediction type.
Supported prediction types:
- Probability
- Class
- RawFormulaVal
- Exponent
- LogProbability
**Possible types**
string
**Default value**
None (Exponent for Poisson and Tweedie, RawFormulaVal for all other loss functions)
### ntree\_start
#### Description
To reduce the number of trees to use when the model is applied or the metrics are calculated, set the range of the tree indices to`[ntree_start; ntree_end)` and the `eval_period` parameter to *k* to calculate metrics on every *k*\-th iteration.
This parameter defines the index of the first tree to be used when applying the model or calculating the metrics (the inclusive left border of the range). Indices are zero-based.
**Possible types**
int
**Default value**
0
### ntree\_end
#### Description
To reduce the number of trees to use when the model is applied or the metrics are calculated, set the range of the tree indices to`[ntree_start; ntree_end)` and the `eval_period` parameter to *k* to calculate metrics on every *k*\-th iteration.
This parameter defines the index of the first tree not to be used when applying the model or calculating the metrics (the exclusive right border of the range). Indices are zero-based.
**Possible types**
int
**Default value**
0 (the index of the last tree to use equals to the number of trees in the
model minus one)
### eval\_period
#### Description
To reduce the number of trees to use when the model is applied or the metrics are calculated, set the range of the tree indices to`[ntree_start; ntree_end)` and the `eval_period` parameter to *k* to calculate metrics on every *k*\-th iteration.
This parameter defines the step to iterate over the range `[`ntree\_start`;`ntree\_end`)`. For example, let's assume that the following parameter values are set:
- `ntree_start` is set 0
- `ntree_end` is set to N (the total tree count)
- `eval_period` is set to 2
In this case, the metrics are calculated for the following tree ranges: `[0, 2)`, `[0, 4)`, ... , `[0, N)`
**Possible types**
int
**Default value**
1 (the trees are applied sequentially: the first tree, then the first two
trees, etc.)
### thread\_count
#### Description
The number of threads to use.
Optimizes the speed of execution. This parameter doesn't affect results.
**Possible types**
int
**Default value**
\-1 (the number of threads is equal to the number of processor cores)
### verbose
#### Description
Output the measured evaluation metric to stderr.
**Possible types**
bool
**Default value**
None
## Return value
Generator that produces predictions with a sequentially growing subset of trees from the model. The type of generated values depends on the number of input objects:
- Single object — Single float formula return value
- Multiple objects — One-dimensional numpy.ndarray of formula values for each object. |
| Shard | 169 (laksa) |
| Root Hash | 17435841955170310369 |
| Unparsed URL | ai,catboost!/docs/en/concepts/python-reference_catboostregressor_staged_predict s443 |