Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
- Example: 10.2.1.4 is the 5th version that supports khiops 10.2.1.
- Internals: Changes in *Internals* sections are unlikely to be of interest for data scientists.

## Unreleased

### Added
- (`sklearn`) `keep_selected_variables_only` parameter to the predictors (KhiopsClassifier and KhiopsRegressor)

## 11.0.0.3 - 2026-03-06

### Added
Expand Down
12 changes: 12 additions & 0 deletions khiops/sklearn/estimators.py
Original file line number Diff line number Diff line change
Expand Up @@ -1196,6 +1196,7 @@ def __init__(
all_possible_pairs=True,
construction_rules=None,
n_feature_parts=0,
keep_selected_variables_only=True,
verbose=False,
output_dir=None,
auto_sort=True,
Expand All @@ -1213,6 +1214,7 @@ def __init__(
self.all_possible_pairs = all_possible_pairs
self.construction_rules = construction_rules
self.n_feature_parts = n_feature_parts
self.keep_selected_variables_only = keep_selected_variables_only
self._original_target_dtype = None
self._predicted_target_meta_data_tag = None
self._khiops_baseline_model_prefix = None
Expand Down Expand Up @@ -1523,6 +1525,7 @@ def __init__(
all_possible_pairs=True,
construction_rules=None,
n_feature_parts=0,
keep_selected_variables_only=True,
verbose=False,
output_dir=None,
auto_sort=True,
Expand All @@ -1536,6 +1539,7 @@ def __init__(
all_possible_pairs=all_possible_pairs,
construction_rules=construction_rules,
n_feature_parts=n_feature_parts,
keep_selected_variables_only=keep_selected_variables_only,
verbose=verbose,
output_dir=output_dir,
auto_sort=auto_sort,
Expand Down Expand Up @@ -1703,6 +1707,8 @@ class KhiopsClassifier(ClassifierMixin, KhiopsPredictor):
group_target_value : bool, default ``False``
Allows grouping of the target values in classification. It can substantially
increase the training time.
keep_selected_variables_only : bool, default ``True``
Keeps only predictor-selected variables in the supervised analysis report.
verbose : bool, default ``False``
If ``True`` it prints debug information and it does not erase temporary files
when fitting, predicting or transforming.
Expand Down Expand Up @@ -1760,6 +1766,7 @@ def __init__(
construction_rules=None,
n_feature_parts=0,
group_target_value=False,
keep_selected_variables_only=True,
verbose=False,
output_dir=None,
auto_sort=True,
Expand All @@ -1773,6 +1780,7 @@ def __init__(
n_evaluated_features=n_evaluated_features,
construction_rules=construction_rules,
n_feature_parts=n_feature_parts,
keep_selected_variables_only=keep_selected_variables_only,
verbose=verbose,
output_dir=output_dir,
auto_sort=auto_sort,
Expand Down Expand Up @@ -2105,6 +2113,8 @@ class KhiopsRegressor(RegressorMixin, KhiopsPredictor):
n_feature_parts : int, default 0
Maximum number of variable parts produced by preprocessing methods. If equal
to 0 it is automatically calculated.
keep_selected_variables_only : bool, default ``True``
Keeps only predictor-selected variables in the supervised analysis report.
verbose : bool, default ``False``
If ``True`` it prints debug information and it does not erase temporary files
when fitting, predicting or transforming.
Expand Down Expand Up @@ -2149,6 +2159,7 @@ def __init__(
n_evaluated_features=0,
construction_rules=None,
n_feature_parts=0,
keep_selected_variables_only=True,
verbose=False,
output_dir=None,
auto_sort=True,
Expand All @@ -2162,6 +2173,7 @@ def __init__(
n_evaluated_features=n_evaluated_features,
construction_rules=construction_rules,
n_feature_parts=n_feature_parts,
keep_selected_variables_only=keep_selected_variables_only,
verbose=verbose,
output_dir=output_dir,
auto_sort=auto_sort,
Expand Down
6 changes: 6 additions & 0 deletions tests/test_sklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,7 @@ def setUpClass(cls):
"max_parts": 3,
"group_target_value": False,
"additional_data_tables": {},
"keep_selected_variables_only": False,
}
},
"predict": {
Expand Down Expand Up @@ -794,6 +795,7 @@ def setUpClass(cls):
"max_evaluated_variables": 3,
"construction_rules": ["TableMode", "TableSelection"],
"max_parts": 5,
"keep_selected_variables_only": False,
"additional_data_tables": {},
}
},
Expand Down Expand Up @@ -1449,6 +1451,7 @@ def test_parameter_transfer_classifier_fit_from_monotable_dataframe(self):
"construction_rules": ["TableMode", "TableSelection"],
"n_feature_parts": 3,
"group_target_value": False,
"keep_selected_variables_only": False,
},
)

Expand All @@ -1474,6 +1477,7 @@ def test_parameter_transfer_classifier_fit_from_monotable_dataframe_with_df_y(
"construction_rules": ["TableMode", "TableSelection"],
"n_feature_parts": 3,
"group_target_value": False,
"keep_selected_variables_only": False,
},
)

Expand Down Expand Up @@ -1631,6 +1635,7 @@ def test_parameter_transfer_regressor_fit_from_monotable_dataframe(self):
"type_text_features": "ngrams",
"construction_rules": ["TableMode", "TableSelection"],
"n_feature_parts": 5,
"keep_selected_variables_only": False,
},
)

Expand All @@ -1651,6 +1656,7 @@ def test_parameter_transfer_regressor_fit_from_monotable_dataframe_with_df_y(
"type_text_features": "ngrams",
"construction_rules": ["TableMode", "TableSelection"],
"n_feature_parts": 5,
"keep_selected_variables_only": False,
},
)

Expand Down
Loading