Skip to content

allow_const_label=True does not seem to work with CatBoostClassifier #1933

@tristancinquin

Description

@tristancinquin

Hi,

I am trying to get a CatBoostClassifier to work in a case where I only have one label. I saw that CatBoostClassifiers have the allow_const_label parameter for this. However, I still run into the error : catboost.CatBoostError: catboost/private/libs/target/target_converter.cpp:374: Target contains only one unique value.

The error is reproducible with the following code :

import catboost
model = CatBoostClassifier(allow_const_label=True)
model.fit([[1,1,1],[1,0,1],[0,1,1]], [1,1,1])

catboost version: 1.0.3
Operating System: MacOS 11.6.1
CPU: Yes
GPU: No

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions