Machine Learning Model inside Docker Container

Task Description:

  • Pull an image and launch an container.

Step 1: Check docker information.

  • USING COMMAND “ docker info”.

STEP 2: PULL CENTOS IMAGE AND CREATE A NEW CONTAINER.

USING COMMAND “ docker pull centos”.

STEP 3: RENAME CONTAINER AND INSTALL PYTHON3

USING COMMAND “ docker run -it — name <name of container> centos:latest

FOR DOWNLOADING PYTHON 3 USE: “ yum install python3”.

STEP 4: INSTALL LIBRARIES

  • “pip3 install pandas”

STEP4: COPY THE “SalaryData.csv” FILE FROM BASE OS TO CONTAINER

  • USING “ docker cp SalaryData.csv container_name:/”

STEP 5: NOW CREATE A “vi.salarypredictor.py FILE

STEP5: NOW MODEL WILL GIVE PREDICTIONS

USING “ python3 Salarypredictor.py” our model will give predictions.

THANK YOU.