---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.3
alternate:
  - https://catboost.ai/docs/en/concepts/python-reference_pool.md
---
> **Documentation Index:** Fetch the complete configuration index at https://catboost.ai/docs/en/llms.txt

# Pool

```python
class Pool(data,
           label=None,
           cat_features=None,
           text_features=None,
           embedding_features=None,
           column_description=None,
           pairs=None,
           graph=None,
           delimiter='\t',
           has_header=False,
           weight=None,
           group_id=None,
           group_weight=None,
           subgroup_id=None,
           pairs_weight=None,
           baseline=None,
           timestamp=None,
           feature_names=None,
           thread_count=-1,
           log_cout=sys.stdout,
           log_cerr=sys.stderr)
```

## Purpose {#purpose}

Dataset processing.

The fastest way to pass the features data to the Pool constructor (and other [CatBoost](https://catboost.ai/docs/en/concepts/python-reference_catboost.md), [CatBoostClassifier](https://catboost.ai/docs/en/concepts/python-reference_catboostclassifier.md), [CatBoostRegressor](https://catboost.ai/docs/en/concepts/python-reference_catboostregressor.md) and [CatBoostRanker](https://catboost.ai/docs/en/concepts/python-reference_catboostranker.md) methods that accept it) if most (or all) of your features are numerical is to pass it using FeaturesData class. Another way to get similar performance with datasets that contain numerical features only is to pass features data as numpy.ndarray with numpy.float32 dtype.

## Parameters {#parameters}

### data

#### Description

The description is different for each group of possible types.

**Possible types**

{% cut "list, numpy.ndarray, pandas.DataFrame, pandas.Series, polars.DataFrame" %}

Dataset in the form of a two-dimensional feature matrix.

{% endcut %}


{% cut "pandas.SparseDataFrame, scipy.sparse.spmatrix (all subclasses except dia_matrix)" %}


<!-- source: en/_includes/work_src/reusage-formats/libsvm__desc.md -->
The input training dataset in the form of a two-dimensional sparse feature matrix.
<!-- endsource: en/_includes/work_src/reusage-formats/libsvm__desc.md -->

{% endcut %}


{% cut "catboost.FeaturesData" %}

Dataset in the form of catboost.FeaturesData. The fastest way to create a Pool from Python objects.

{% endcut %}

{% cut "string" %}

The path to the input file that contains the dataset.

<!-- source: en/_includes/work_src/reusage-formats/files-internal__desc__full.md -->
Format:
```
[scheme://]<path>
```

- `scheme` (optional) defines the type of the input dataset. Possible values:

    - `quantized://` — catboost.Pool [quantized](https://catboost.ai/docs/en/concepts/python-reference_pool_quantized.md) pool.
    - `libsvm://` — dataset in the [extended libsvm format](https://catboost.ai/docs/en/concepts/input-data_libsvm.md).

    If omitted, a dataset in the [Native CatBoost Delimiter-separated values format](https://catboost.ai/docs/en/concepts/input-data_values-file.md) is expected.

- `path` defines the path to the dataset file.
<!-- endsource: en/_includes/work_src/reusage-formats/files-internal__desc__full.md -->

{% endcut %}


**Default value**

Required parameter


### label

#### Description

The target variables (in other words, the objects' label values).

<!-- source: en/_includes/work_src/reusage/label--detailed-desc-generic.md -->
Must be in the form of a one- or two- dimensional array. The type of data in the array depends on the machine learning task being solved:
- Regression and ranking — One-dimensional array of numeric values.
- Multiregression - Two-dimensional array of numeric values. The first index is for a dimension, the second index is for an object.
- Binary classification
    One-dimensional array containing one of:

    * Booleans, integers or strings that represent the labels of the classes (only two unique values).
    * Numeric values.
        The interpretation of numeric values depends on the selected loss function:

        - Logloss — The value is considered a positive class if it is strictly greater than the value of the `target_border` training parameter. Otherwise, it is considered a negative class.
        - CrossEntropy — The value is interpreted as the probability that the dataset object belongs to the positive class. Possible values are in the range `[0; 1]`.

- Multiclassification — One-dimensional array of integers or strings that represent the labels of the classes.
- Multi label classification
    Two-dimensional array. The first index is for a label/class, the second index is for an object.

    Possible values depend on the selected loss function:

    * MultiLogloss — Only {0, 1} or {False, True} values are allowed that specify whether an object belongs to the class corresponding to the first index.
    * MultiCrossEntropy — Numerical values in the range `[0; 1]` that are interpreted as the probability that the dataset object belongs to the class corresponding to the first index.
<!-- endsource: en/_includes/work_src/reusage/label--detailed-desc-generic.md -->

{% note info %}

If `data` parameter points to a file, label data is loaded from it as well. This parameter must be `None` in this case.

{% endnote %}

**Possible types**

- list
- numpy.ndarray
- pandas.Series
- pandas.DataFrame
- [polars.Series](https://docs.pola.rs/api/python/stable/reference/series/index.html)
- [polars.DataFrame](https://docs.pola.rs/api/python/stable/reference/dataframe/index.html)

**Default value**

None

### cat_features

#### Description

A one-dimensional array of categorical columns indices (specified as integers) or names (specified as strings).

Use only if the `data` parameter is a two-dimensional feature matrix (has one of the following types: list, numpy.ndarray, pandas.DataFrame, pandas.Series), polars.DataFrame.

If any elements in this array are specified as names instead of indices, names for all columns must be provided. To do this, either use the `feature_names` parameter of this constructor to explicitly specify them or pass a pandas.DataFrame with column names specified in the `data` parameter.

**Possible types**

- list
- numpy.ndarray

**Default value**

None (it is assumed that all columns are the values of numerical features)

### text_features

#### Description

A one-dimensional array of text columns indices (specified as integers) or names (specified as strings).

<!-- source: en/_includes/work_src/reusage/python__cat_features__description__non-catfeatures-text.md -->
Use only if the `data` parameter is a two-dimensional feature matrix (has one of the following types: list, numpy.ndarray, pandas.DataFrame, pandas.Series), polars.DataFrame.

If any elements in this array are specified as names instead of indices, names for all columns must be provided. To do this, either use the `feature_names` parameter of this constructor to explicitly specify them or pass a pandas.DataFrame, polars.DataFrame with column names specified in the `data` parameter.
<!-- endsource: en/_includes/work_src/reusage/python__cat_features__description__non-catfeatures-text.md -->

**Possible types**

- list
- numpy.ndarray

**Default value**

<!-- source: en/_includes/concepts/default-value-none.md -->
**Default value**

None (all features are either considered numerical or of other types if specified precisely)
<!-- endsource: en/_includes/concepts/default-value-none.md -->

### embedding_features

#### Description

A one-dimensional array of embedding columns indices (specified as integers) or names (specified as strings).

<!-- source: en/_includes/work_src/reusage/python__cat_features__description__non-catfeatures-text.md -->
Use only if the `data` parameter is a two-dimensional feature matrix (has one of the following types: list, numpy.ndarray, pandas.DataFrame, pandas.Series), polars.DataFrame.

If any elements in this array are specified as names instead of indices, names for all columns must be provided. To do this, either use the `feature_names` parameter of this constructor to explicitly specify them or pass a pandas.DataFrame, polars.DataFrame with column names specified in the `data` parameter.
<!-- endsource: en/_includes/work_src/reusage/python__cat_features__description__non-catfeatures-text.md -->

**Possible types**

- list
- numpy.ndarray

**Default value**

<!-- source: en/_includes/concepts/default-value-none.md -->
**Default value**

None (all features are either considered numerical or of other types if specified precisely)
<!-- endsource: en/_includes/concepts/default-value-none.md -->

### column_description

#### Description

The path to the input file  that contains the [columns description](https://catboost.ai/docs/en/concepts/input-data_column-descfile.md).


**Possible types**

string

**Default value**

None

### pairs

#### Description

The description is different for each group of possible types.

**Possible types**

{% cut "list, numpy.ndarray, pandas.DataFrame, polars.DataFrame" %}

The pairs description in the form of a two-dimensional matrix of shape `N` by 2:

- `N` is the number of pairs.
- The first element of the pair is the zero-based index of the winner object from the input dataset for pairwise comparison.
- The second element of the pair is the zero-based index of the loser object from the input dataset for pairwise comparison.

<!-- source: en/_includes/work_src/reusage/learn_pairs__where_is_used.md -->
This information is used for calculation and optimization of [Pairwise metrics](https://catboost.ai/docs/en/concepts/loss-functions-ranking.md).
<!-- endsource: en/_includes/work_src/reusage/learn_pairs__where_is_used.md -->

{% endcut %}


{% cut "string" %}

The path to the input file that contains the [pairs description](https://catboost.ai/docs/en/concepts/input-data_pairs-description.md).

<!-- source: en/_includes/work_src/reusage/learn_pairs__where_is_used.md -->
This information is used for calculation and optimization of [Pairwise metrics](https://catboost.ai/docs/en/concepts/loss-functions-ranking.md).
<!-- endsource: en/_includes/work_src/reusage/learn_pairs__where_is_used.md -->


{% endcut %}

### graph

#### Description

The description is different for each group of possible types.

**Possible types**


{% cut "list, numpy.ndarray, pandas.DataFrame, polars.DataFrame" %}

The graph description in the form of a two-dimensional matrix of shape `N` by 2:


- `N` is the number of edges.
- The first element of the edge is the zero-based index of start vertex (object) from the input dataset.
- The second element of the edge is the zero-based index of end vertex (object) from the input dataset.

{% endcut %}


{% cut "string" %}

The path to the input file that contains the [graph information](https://catboost.ai/docs/en/concepts/input-data_graph-description.md).


{% endcut %}


**Default value**

None

### delimiter

#### Description

The delimiter character used to separate the data in the dataset input file.

Only single char delimiters are supported. If the specified value contains more than one character, only the first one is used.

<!-- source: en/_includes/work_src/reusage-formats/note-restriction-delimiter-separated-format.md -->
{% note info %}

Used only if the dataset is given in the [Delimiter-separated values format](https://catboost.ai/docs/en/concepts/input-data_values-file.md).

{% endnote %}
<!-- endsource: en/_includes/work_src/reusage-formats/note-restriction-delimiter-separated-format.md -->

**Possible types**

<!-- source: en/_includes/work_src/reusage-python/cpu-and-gpu.md -->
CPU and GPU
<!-- endsource: en/_includes/work_src/reusage-python/cpu-and-gpu.md -->

**Default value**

The input data is assumed to be tab-separated


### has_header

#### Description

Read the column names from the first line of the dataset file if this parameter is set.

<!-- source: en/_includes/work_src/reusage-formats/note-restriction-delimiter-separated-format.md -->
{% note info %}

Used only if the dataset is given in the [Delimiter-separated values format](https://catboost.ai/docs/en/concepts/input-data_values-file.md).

{% endnote %}
<!-- endsource: en/_includes/work_src/reusage-formats/note-restriction-delimiter-separated-format.md -->

**Possible types**

bool

**Default value**

False

### weight

#### Description

The weight of each object in the input data in the form of a one-dimensional array-like data.

By default, it is set to 1 for all objects.

<!-- source: en/_includes/work_src/reusage/python__group-and-group-weight__restriction.md -->
{% note alert %}

Only one of the following parameters can be used at a time:

- `weight`
- `group_weight`

{% endnote %}
<!-- endsource: en/_includes/work_src/reusage/python__group-and-group-weight__restriction.md -->

**Possible types**

- list
- numpy.ndarray
- [polars.Series](https://docs.pola.rs/api/python/stable/reference/series/index.html)

**Default value**

None

### group_weight

#### Description

The weights of all objects within the defined groups from the input data in the form of one-dimensional array-like data.

Used for calculating the final values of trees. By default, it is set to 1 for all objects in all groups.

<!-- source: en/_includes/work_src/reusage/python__group-and-group-weight__restriction.md -->
{% note alert %}

Only one of the following parameters can be used at a time:

- `weight`
- `group_weight`

{% endnote %}
<!-- endsource: en/_includes/work_src/reusage/python__group-and-group-weight__restriction.md -->

**Possible types**

- list
- numpy.ndarray
- [polars.Series](https://docs.pola.rs/api/python/stable/reference/series/index.html)

**Default value**

None

### group_id

#### Description

<!-- source: en/_includes/work_src/reusage/python__group-id__basic-short-desc.md -->
Group identifiers for all input objects. Supported identifier types are:
- int
- string types (string or unicode for Python 2 and bytes or string for Python 3).
<!-- endsource: en/_includes/work_src/reusage/python__group-id__basic-short-desc.md -->


{% note warning %}

All objects in the dataset must be grouped by group identifiers if they are present. I.e., the objects with the same group identifier should follow each other in the dataset.

{% cut "Example" %}

For example, let's assume that the dataset consists of documents $d_{1}, d_{2}, d_{3}, d_{4}, d_{5}$. The corresponding groups are $g_{1}, g_{2}, g_{3}, g_{2}, g_{2}$, respectively. The feature vectors for the given documents are $f_{1}, f_{2}, f_{3}, f_{4}, f_{5}$ respectively. Then the dataset can take the following form:

$\begin{pmatrix} d_{2}&g_{2}&f_{2}\\ d_{4}&g_{2}&f_{4}\\ d_{5}&g_{2}&f_{5}\\ d_{3}&g_{3}&f_{3}\\ d_{1}&g_{1}&f_{1} \end{pmatrix}$

The grouped blocks of lines can be input in any order. For example, the following order is equivalent to the previous one:

$\begin{pmatrix} d_{1}&g_{1}&f_{1}\\ d_{3}&g_{3}&f_{3}\\ d_{2}&g_{2}&f_{2}\\ d_{4}&g_{2}&f_{4}\\ d_{5}&g_{2}&f_{5} \end{pmatrix}$

{% endcut %}

{% endnote %}

**Possible types**

- list
- numpy.ndarray
- [polars.Series](https://docs.pola.rs/api/python/stable/reference/series/index.html)

**Default value**

None

### subgroup_id

#### Description

Subgroup identifiers for all input objects. Supported identifier types are:
- int
- string types (string or unicode for Python 2 and bytes or string for Python 3).

**Possible types**

- list
- numpy.ndarray
- [polars.Series](https://docs.pola.rs/api/python/stable/reference/series/index.html)

**Default value**

None

### pairs_weight

#### Description

The weight of each input pair of objects in the form of one-dimensional array-like pairs. The number of given values must match the number of specified pairs.

<!-- source: en/_includes/work_src/reusage/learn_pairs__where_is_used.md -->
This information is used for calculation and optimization of [Pairwise metrics](https://catboost.ai/docs/en/concepts/loss-functions-ranking.md).
<!-- endsource: en/_includes/work_src/reusage/learn_pairs__where_is_used.md -->


By default, it is set to 1 for all pairs.

**Possible types**

- list
- numpy.ndarray
- [polars.Series](https://docs.pola.rs/api/python/stable/reference/series/index.html)

**Default value**

None

### baseline

#### Description

Array of formula values for all input objects. The training starts from these values for all input objects instead of starting from zero.

**Possible types**

- list
- numpy.ndarray
- [polars.Series](https://docs.pola.rs/api/python/stable/reference/series/index.html)
- [polars.DataFrame](https://docs.pola.rs/api/python/stable/reference/dataframe/index.html)

**Default value**

None

### timestamp

#### Description

Timestamps for all input objects.
Should contain non-negative integer values.
Useful for sorting a learning dataset by this field during training.

**Possible types**

- list
- numpy.ndarray
- [polars.Series](https://docs.pola.rs/api/python/stable/reference/series/index.html)

**Default value**

None

### feature_names

#### Description

A list of names for each feature in the dataset.

**Possible types**

list

**Default value**

None

### thread_count

#### Description

The number of threads to use when reading data from file.

Use only when the dataset is read from an input file.


**Possible types**

int

**Default value**

-1 (the number of threads is equal to the number of processor cores)

<!-- source: en/_includes/work_src/reusage-python/python__log-params.md -->
###  log_cout

Output stream or callback for logging.

**Possible types**

- callable Python object
- python object providing the `write()` method

**Default value**

sys.stdout

###  log_cerr

Error stream or callback for logging.

**Possible types**

- callable Python object
- python object providing the `write()` method

**Default value**

sys.stderr
<!-- endsource: en/_includes/work_src/reusage-python/python__log-params.md -->


## Attributes {#attributes}

**Attribute:** [Attributes](https://catboost.ai/docs/en/concepts/python-reference_pool_attributes.md)

**Description:**  Return the shape of the dataset.


**Attribute:** [Attributes](https://catboost.ai/docs/en/concepts/python-reference_pool_attributes.md)

**Description:**

<!-- source: en/_includes/work_src/reusage-attributes/is_empty__short-desc.md -->
Indicates that an empty array was input.
<!-- endsource: en/_includes/work_src/reusage-attributes/is_empty__short-desc.md -->



## Methods {#methods}

**Method:** [get_baseline](https://catboost.ai/docs/en/concepts/python-reference_pool_get_baseline.md)

#### Description

<!-- source: en/_includes/work_src/reusage-python/get_baseline-desc.md -->
Return an array of baselines from the dataset.
<!-- endsource: en/_includes/work_src/reusage-python/get_baseline-desc.md -->

**Method:** [get_cat_feature_indices](https://catboost.ai/docs/en/concepts/python-reference_pool_get_cat_feature_indices.md)

#### Description

<!-- source: en/_includes/work_src/reusage-python/get_cat_feature_indices-desc.md -->
Return the indices of categorical features found in the input data.
<!-- endsource: en/_includes/work_src/reusage-python/get_cat_feature_indices-desc.md -->

**Method:** [get_embedding_feature_indices](https://catboost.ai/docs/en/concepts/python-reference_pool_get_embedding_feature_indices.md)

#### Description

<!-- source: en/_includes/work_src/reusage-python/get_embedding_feature_indices-desc.md -->
Return the indices of embedding features found in the input data.
<!-- endsource: en/_includes/work_src/reusage-python/get_embedding_feature_indices-desc.md -->

**Method:** [get_features](https://catboost.ai/docs/en/concepts/python-reference_pool_get_features.md)

#### Description

<!-- source: en/_includes/work_src/reusage-python/get_features-desc.md -->
Return an array of the dataset features
<!-- endsource: en/_includes/work_src/reusage-python/get_features-desc.md -->

**Method:** [get_group_id](https://catboost.ai/docs/en/concepts/python-reference_pool_get_group_id.md)

#### Description

<!-- source: en/_includes/work_src/reusage-python/get_group_id__desc.md -->
Return an array of group identifiers for all objects.
<!-- endsource: en/_includes/work_src/reusage-python/get_group_id__desc.md -->

**Method:** [get_label](https://catboost.ai/docs/en/concepts/python-reference_pool_get_label.md)

#### Description

<!-- source: en/_includes/work_src/reusage-python/get_label-desc.md -->
Return the value of the label assigned to the input data.
<!-- endsource: en/_includes/work_src/reusage-python/get_label-desc.md -->

**Method:** [get_text_feature_indices](https://catboost.ai/docs/en/concepts/python-reference_pool_get_text_feature_indices.md)

#### Description

<!-- source: en/_includes/work_src/reusage-python/get_text_features_indices__desc.md -->
Return the indices of text features found in the input data.
<!-- endsource: en/_includes/work_src/reusage-python/get_text_features_indices__desc.md -->

**Method:** [get_weight](https://catboost.ai/docs/en/concepts/python-reference_pool_get_weight.md)

#### Description

<!-- source: en/_includes/work_src/reusage-python/get_weight-desc.md -->
Return the list of weights for each object of the dataset.
<!-- endsource: en/_includes/work_src/reusage-python/get_weight-desc.md -->

**Method:** [is_quantized](https://catboost.ai/docs/en/concepts/python-reference_pool_is_quantized.md)

#### Description

<!-- source: en/_includes/work_src/reusage-python/python__pool__is_quantized__desc__div.md -->
Check whether the pool is quantized.
<!-- endsource: en/_includes/work_src/reusage-python/python__pool__is_quantized__desc__div.md -->

**Method:** [num_col](https://catboost.ai/docs/en/concepts/python-reference_pool_num_col.md)

#### Description

<!-- source: en/_includes/work_src/reusage-python/num_col-desc.md -->
Return the number of columns that contain feature data.
<!-- endsource: en/_includes/work_src/reusage-python/num_col-desc.md -->

**Method:** [num_row](https://catboost.ai/docs/en/concepts/python-reference_pool_num_row.md)

#### Description

<!-- source: en/_includes/work_src/reusage-python/num_row-desc.md -->
Return the number of objects contained in the dataset.
<!-- endsource: en/_includes/work_src/reusage-python/num_row-desc.md -->

**Method:** [quantize](https://catboost.ai/docs/en/concepts/python-reference_pool_quantized.md)

#### Description

<!-- source: en/_includes/work_src/reusage-python/python_quantized.md -->
Quantize the given pool.
<!-- endsource: en/_includes/work_src/reusage-python/python_quantized.md -->

**Method:** [save](https://catboost.ai/docs/en/concepts/python-reference_pool_save.md)

#### Description

<!-- source: en/_includes/work_src/reusage-python/python__pool__save__desc__div.md -->
Save the quantized pool to a file.
<!-- endsource: en/_includes/work_src/reusage-python/python__pool__save__desc__div.md -->


**Method:** [save_quantization_borders](https://catboost.ai/docs/en/concepts/python-reference_save_quantization_borders.md)

#### Description

<!-- source: en/_includes/work_src/reusage-python/pool__save_quantization_borders_div.md -->
Save borders used in the numeric features' quantization to a file.

Refer to the [Custom quantization borders and missing value modes](https://catboost.ai/docs/en/concepts/input-data_custom-borders.md) section for details on the output file's format.
<!-- endsource: en/_includes/work_src/reusage-python/pool__save_quantization_borders_div.md -->

**Method:** [set_baseline](https://catboost.ai/docs/en/concepts/python-reference_pool_set_baseline.md)

#### Description

<!-- source: en/_includes/work_src/reusage-python/set_baseline__desc.md -->
Set initial formula values for all input objects. The training starts from these values for all input objects instead of starting from zero.
<!-- endsource: en/_includes/work_src/reusage-python/set_baseline__desc.md -->

**Method:** [set_feature_names](https://catboost.ai/docs/en/concepts/python-reference_pool_set_feature_names.md)

#### Description

<!-- source: en/_includes/work_src/reusage-python/set_feature_names__desc.md -->
Set names for all features in the dataset.
<!-- endsource: en/_includes/work_src/reusage-python/set_feature_names__desc.md -->

**Method:** [set_group_id](https://catboost.ai/docs/en/concepts/python-reference_pool_set_group_id.md)

#### Description

<!-- source: en/_includes/work_src/reusage-python/set_group_id__desc.md -->
Set identifiers for all input objects.
<!-- endsource: en/_includes/work_src/reusage-python/set_group_id__desc.md -->


**Method:** [set_group_weight](https://catboost.ai/docs/en/concepts/python-reference_pool_set_group_weight.md)

#### Description

<!-- source: en/_includes/work_src/reusage-python/set_group_weight__desc.md -->
Set weights for all objects within the defined group.
<!-- endsource: en/_includes/work_src/reusage-python/set_group_weight__desc.md -->

**Method:** [set_pairs](https://catboost.ai/docs/en/concepts/python-reference_pool_set_pairs.md)

#### Description

<!-- source: en/_includes/work_src/reusage-python/set_pairs__desc.md -->
Set the list of pairs for [Pairwise metrics](https://catboost.ai/docs/en/concepts/loss-functions-ranking.md).
<!-- endsource: en/_includes/work_src/reusage-python/set_pairs__desc.md -->


**Method:** [set_pairs_weight](https://catboost.ai/docs/en/concepts/python-reference_pool_set_pairs_weight.md)

#### Description

<!-- source: en/_includes/work_src/reusage-python/set_pairs_weight__desc.md -->
Set weights for each pair of objects.
<!-- endsource: en/_includes/work_src/reusage-python/set_pairs_weight__desc.md -->

**Method:** [set_subgroup_id](https://catboost.ai/docs/en/concepts/python-reference_pool_set_subgroup_id.md)

#### Description

<!-- source: en/_includes/work_src/reusage-python/set_subgroup_identifiers__desc.md -->
Set subgroup identifiers for all input objects.
<!-- endsource: en/_includes/work_src/reusage-python/set_subgroup_identifiers__desc.md -->


**Method:** [set_weight](https://catboost.ai/docs/en/concepts/python-reference_pool_set_weight.md)

#### Description

<!-- source: en/_includes/work_src/reusage-python/set_weight__desc.md -->
Set weights for all input objects.
<!-- endsource: en/_includes/work_src/reusage-python/set_weight__desc.md -->

**Method:** [slice](https://catboost.ai/docs/en/concepts/python-reference_pool_slice.md)

#### Description

<!-- source: en/_includes/work_src/reusage-python/python__pool__slice__desc.md -->
Form a slice of the input dataset from the given list of object indices.
<!-- endsource: en/_includes/work_src/reusage-python/python__pool__slice__desc.md -->

## Usage examples {#usage-examples}

#### Load the dataset using [Pool](https://catboost.ai/docs/en/concepts/python-reference_pool.md), train it with [CatBoostClassifier](https://catboost.ai/docs/en/concepts/python-reference_catboostclassifier.md) and make a prediction

```python
from catboost import CatBoostClassifier, Pool

train_data = Pool(data=[[1, 4, 5, 6],
                        [4, 5, 6, 7],
                        [30, 40, 50, 60]],
                  label=[1, 1, -1],
                  weight=[0.1, 0.2, 0.3])

model = CatBoostClassifier(iterations=10)

model.fit(train_data)
preds_class = model.predict(train_data)

```
