-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
69 lines (51 loc) · 1.96 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
68
69
from ChurnPrediction import logger
from ChurnPrediction.pipeline.stage1_data_ingestion_pipeline import DataIngestionPipeline
from ChurnPrediction.pipeline.stage2_data_validation_pipeline import DataValidationPipeline
from ChurnPrediction.pipeline.stage3_data_transformation_pipeline import DataTransformationPipeline
from ChurnPrediction.pipeline.stage4_model_trainer_pipeline import ModelTrainerPipeline
from ChurnPrediction.pipeline.stage5_model_evaluation_pipeline import ModelEvaluationPipeline
STAGE_NAME = 'Data Ingestion Stage'
try:
logger.info(f"========= Stage {STAGE_NAME} started =========")
data_ingestion = DataIngestionPipeline()
data_ingestion.main()
logger.info(f"========= Stage {STAGE_NAME} completed =========")
except Exception as e:
logger.exception(e)
raise e
STAGE_NAME = 'Data Validation Stage'
try:
logger.info(f"========= Stage {STAGE_NAME} started =========")
object = DataValidationPipeline()
object.main()
logger.info(f"========= Stage {STAGE_NAME} completed =========")
except Exception as e:
logger.exception(e)
raise e
STAGE_NAME = 'Data Transformation Stage'
try:
logger.info(f"========= Stage {STAGE_NAME} started =========")
object = DataTransformationPipeline()
object.main()
logger.info(f"========= Stage {STAGE_NAME} completed =========")
except Exception as e:
logger.exception(e)
raise e
STAGE_NAME = 'Model Trainer Stage'
try:
logger.info(f"========= Stage {STAGE_NAME} started =========")
object = ModelTrainerPipeline()
object.main()
logger.info(f"========= Stage {STAGE_NAME} completed =========")
except Exception as e:
logger.exception(e)
raise e
STAGE_NAME = 'Model Evaluation Stage'
try:
logger.info(f"========= Stage {STAGE_NAME} started =========")
object = ModelEvaluationPipeline()
object.main()
logger.info(f"========= Stage {STAGE_NAME} completed =========")
except Exception as e:
logger.exception(e)
raise e