Skip to content

Commit b81ec6e

Browse files
authored
Merge pull request #545 from KhiopsML/543-n-features-default-value
Make the default value of `n_features` match the khiops core value
2 parents c3f1e7b + beb3014 commit b81ec6e

File tree

3 files changed

+22
-10
lines changed

3 files changed

+22
-10
lines changed

CHANGELOG.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@
99
## Unreleased
1010

1111
### Added
12-
- (`sklearn`) `n_feature_parts` parameter to the supervised estimators
12+
- (`sklearn`) `n_feature_parts` parameter to the supervised estimators
13+
14+
### Fixed
15+
- (`sklearn`) Default value of `n_features` for the supervised estimators
1316

1417
## 11.0.0.2 - 2026-01-26
1518

16-
## Fixed
19+
### Fixed
1720
- (`core`) Samples dir path construction when HOME is a remote path
1821

1922
## 11.0.0.1 - 2026-01-14

khiops/sklearn/estimators.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,7 +1188,7 @@ class KhiopsSupervisedEstimator(KhiopsEstimator):
11881188

11891189
def __init__(
11901190
self,
1191-
n_features=100,
1191+
n_features=1000,
11921192
n_trees=10,
11931193
n_text_features=10000,
11941194
type_text_features="words",
@@ -1513,7 +1513,7 @@ class KhiopsPredictor(KhiopsSupervisedEstimator):
15131513

15141514
def __init__(
15151515
self,
1516-
n_features=100,
1516+
n_features=1000,
15171517
n_trees=10,
15181518
n_text_features=10000,
15191519
type_text_features="words",
@@ -1656,7 +1656,7 @@ class KhiopsClassifier(ClassifierMixin, KhiopsPredictor):
16561656
16571657
Parameters
16581658
----------
1659-
n_features : int, default 100
1659+
n_features : int, default 1000
16601660
Maximum number of features to construct automatically. See
16611661
:doc:`/multi_table_primer` for more details on the multi-table-specific
16621662
features.
@@ -1748,7 +1748,7 @@ class KhiopsClassifier(ClassifierMixin, KhiopsPredictor):
17481748

17491749
def __init__(
17501750
self,
1751-
n_features=100,
1751+
n_features=1000,
17521752
n_pairs=0,
17531753
n_trees=10,
17541754
n_text_features=10000,
@@ -2076,7 +2076,7 @@ class KhiopsRegressor(RegressorMixin, KhiopsPredictor):
20762076
20772077
Parameters
20782078
----------
2079-
n_features : int, default 100
2079+
n_features : int, default 1000
20802080
Maximum number of features to construct automatically. See
20812081
:doc:`/multi_table_primer` for more details on the multi-table-specific
20822082
features.
@@ -2141,7 +2141,7 @@ class KhiopsRegressor(RegressorMixin, KhiopsPredictor):
21412141

21422142
def __init__(
21432143
self,
2144-
n_features=100,
2144+
n_features=1000,
21452145
n_trees=0,
21462146
n_text_features=10000,
21472147
type_text_features="words",
@@ -2283,7 +2283,7 @@ class KhiopsEncoder(TransformerMixin, KhiopsSupervisedEstimator):
22832283
----------
22842284
categorical_target : bool, default ``True``
22852285
``True`` if the target column is categorical.
2286-
n_features : int, default 100
2286+
n_features : int, default 1000
22872287
Maximum number of features to construct automatically. See
22882288
:doc:`/multi_table_primer` for more details on the multi-table-specific
22892289
features.
@@ -2390,7 +2390,7 @@ class KhiopsEncoder(TransformerMixin, KhiopsSupervisedEstimator):
23902390
def __init__(
23912391
self,
23922392
categorical_target=True,
2393-
n_features=100,
2393+
n_features=1000,
23942394
n_pairs=0,
23952395
n_trees=0,
23962396
n_text_features=10000,

tests/test_sklearn.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,7 @@ def setUpClass(cls):
753753
"field_separator": "\t",
754754
"detect_format": False,
755755
"header_line": True,
756+
"max_constructed_variables": 333,
756757
"max_pairs": 1,
757758
"max_trees": 5,
758759
"max_text_features": 300000,
@@ -785,6 +786,7 @@ def setUpClass(cls):
785786
"field_separator": "\t",
786787
"detect_format": False,
787788
"header_line": True,
789+
"max_constructed_variables": 555,
788790
"max_trees": 0,
789791
"max_text_features": 300000,
790792
"text_features": "ngrams",
@@ -813,6 +815,7 @@ def setUpClass(cls):
813815
"field_separator": "\t",
814816
"detect_format": False,
815817
"header_line": True,
818+
"max_constructed_variables": 777,
816819
"max_pairs": 1,
817820
"max_trees": 5,
818821
"max_text_features": 300000,
@@ -1432,6 +1435,7 @@ def test_parameter_transfer_classifier_fit_from_monotable_dataframe(self):
14321435
schema_type="monotable",
14331436
source_type="dataframe",
14341437
extra_estimator_kwargs={
1438+
"n_features": 333,
14351439
"n_pairs": 1,
14361440
"n_trees": 5,
14371441
"n_text_features": 300000,
@@ -1456,6 +1460,7 @@ def test_parameter_transfer_classifier_fit_from_monotable_dataframe_with_df_y(
14561460
schema_type="monotable",
14571461
source_type="dataframe_xy",
14581462
extra_estimator_kwargs={
1463+
"n_features": 333,
14591464
"n_pairs": 1,
14601465
"n_trees": 5,
14611466
"n_text_features": 300000,
@@ -1519,6 +1524,7 @@ def test_parameter_transfer_encoder_fit_from_monotable_dataframe(self):
15191524
schema_type="monotable",
15201525
source_type="dataframe",
15211526
extra_estimator_kwargs={
1527+
"n_features": 777,
15221528
"n_pairs": 1,
15231529
"n_trees": 5,
15241530
"n_text_features": 300000,
@@ -1546,6 +1552,7 @@ def test_parameter_transfer_encoder_fit_from_monotable_dataframe_with_df_y(
15461552
schema_type="monotable",
15471553
source_type="dataframe_xy",
15481554
extra_estimator_kwargs={
1555+
"n_features": 777,
15491556
"n_pairs": 1,
15501557
"n_trees": 5,
15511558
"n_text_features": 300000,
@@ -1615,6 +1622,7 @@ def test_parameter_transfer_regressor_fit_from_monotable_dataframe(self):
16151622
schema_type="monotable",
16161623
source_type="dataframe",
16171624
extra_estimator_kwargs={
1625+
"n_features": 555,
16181626
"n_selected_features": 1,
16191627
"n_evaluated_features": 3,
16201628
"n_text_features": 300000,
@@ -1634,6 +1642,7 @@ def test_parameter_transfer_regressor_fit_from_monotable_dataframe_with_df_y(
16341642
schema_type="monotable",
16351643
source_type="dataframe_xy",
16361644
extra_estimator_kwargs={
1645+
"n_features": 555,
16371646
"n_selected_features": 1,
16381647
"n_evaluated_features": 3,
16391648
"n_text_features": 300000,

0 commit comments

Comments
 (0)