-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdemo.py
40 lines (33 loc) · 1.51 KB
/
demo.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
from stock.pipeline.pipeline import Pipeline
from stock.exception import StockException
from stock.logger import logging
from stock.config.configuration import Configuartion
from stock.component.data_transformation import DataTransformation
from stock.component.data_ingestion import DataIngestion
from stock.constant import get_current_time_stamp
def main():
try:
pipeline = Pipeline(config=Configuartion(current_time_stamp=get_current_time_stamp()))
if not Pipeline.experiment.running_status:
message = "Training started."
pipeline.start()
else:
message = "Training is already in progress."
context = {
"experiment": pipeline.get_experiments_status().to_html(classes='table table-striped col-12'),
"message": message
}
pipeline.run_pipeline()
logging.info("main function execution completed.")
# # data_validation_config = Configuartion().get_data_transformation_config()
# # print(data_validation_config)
# schema_file_path=r"D:\Project\machine_learning_project\config\schema.yaml"
# file_path=r"D:\Project\machine_learning_project\stock\artifact\data_ingestion\2022-06-27-19-13-17\ingested_data\train\stock.csv"
# df= DataTransformation.load_data(file_path=file_path,schema_file_path=schema_file_path)
# print(df.columns)
# print(df.dtypes)
except Exception as e:
logging.error(f"{e}")
print(e)
if __name__=="__main__":
main()