Machine Learning on Docker
Step 1:
Install docker in your system
command: yum install docker
note: yum must be configured before that
enter y
After Docker gets successfully installed
Step 2:
Pull any image you want
lets say Centos ( it will automatically pull latest one from docker hub)
Step 3:
Launch a container over docker
command: docker run -it -name stask1 centos
Step 4:
install python over container
command: yum install python3
Enter y
Python is installed over docker!
Step 5:
install numpy library which will be used to save columns while creating our model.
command: pip3 install numpy
Step 6:
install pandas library which will be needed while training our model.
command:
pip3 install pandas
Step 7:
install sklearn library which will be needed while training our model.
command:
pip3 install sklearn
Step 8:
Create a python file to write a code which train our model.
Step 9:
download or copy the dataset from host system.
command: docker cp salary.py stask1:salary.py
docker cp salary.csv stask:salary.csv
Step 10:
Run your python file:
python3 salary.py
It will ask to enter number of experienced years
and after that it will predict your salary.
Thanks for reading! happy learning!