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.3 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
76
77
78
79
80
81
82
  1. from src.mlProject import logger
  2. from src.mlProject.pipeline.stage_01_data_ingestion import DataIngestionTrainingPipeline
  3. from src.mlProject.pipeline.stage_02_data_validation import DataValidationTrainingPipeline
  4. from src.mlProject.pipeline.stage_03_data_transformation import DataTransformationTrainingPipeline
  5. from src.mlProject.pipeline.stage_04_model_trainer import ModelTrainerTrainingPipeline
  6. from src.mlProject.pipeline.stage_05_model_evaluation import ModelEvaluationTrainingPipeline
  7. import dagshub
  8. dagshub.init(repo_owner='kashishthakur26', repo_name='ML_project_with_ML_Flow', mlflow=True)
  9. import mlflow
  10. with mlflow.start_run():
  11. # Your training code here...
  12. mlflow.log_metric('accuracy', 42)
  13. mlflow.log_param('Param name', 'Value')
  14. STAGE_NAME = "Data Ingestion stage"
  15. try:
  16. logger.info(f">>>>>> stage {STAGE_NAME} started <<<<<<")
  17. data_ingestion = DataIngestionTrainingPipeline()
  18. data_ingestion.main()
  19. logger.info(f">>>>>> stage {STAGE_NAME} completed <<<<<<\n\nx==========x")
  20. except Exception as e:
  21. logger.exception(e)
  22. raise e
  23. STAGE_NAME = "Data Validation stage"
  24. try:
  25. logger.info(f">>>>>> stage {STAGE_NAME} started <<<<<<")
  26. data_ingestion = DataValidationTrainingPipeline()
  27. data_ingestion.main()
  28. logger.info(f">>>>>> stage {STAGE_NAME} completed <<<<<<\n\nx==========x")
  29. except Exception as e:
  30. logger.exception(e)
  31. raise e
  32. STAGE_NAME = "Data Transformation stage"
  33. try:
  34. logger.info(f">>>>>> stage {STAGE_NAME} started <<<<<<")
  35. data_ingestion = DataTransformationTrainingPipeline()
  36. data_ingestion.main()
  37. logger.info(f">>>>>> stage {STAGE_NAME} completed <<<<<<\n\nx==========x")
  38. except Exception as e:
  39. logger.exception(e)
  40. raise e
  41. STAGE_NAME = "Model Trainer stage"
  42. try:
  43. logger.info(f">>>>>> stage {STAGE_NAME} started <<<<<<")
  44. data_ingestion = ModelTrainerTrainingPipeline()
  45. data_ingestion.main()
  46. logger.info(f">>>>>> stage {STAGE_NAME} completed <<<<<<\n\nx==========x")
  47. except Exception as e:
  48. logger.exception(e)
  49. raise e
  50. STAGE_NAME = "Model evaluation stage"
  51. try:
  52. logger.info(f">>>>>> stage {STAGE_NAME} started <<<<<<")
  53. data_ingestion = ModelEvaluationTrainingPipeline()
  54. data_ingestion.main()
  55. logger.info(f">>>>>> stage {STAGE_NAME} completed <<<<<<\n\nx==========x")
  56. except Exception as e:
  57. logger.exception(e)
  58. raise e
Tip!

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

Comments

Loading...