Skip to content

Commit b161259

Browse files
committed
Drop deprecated model_report_raw_ estimator attribute
1 parent 557b34d commit b161259

File tree

2 files changed

+9
-33
lines changed

2 files changed

+9
-33
lines changed

khiops/sklearn/estimators.py

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,7 @@
4545
import khiops.core.internals.filesystems as fs
4646
from khiops.core.dictionary import DictionaryDomain
4747
from khiops.core.helpers import build_multi_table_dictionary_domain
48-
from khiops.core.internals.common import (
49-
is_dict_like,
50-
is_list_like,
51-
type_error_message,
52-
)
48+
from khiops.core.internals.common import is_dict_like, is_list_like, type_error_message
5349
from khiops.sklearn.dataset import (
5450
Dataset,
5551
get_khiops_variable_name,
@@ -446,7 +442,6 @@ def _fit_train_model(self, ds, computation_dir, **kwargs):
446442
447443
- self.model_
448444
- self.model_report_
449-
- self.model_report_raw_ (deprecated)
450445
"""
451446

452447
@abstractmethod
@@ -655,10 +650,6 @@ class KhiopsCoclustering(ClusterMixin, KhiopsEstimator):
655650
The name of the main Khiops dictionary within the ``model_`` domain.
656651
model_report_ : `.CoclusteringResults`
657652
The Khiops report object.
658-
model_report_raw_ : dict
659-
JSON object of the Khiops report.
660-
**Deprecated** will be removed in Khiops 11. Use the ``json_data``
661-
attribute of the ``model_report_`` estimator attribute instead.
662653
663654
Examples
664655
--------
@@ -797,7 +788,6 @@ def _fit_train_model(self, ds, computation_dir, **kwargs):
797788

798789
# Save the report file
799790
self.model_report_ = kh.read_coclustering_results_file(coclustering_file_path)
800-
self.model_report_raw_ = self.model_report_.json_data
801791

802792
# Save the id column
803793
if "id_column" in kwargs:
@@ -1037,7 +1027,6 @@ def _simplify(
10371027
simplified_cc.model_report_ = kh.read_coclustering_results_file(
10381028
simplified_coclustering_file_path
10391029
)
1040-
simplified_cc.model_report_raw_ = simplified_cc.model_report_.json_data
10411030

10421031
# Build the individual-variable coclustering model
10431032
self._create_coclustering_model_domain(
@@ -1323,7 +1312,6 @@ def _fit_train_model(self, ds, computation_dir, **kwargs):
13231312
# Save the model domain object and report
13241313
self.model_ = self._read_model_from_dictionary_file(model_kdic_file_path)
13251314
self.model_report_ = kh.read_analysis_results_file(report_file_path)
1326-
self.model_report_raw_ = self.model_report_.json_data
13271315

13281316
@abstractmethod
13291317
def _fit_core_training_function(self, *args, **kwargs):
@@ -1451,10 +1439,10 @@ def _fit_training_post_process(self, ds):
14511439
else:
14521440
pair_feature_evaluated_names_ = []
14531441
pair_feature_evaluated_levels_ = []
1454-
if "treePreparationReport" in self.model_report_raw_:
1455-
tree_preparation_report = self.model_report_raw_["treePreparationReport"][
1456-
"variablesStatistics"
1457-
]
1442+
if "treePreparationReport" in self.model_report_.json_data:
1443+
tree_preparation_report = self.model_report_.json_data[
1444+
"treePreparationReport"
1445+
]["variablesStatistics"]
14581446
tree_feature_evaluated_names_ = [
14591447
tree_preparation_report[i]["name"]
14601448
for i in range(0, len(tree_preparation_report))
@@ -1807,10 +1795,6 @@ class KhiopsClassifier(ClassifierMixin, KhiopsPredictor):
18071795
The name of the main Khiops dictionary within the ``model_`` domain.
18081796
model_report_ : `.AnalysisResults`
18091797
The Khiops report object.
1810-
model_report_raw_ : dict
1811-
JSON object of the Khiops report.
1812-
**Deprecated** will be removed in Khiops 11. Use the ``json_data``
1813-
attribute of the ``model_report_`` estimator attribute instead.
18141798
18151799
Examples
18161800
--------
@@ -2198,10 +2182,6 @@ class KhiopsRegressor(RegressorMixin, KhiopsPredictor):
21982182
The name of the main Khiops dictionary within the ``model_`` domain.
21992183
model_report_ : `.AnalysisResults`
22002184
The Khiops report object.
2201-
model_report_raw_ : dict
2202-
JSON object of the Khiops report.
2203-
**Deprecated** will be removed in Khiops 11. Use the ``json_data``
2204-
attribute of the ``model_report_`` estimator attribute instead.
22052185
22062186
Examples
22072187
--------
@@ -2448,10 +2428,6 @@ class KhiopsEncoder(TransformerMixin, KhiopsSupervisedEstimator):
24482428
The name of the main Khiops dictionary within the ``model_`` domain.
24492429
model_report_ : `.AnalysisResults`
24502430
The Khiops report object.
2451-
model_report_raw_ : dict
2452-
JSON object of the Khiops report.
2453-
**Deprecated** will be removed in Khiops 11. Use the ``json_data``
2454-
attribute of the ``model_report_`` estimator attribute instead.
24552431
24562432
Examples
24572433
--------

tests/test_estimator_attributes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ def assert_attribute_values_ok(self, model, X, y):
105105
else:
106106
pair_feature_evaluated_names_ = []
107107
pair_feature_evaluated_levels_ = []
108-
if "treePreparationReport" in model.model_report_raw_:
109-
tree_preparation_report = model.model_report_raw_["treePreparationReport"][
110-
"variablesStatistics"
111-
]
108+
if "treePreparationReport" in model.model_report_.json_data:
109+
tree_preparation_report = model.model_report_.json_data[
110+
"treePreparationReport"
111+
]["variablesStatistics"]
112112
tree_feature_evaluated_names_ = [
113113
tree_preparation_report[i]["name"]
114114
for i in range(0, len(tree_preparation_report))

0 commit comments

Comments
 (0)