-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
67 lines (51 loc) · 2.03 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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
from pipeline.stage_01_data_validation import DataValidationTrainingPipeline
from pipeline.stage_02_data_transformation import DataTransformationTrainingPipeline
from churnPredictor import CustomException, logger
from pipeline.stage_03_model_trainer import ModelTrainerPipeline
from pipeline.stage_04_mflow_tracking import MlflowModelTracking
from pipeline.stage_05_mlflow_serving import MLFlowModelServing
STAGE_NAME = "Data Validation stage"
try:
logger.info(f">>>>>> stage {STAGE_NAME} started <<<<<<")
data_ingestion = DataValidationTrainingPipeline()
data_ingestion.main()
logger.info(f">>>>>> stage {STAGE_NAME} completed <<<<<<\n\nx==========x")
except Exception as e:
logger.exception(e)
raise CustomException(e)
STAGE_NAME = 'Data Transformation Stage'
try:
logger.info(f">>>>>> stage {STAGE_NAME} started <<<<<<")
data_transformation = DataTransformationTrainingPipeline()
data_transformation.main()
logger.info(f">>>>>> stage {STAGE_NAME} completed <<<<<<\n\nx==========x")
except Exception as e:
logger.exception(e)
raise CustomException(e)
STAGE_NAME = "Model Training stage"
try:
logger.info(f">>>>>> stage {STAGE_NAME} started <<<<<<")
model_trainer = ModelTrainerPipeline()
model_trainer.main()
logger.info(f">>>>>> stage {STAGE_NAME} completed <<<<<<\n\nx==========x")
except Exception as e:
logger.exception(e)
raise CustomException(e)
STAGE_NAME = "Model Tracking Stage stage"
try:
logger.info(f">>>>>> stage {STAGE_NAME} started <<<<<<")
mlflow_tracking = MlflowModelTracking()
mlflow_tracking.main()
logger.info(f">>>>>> stage {STAGE_NAME} completed <<<<<<\n\nx==========x")
except Exception as e:
logger.exception(e)
raise CustomException(e)
STAGE_NAME = "Model Serving stage"
try:
logger.info(f">>>>>> stage {STAGE_NAME} started <<<<<<")
mlflow_serving = MLFlowModelServing()
mlflow_serving.main()
logger.info(f">>>>>> stage {STAGE_NAME} completed <<<<<<\n\nx==========x")
except Exception as e:
logger.exception(e)
raise CustomException(e)