Are you sure you want to delete this access key?
Legend |
---|
DVC Managed File |
Git Managed File |
Metric |
Stage File |
External File |
Legend |
---|
DVC Managed File |
Git Managed File |
Metric |
Stage File |
External File |
DEPLOYED APPLICATION LINK:https://mlops-application.herokuapp.com/
step1 :
conda create -n filename python=3.7
step2 :
Create template.py
file and schema to it as shown below
step 4:
Inside the params.yaml
file understand it and append the code i have written
Also same for dvc.yaml
These 2 are the brain and heart for this mlops dvc project
step 5:
Inside the src
dir create get_data.py
OR
touch src/get_data.py
The main objective for making this file is to get track of params.yaml file and to read the data present in our local system.If you want to read data from s3 bucket or azure you can also customize the code and fetch the data
step 6:
After step 5 open up vscode or pycharm terminal
Follow these commands
1.pip install -r requirements.txt
2.git init
3.dvc init
4.dvc add data_given/csv_file_name.csv
5.git add .
6.git commit -m "committed"
7.git remote add origin git repo https address
8.git branch -M main
9.git push origin main
step 7:
Inside the src
dir create load_data.py
file
OR
touch src/load_data.py
The main objective for this file is we will write a function
which will fetch .csv
file and append to raw
data folder.
step8 :
Inside the src
dir create split_data.py
OR
touch src/split_data.py
The main objective for this file by the sklearn
library we will divide the data into 75:25
ratio and then append to processed
folder
step9 :
Inside the src
dir create train_evaluate.py
OR
touch src/train_evaluate.py
This is the favorite step for all data science enthusiasts we will train and evaluate the model here.
step 10:
After evaluating the model i got around 85% accuracy of r2 score and around 0.07 normalized rmse score formula for r2=1-rss/tss and rmse formuala np.sqrt((x-x^)^2)/n and normalized rmse formula rmse/max-min of the target.Save and dump it to saved_models directory.
step11:
Come to terminal and follow these commands
dvc repro
dvc params diff
if not worked try below one
dvc metrics show
This will track all the scores,parameters of ml algorithm and in future if u changed any ml algorithm it will track and show in logs.
step12:
Come to terminal and install few packages
pip install pytest
pip install tox
These packages are used for testing environment.
step13:
create file named tox.ini
it is used bcz tox is a generic virtualenv management and test command tool that is used for.
-->>Helps in running your tests in each environment.
schema
[tox]
envlist=py37
[testenv]
deps=pytest
command=pytest -v
step13:
make dir test
inside test create files __init__.py
,conftest.py
,test_config.py
These files help us for testing environment.
step14:
come to terminal
pytest -v
type it will test and give test cases pass or fail
step15:
create setup.py
in root dir it is help us to create python package.
Come to terminal
Type tox
it will install all the dependencies if no error it will pass the test cases otherwise it will give error.
step16:
name="src"
and create package of our model
Come to terminal
python setup.py sdist bdist_wheel
it will create .tar
file and create package src
step17: All our procedure fininshed Now time to create webapp
├───static
│ └───css
│ main.css
│
└───templates
404.html
base.html
index.html
app.py
on root dir for creating flask api
Press p or to see the previous file or, n or to see the next file
Are you sure you want to delete this access key?
Are you sure you want to delete this access key?
Are you sure you want to delete this access key?
Are you sure you want to delete this access key?