54
54
55
55
56
56
class MyTraditionalTabularClassificationPipeline (BaseEstimator ):
57
+ """
58
+ A wrapper class that holds a pipeline for traditional classification.
59
+ Estimators like CatBoost, and Random Forest are considered traditional machine
60
+ learning models and are fitted before neural architecture search.
61
+
62
+ This class is an interface to fit a pipeline containing a traditional machine
63
+ learning model, and is the final object that is stored for inference.
64
+
65
+ Attributes:
66
+ dataset_properties (Dict[str, Any]):
67
+ A dictionary containing dataset specific information
68
+ random_state (Optional[Union[int, np.random.RandomState]]):
69
+ Object that contains a seed and allows for reproducible results
70
+ init_params (Optional[Dict]):
71
+ An optional dictionary that is passed to the pipeline's steps. It complies
72
+ a similar function as the kwargs
73
+ """
57
74
def __init__ (self , config : str ,
58
75
dataset_properties : Dict [str , Any ],
59
76
random_state : Optional [Union [int , np .random .RandomState ]] = None ,
@@ -98,6 +115,21 @@ def get_default_pipeline_options() -> Dict[str, Any]:
98
115
99
116
100
117
class DummyClassificationPipeline (DummyClassifier ):
118
+ """
119
+ A wrapper class that holds a pipeline for dummy classification.
120
+
121
+ A wrapper over DummyClassifier of scikit learn. This estimator is considered the
122
+ worst performing model. In case of failure, at least this model will be fitted.
123
+
124
+ Attributes:
125
+ dataset_properties (Dict[str, Any]):
126
+ A dictionary containing dataset specific information
127
+ random_state (Optional[Union[int, np.random.RandomState]]):
128
+ Object that contains a seed and allows for reproducible results
129
+ init_params (Optional[Dict]):
130
+ An optional dictionary that is passed to the pipeline's steps. It complies
131
+ a similar function as the kwargs
132
+ """
101
133
def __init__ (self , config : Configuration ,
102
134
random_state : Optional [Union [int , np .random .RandomState ]] = None ,
103
135
init_params : Optional [Dict ] = None
@@ -148,6 +180,21 @@ def get_default_pipeline_options() -> Dict[str, Any]:
148
180
149
181
150
182
class DummyRegressionPipeline (DummyRegressor ):
183
+ """
184
+ A wrapper class that holds a pipeline for dummy regression.
185
+
186
+ A wrapper over DummyRegressor of scikit learn. This estimator is considered the
187
+ worst performing model. In case of failure, at least this model will be fitted.
188
+
189
+ Attributes:
190
+ dataset_properties (Dict[str, Any]):
191
+ A dictionary containing dataset specific information
192
+ random_state (Optional[Union[int, np.random.RandomState]]):
193
+ Object that contains a seed and allows for reproducible results
194
+ init_params (Optional[Dict]):
195
+ An optional dictionary that is passed to the pipeline's steps. It complies
196
+ a similar function as the kwargs
197
+ """
151
198
def __init__ (self , config : Configuration ,
152
199
random_state : Optional [Union [int , np .random .RandomState ]] = None ,
153
200
init_params : Optional [Dict ] = None ) -> None :
@@ -351,7 +398,7 @@ def _get_pipeline(self) -> BaseEstimator:
351
398
if isinstance (self .configuration , int ):
352
399
pipeline = self .pipeline_class (config = self .configuration ,
353
400
random_state = np .random .RandomState (self .seed ),
354
- init_params = self .fit_dictionary )
401
+ init_params = self ._init_params )
355
402
elif isinstance (self .configuration , Configuration ):
356
403
pipeline = self .pipeline_class (config = self .configuration ,
357
404
dataset_properties = self .dataset_properties ,
@@ -364,7 +411,7 @@ def _get_pipeline(self) -> BaseEstimator:
364
411
pipeline = self .pipeline_class (config = self .configuration ,
365
412
dataset_properties = self .dataset_properties ,
366
413
random_state = np .random .RandomState (self .seed ),
367
- init_params = self .fit_dictionary )
414
+ init_params = self ._init_params )
368
415
else :
369
416
raise ValueError ("Invalid configuration entered" )
370
417
return pipeline
0 commit comments