API reference#

Algorithms#

CRFE

Feature ranking with constrained recursive feature elimination.

CRFECV

Optimization#

Solver#

CPSolver

CP-SAT model of the feature constraints.

Constraints#

Constraints

Collection of constraints used by CRFE and CRFECV.

AllOrNoneConstraint

Select either all of the features or none of them.

AtLeastKConstraint

Select at least min_features features from a group.

AtMostKConstraint

Select at most max_features features from a group.

FixedConstraint

Always select the feature.

GroupConstraint

Bound the number of selected features within a group.

KnapsackConstraint

Limit the weighted sum of the selected features.

MaxCorrelationConstraint

Limit the pairwise correlation among the selected features.

MinMaxConstraint

Bound the total number of selected features.

OnlyEnforceIfConstraint

If feature1 is selected, then feature2 must be selected too.

OnlyExcludeIfConstraint

If feature1 is selected, then feature2 must not be selected.