-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
62 lines (45 loc) · 1.55 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
import sys
import os
# Add the directory containing the wine_quality module to the Python path
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), 'src')))
from wine_quality.logging import logger
from wine_quality.pipeline.stage_01_data_ingestion import DataIngestionTrainingPipeline
from wine_quality.pipeline.stage_02_data_validation import DataValidationTrainingPipeline
from wine_quality.pipeline.stage_03_data_transformation import DataTransformationTrainingPipeline
from wine_quality.pipeline.satge_04_model_trainer import ModelTrainingPipeline
STAGE_NAME = 'Data Ingestion Stage'
try:
logger.info(f"Starting {STAGE_NAME}")
data_ingestion = DataIngestionTrainingPipeline()
data_ingestion.main()
logger.info(f"Completed {STAGE_NAME}")
except Exception as e:
logger.error(e)
raise e
STAGE_NAME = 'Data Validation Stage'
try:
logger.info(f"Starting {STAGE_NAME}")
data_ingestion = DataValidationTrainingPipeline()
data_ingestion.main()
logger.info(f"Completed {STAGE_NAME}")
except Exception as e:
logger.error(e)
raise e
STAGE_NAME = 'Data Transformation Stage'
try:
logger.info(f"Starting {STAGE_NAME}")
obj = DataTransformationTrainingPipeline()
obj.main()
logger.info(f"Completed {STAGE_NAME}")
except Exception as e:
logger.error(e)
raise e
STAGE_NAME = 'Model Trainer Stage'
try:
logger.info(f"Starting {STAGE_NAME}")
obj = ModelTrainingPipeline()
obj.main()
logger.info(f"Completed {STAGE_NAME}")
except Exception as e:
logger.error(e)
raise e