Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quantize: Categorical features are not supported in block quantization #2665

Open
NikitaZhidkov opened this issue May 16, 2024 · 0 comments
Open

Comments

@NikitaZhidkov
Copy link

Hello, could you please add support for categorical features in the utils.quantize method? It's crucial for handling large datasets that include categorical data. Here is the code to reproduce the issue:
`import pandas as pd
from catboost.utils import quantize

data = {
'precipitation': [0, 1, 0, 1],
'temperature': [20.5, 22.3, 18.0, 21.6],
'humidity': [85, 60, 78, 75],
'wind_direction': ['north', 'south', 'east', 'west']
}

df = pd.DataFrame(data)

filename = "weather_data.tsv"
df.to_csv(filename, sep='\t', index=False, header=False)

column_descriptions = {
'Index': ['0', '1', '2', '3'],
'Type': ['Label', 'Num', 'Num', 'Categ'],
'Feature': ['precipitation', 'temperature', 'humidity', 'wind_direction']
}

desc_df = pd.DataFrame(column_descriptions)

desc_filename = "columns_description.tsv"
desc_df.to_csv(desc_filename, sep='\t', index=False, header=False)

pool_quantize = quantize(
data_path=filename,
column_description=desc_filename,
delimiter='\t'
)
`
Returned error: CatBoostError: /Users/zomb-ml-platform-msk/go-agent-21.2.0/pipelines/BuildMaster/catboost.git/catboost/libs/data/load_and_quantize_data.cpp:52: Categorical features are not supported in block quantization

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant