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

# Fixed
- (`sklearn`) Default value of `n_features` for the supervised estimators

## 11.0.0.2 - 2026-01-26

## Fixed
Expand Down
16 changes: 8 additions & 8 deletions khiops/sklearn/estimators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions tests/test_sklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,7 @@ def setUpClass(cls):
"field_separator": "\t",
"detect_format": False,
"header_line": True,
"max_constructed_variables": 1000,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd add n_features to the monotable tests (e.g. in test_parameter_transfer_classifier_fit_from_monotable_dataframe), in which case the expected max_constructed_variables should equal the value of n_features set in the test.

Copy link
Collaborator Author

@tramora tramora Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After exchanging with @folmos-at-orange on this PR or the other one related, the idea here is to verify the core parameter is set at its default value (1000) WITHOUT giving the optional input n_features.
Otherwise it would only be checking the correspondance between the value passed to the sklearn estimators and the value passed to the core

"max_pairs": 1,
"max_trees": 5,
"max_text_features": 300000,
Expand Down Expand Up @@ -784,6 +785,7 @@ def setUpClass(cls):
"field_separator": "\t",
"detect_format": False,
"header_line": True,
"max_constructed_variables": 1000,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idem above.

"max_trees": 0,
"max_text_features": 300000,
"text_features": "ngrams",
Expand Down Expand Up @@ -811,6 +813,7 @@ def setUpClass(cls):
"field_separator": "\t",
"detect_format": False,
"header_line": True,
"max_constructed_variables": 1000,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idem above.

"max_pairs": 1,
"max_trees": 5,
"max_text_features": 300000,
Expand Down
Loading