generated from heydido/MLProjectTemplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
57 lines (35 loc) · 1.54 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
import sys
from src.INRCoinSense.pipeline.data_ingestion import DataIngestionPipeline
from src.INRCoinSense.pipeline.data_validation import DataValidationPipeline
from src.INRCoinSense.pipeline.model_training import ModelTrainingPipeline
from src.INRCoinSense.logger import logging
from src.INRCoinSense.exception import CustomException
logging.info(">>>>>> INRCoinSense Pipeline started <<<<<<\n")
STAGE_NAME = "Data Ingestion"
try:
logging.info(f">>>>>> stage '{STAGE_NAME}' started <<<<<<")
data_ingestor = DataIngestionPipeline()
data_ingestor.main()
logging.info(f">>>>>> stage '{STAGE_NAME}' completed <<<<<<\n")
except Exception as e:
logging.error(f"Error occurred while running {STAGE_NAME}!")
raise CustomException(e, sys)
STAGE_NAME = "Data Validation"
try:
logging.info(f">>>>>> stage '{STAGE_NAME}' started <<<<<<")
data_validator = DataValidationPipeline()
data_validator.main()
logging.info(f">>>>>> stage '{STAGE_NAME}' completed <<<<<<\n")
except Exception as e:
logging.error(f"Error occurred while running {STAGE_NAME}!")
raise CustomException(e, sys)
STAGE_NAME = "Model Training"
try:
logging.info(f">>>>>> stage '{STAGE_NAME}' started <<<<<<")
model_trainer = ModelTrainingPipeline()
model_trainer.main()
logging.info(f">>>>>> stage '{STAGE_NAME}' completed <<<<<<\n")
logging.info(">>>>>> INRCoinSense Pipeline completed successfully <<<<<<")
except Exception as e:
logging.error(f"Error occurred while running {STAGE_NAME}!")
raise CustomException(e, sys)