Model Orchastrator
Implemented a FactoryDesign pattern to create a pipeline based on the configuration provided. Implemented pipelines: 1. ModelPipeline 2. TuningPipeline
CustomPipeline
Bases: ABC
, Pipeline
Source code in model_forge/model/model_orchastrator.py
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
|
transform_without_predictor(X)
Transform the data without using the predictor step.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X |
array - like
|
The input data to be transformed. |
required |
Returns:
Type | Description |
---|---|
|
Source code in model_forge/model/model_orchastrator.py
152 153 154 155 156 157 158 159 160 161 162 163 |
|
ModelOrchestrator
Bases: Orchestartor
Class representing the model orchestrator.
This class is responsible for creating a model pipeline and managing the features.
Attributes:
Name | Type | Description |
---|---|---|
cfg |
Config
|
The configuration object. |
Methods:
Name | Description |
---|---|
create_pipeline |
Creates a model pipeline based on the configuration. |
features_in |
Returns the features specified in the configuration. |
Source code in model_forge/model/model_orchastrator.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
|
create_pipeline()
Creates a model pipeline based on the configuration.
Returns:
Name | Type | Description |
---|---|---|
ModelPipeline |
The created model pipeline. |
Source code in model_forge/model/model_orchastrator.py
56 57 58 59 60 61 62 63 64 |
|
features_in(cfg)
Returns the features specified in the configuration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cfg |
Config
|
The configuration object. |
required |
Returns:
Name | Type | Description |
---|---|---|
list |
The list of features. |
Source code in model_forge/model/model_orchastrator.py
66 67 68 69 70 71 72 73 74 75 76 77 |
|
ModelPipeline
Bases: CustomPipeline
Custom pipeline class for defining a model pipeline.
Source code in model_forge/model/model_orchastrator.py
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 |
|
create_from_config(cfg)
classmethod
Create a custom model pipeline from the provided configuration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cfg |
DictConfig | OmegaConf
|
The configuration object. |
required |
Returns:
Name | Type | Description |
---|---|---|
ModelPipeline |
ModelPipeline
|
The created custom model pipeline. |
Source code in model_forge/model/model_orchastrator.py
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 |
|
Orchestartor
Bases: ABC
Abstract base class for orchestrating the model pipeline.
Attributes:
Name | Type | Description |
---|---|---|
cfg |
dict
|
Configuration parameters for the orchestrator. |
Methods:
Name | Description |
---|---|
create_pipeline |
Abstract method for creating the model pipeline. |
features_in |
Abstract method for processing the input features. |
Source code in model_forge/model/model_orchastrator.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
|
TuningOrchestrator
Bases: Orchestartor
Class representing the orchestrator for model tuning.
Source code in model_forge/model/model_orchastrator.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
|
create_pipeline()
Creates a tuning pipeline based on the configuration and trial.
Source code in model_forge/model/model_orchastrator.py
90 91 92 93 94 |
|
features_in(cfg)
Returns the features specified in the given configuration.
Source code in model_forge/model/model_orchastrator.py
96 97 98 99 100 |
|
TuningPipeline
Bases: CustomPipeline
Source code in model_forge/model/model_orchastrator.py
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
|
create_from_config(cfg, trial)
classmethod
Create a custom model pipeline from the provided configuration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cfg |
DictConfig | OmegaConf
|
The configuration object. |
required |
Returns:
Name | Type | Description |
---|---|---|
TuningPipeline |
TuningPipeline
|
The created custom model pipeline. |
Source code in model_forge/model/model_orchastrator.py
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 |
|
create_tuning_params(cfg, trial)
classmethod
Create tuning parameters based on the provided configuration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cfg |
object
|
The configuration object containing hyperparameters. |
required |
Returns:
Name | Type | Description |
---|---|---|
dict |
A dictionary containing the tuning parameters for each step. |
Source code in model_forge/model/model_orchastrator.py
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
|