File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
constants/training_pipeline Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 5353 "n_neighbors" : 3 ,
5454 "weights" : "uniform" ,
5555}
56+
57+ """
58+ MODEL TRAINER related constant start with MODEL_TRAINER var name
59+ """
60+ MODEL_TRAINER_DIR_NAME : str = "model_trainer"
61+ MODEL_TRAINER_TRAINED_MODEL_DIR : str = "trained_model"
62+ MODEL_TRAINER_TRAINED_MODEL_NAME : str = "model.pkl"
63+ MODEL_TRAINER_EXPECTED_SCORE : float = 0.6
64+ MODEL_TRAINER_OVER_FITTING_UNDER_FITTING_THRESHOLD : float = 0.05
65+ MODEL_TRAINER_MODEL_CONFIG_FILE_PATH : str = os .path .join ("config" , "model.yaml" )
Original file line number Diff line number Diff line change @@ -109,3 +109,23 @@ def __post_init__(self):
109109 training_pipeline .DATA_TRANSFORMATION_TRANSFORMED_OBJECT_DIR , # fixed here
110110 training_pipeline .MODEL_FILE_NAME # You might want to change this if you have a specific preprocessing object file name constant
111111 )
112+
113+ @dataclass
114+ class ModelTrainerConfigEntity :
115+ training_pipeline_config : TrainingPipelineConfigEntity
116+
117+ def __post_init__ (self ):
118+ self .model_trainer_dir : str = os .path .join (
119+ self .training_pipeline_config .artifact_dir ,
120+ training_pipeline .MODEL_TRAINER_DIR_NAME
121+ )
122+ self .trained_model_file_path : str = os .path .join (
123+ self .model_trainer_dir ,
124+ training_pipeline .MODEL_TRAINER_TRAINED_MODEL_DIR
125+ )
126+ self .expected_score : float = training_pipeline .MODEL_TRAINER_EXPECTED_SCORE
127+ self .overfitting_underfitting_threshold : training_pipeline .MODEL_TRAINER_OVER_FITTING_UNDER_FITTING_THRESHOLD # Assuming you want to keep this as a constant
128+ self .model_config_file_path : str = os .path .join (
129+ self .model_trainer_dir ,
130+ training_pipeline .MODEL_FILE_PATH
131+ )
You can’t perform that action at this time.
0 commit comments