Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

main.py 2.5 KB

You have to be logged in to leave a comment. Sign In
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
70
71
72
73
74
75
  1. from mlProject import logger
  2. from mlProject.pipeline.stage_01_data_ingestion import DataIngestionTrainingPipeline
  3. from mlProject.pipeline.stage_02_data_validation import DataValidationTrainingPipeline
  4. from mlProject.pipeline.stage_03_data_transformation import DataTransformationTrainingPipeline
  5. from mlProject.pipeline.stage_04_model_trainer import ModelTrainerTrainingPipeline
  6. STAGE_NAME = "Data Ingestion stage"
  7. try:
  8. # Log start of the data ingestion stage
  9. logger.info(f">>>>>> stage {STAGE_NAME} started <<<<<<")
  10. # Instantiate the DataIngestionTrainingPipeline object
  11. pipeline = DataIngestionTrainingPipeline()
  12. # Execute the main method to run the data ingestion pipeline
  13. pipeline.main()
  14. # Log completion of the data ingestion stage
  15. logger.info(f">>>>>> stage {STAGE_NAME} completed <<<<<<\n\nx==========x")
  16. except Exception as e:
  17. # Log any exceptions that occur during the pipeline execution
  18. logger.exception(e)
  19. raise e # Re-raise the exception for further handling
  20. STAGE_NAME = "Data Validation Stage"
  21. try:
  22. # Log start of the data validation stage
  23. logger.info(f">>>>>> stage {STAGE_NAME} started <<<<<<")
  24. # Instantiate the DataValidationTrainingPipeline object
  25. pipeline = DataValidationTrainingPipeline()
  26. # Execute the main method to run the data validation pipeline
  27. pipeline.main()
  28. # Log completion of the data validation stage
  29. logger.info(f">>>>>> stage {STAGE_NAME} completed <<<<<<\n\nx==========x")
  30. except Exception as e:
  31. # Log any exceptions that occur during the pipeline execution
  32. logger.exception(e)
  33. raise e # Re-raise the exception for further handling
  34. STAGE_NAME = "Data Transformation Stage"
  35. try:
  36. # Log start of the stage
  37. logger.info(f">>>>>> Stage {STAGE_NAME} started <<<<<<")
  38. # Initialize DataTransformationTrainingPipeline object
  39. obj = DataTransformationTrainingPipeline()
  40. # Execute main method of the pipeline
  41. obj.main()
  42. # Log completion of the stage
  43. logger.info(f">>>>>> Stage {STAGE_NAME} completed <<<<<<\n\nx==========x")
  44. except Exception as e:
  45. # Log any exceptions that occur during the stage
  46. logger.exception(e)
  47. # Re-raise the exception for further handling
  48. raise e
  49. STAGE_NAME = "Model Trainer stage"
  50. try:
  51. logger.info(f">>>>>> stage {STAGE_NAME} started <<<<<<")
  52. obj = ModelTrainerTrainingPipeline()
  53. obj.main()
  54. logger.info(f">>>>>> stage {STAGE_NAME} completed <<<<<<\n\nx==========x")
  55. except Exception as e:
  56. logger.exception(e)
  57. raise e
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...