catboost / catboost/catboost

Allow to slice not just rows but columns too for Pools

Open
#2,838 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
9.1k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

According to catboost [documentation ](https://catboost.ai/docs/en/concepts/python-reference_pool_slice) you can slice dataset passing index values as argument to pool.slice().
```python
from catboost import Pool

data = [[1, 3],
[0, 4],
[1, 7],
[6, 4],
[5, 3]]

dataset = Pool(data)
print(dataset.num_row())
dataset_part = dataset.slice([0, 1, 2])
print(dataset_part.num_row())
```
However during feature selection it may be very handy to slice columns instead of creating new pool with necessary columns which would occupy CPU. Perhaps passing list of feature names or feature indexes to slice function?

```python
dataset_part = dataset.slice(rows=[0, 1, 2],columns=['feature_2','feature_3'])
```

Best regards!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.