This is an assignment: 1) What needs to be done Download the archive with the ai

WRITE MY ESSAY

This is an assignment:
1) What needs to be done
Download the archive with the airflow_hw project, inside it:
DAG template (dags/hw_dag.py),
ready ML model code (modules/pipeline.py),
script template for model prediction (modules/predict.py),
training and testing data (data/train, data/test),
empty folders for saving the ML model and predictions.
2) Put the airflow_hw folder in your home directory (~/) and open it in Pycharm.
3) Run the pipeline with the model locally and in Airflow, this will train and save the object with the best model pipeline in pickle format:
locally: python3 modules/pipeline.py (from the Pycharm terminal).
in Airflow: copy the hw_dag.py file to the $AIRFLOW_HOME/dags folder.
After that, the new DAG will be displayed in the interface:
4) Write code in the modules/predict.py file, which, when calling the predict() function:
loads the trained model,
makes predictions for all objects in the data/test folder,
combines the predictions into one Dataframe and saves them in csv format in the data/predictions folder.
Don’t forget to break the code into semantic parts in the form of separate functions.
5) Check the correctness of the code by running it locally: python3modules/predict.py (from the Pycharm terminal)
6) Integrate the model’s prediction into the pipeline, which will have 2 steps:
pipeline – the pipeline function is executed here,
predict – a prediction is made for all objects and saved in the data/predictions folder.
7) Run the pipeline in the Airflow interface and get the model’s predictions.

WRITE MY ESSAY

Leave a Comment

Scroll to Top