From 819bb4f2e5cf72f52b6a9e0ffce48b2ec081f804 Mon Sep 17 00:00:00 2001 From: Thierry RAMORASOAVINA Date: Tue, 3 Feb 2026 18:39:37 +0100 Subject: [PATCH] Make the default value of `n_features` match the khiops core value - KhiopsClassifier, KhiopsRegressor, KhiopsEncoder --- CHANGELOG.md | 5 +++++ khiops/sklearn/estimators.py | 16 ++++++++-------- tests/test_sklearn.py | 3 +++ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc440647..1dd21d32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 + +# Fixed +- (`sklearn`) Default value of `n_features` for the supervised estimators + ## 11.0.0.2 - 2026-01-26 ## Fixed diff --git a/khiops/sklearn/estimators.py b/khiops/sklearn/estimators.py index 3ad6776b..e7813fe3 100644 --- a/khiops/sklearn/estimators.py +++ b/khiops/sklearn/estimators.py @@ -1188,7 +1188,7 @@ class KhiopsSupervisedEstimator(KhiopsEstimator): def __init__( self, - n_features=100, + n_features=1000, n_trees=10, n_text_features=10000, type_text_features="words", @@ -1504,7 +1504,7 @@ class KhiopsPredictor(KhiopsSupervisedEstimator): def __init__( self, - n_features=100, + n_features=1000, n_trees=10, n_text_features=10000, type_text_features="words", @@ -1645,7 +1645,7 @@ class KhiopsClassifier(ClassifierMixin, KhiopsPredictor): Parameters ---------- - n_features : int, default 100 + n_features : int, default 1000 Maximum number of features to construct automatically. See :doc:`/multi_table_primer` for more details on the multi-table-specific features. @@ -1734,7 +1734,7 @@ class KhiopsClassifier(ClassifierMixin, KhiopsPredictor): def __init__( self, - n_features=100, + n_features=1000, n_pairs=0, n_trees=10, n_text_features=10000, @@ -2060,7 +2060,7 @@ class KhiopsRegressor(RegressorMixin, KhiopsPredictor): Parameters ---------- - n_features : int, default 100 + n_features : int, default 1000 Maximum number of features to construct automatically. See :doc:`/multi_table_primer` for more details on the multi-table-specific features. @@ -2122,7 +2122,7 @@ class KhiopsRegressor(RegressorMixin, KhiopsPredictor): def __init__( self, - n_features=100, + n_features=1000, n_trees=0, n_text_features=10000, type_text_features="words", @@ -2262,7 +2262,7 @@ class KhiopsEncoder(TransformerMixin, KhiopsSupervisedEstimator): ---------- categorical_target : bool, default ``True`` ``True`` if the target column is categorical. - n_features : int, default 100 + n_features : int, default 1000 Maximum number of features to construct automatically. See :doc:`/multi_table_primer` for more details on the multi-table-specific features. @@ -2366,7 +2366,7 @@ class KhiopsEncoder(TransformerMixin, KhiopsSupervisedEstimator): def __init__( self, categorical_target=True, - n_features=100, + n_features=1000, n_pairs=0, n_trees=0, n_text_features=10000, diff --git a/tests/test_sklearn.py b/tests/test_sklearn.py index 1c515652..a50bf04e 100644 --- a/tests/test_sklearn.py +++ b/tests/test_sklearn.py @@ -753,6 +753,7 @@ def setUpClass(cls): "field_separator": "\t", "detect_format": False, "header_line": True, + "max_constructed_variables": 1000, "max_pairs": 1, "max_trees": 5, "max_text_features": 300000, @@ -784,6 +785,7 @@ def setUpClass(cls): "field_separator": "\t", "detect_format": False, "header_line": True, + "max_constructed_variables": 1000, "max_trees": 0, "max_text_features": 300000, "text_features": "ngrams", @@ -811,6 +813,7 @@ def setUpClass(cls): "field_separator": "\t", "detect_format": False, "header_line": True, + "max_constructed_variables": 1000, "max_pairs": 1, "max_trees": 5, "max_text_features": 300000,