Open command prompt by typing cmd and give command python – – version, check
if you dont have python you may see like this
Goto https://www.python.org/downloads/ and download the latest python version for windows
After the installer is downloaded, double click and run, Install now and select check box to add path as shown
Now close the command prompt and open and type python – – version, you will be able to see version number
Goto Search Type This PC and Right Click on Properties
Click on Advanced System Settings
Click on Environment Variables
Select Path and Edit, Ensure Python as shown is included as per your installation location
pip install numpy pandas scikit-learn streamlit
Once python libraries are installed you will see like this
Check if Jupyter Notebook is installed
If not installed, run command pip install notebook
Now Verify if Jupyter is Installed, if installed you will see like this
Now Verify if Jupyter is Installed, if installed you will see like this
Jupyter Notebook will open in browser or
Goto File > New > Notebook – Select Python Version and Select Check Box
Rename the file
import the libraries and run
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
Download The Dataset and
https://drive.google.com/file/d/1LhaWOs3V3cvFX-isSqL4-E9M9VJXb0Ua/view?usp=sharing
Download The Dataset and
Try reading the file by running this command
cars_data = pd.read_csv(‘Cardetails.csv’)
You may get this error, this is due to csv file is not placed in right location
Check the correct path
give command
import os
print(os.getcwd())
now at this location that comes, place your Cardetails.csv file
Rerun
give command
import os
print(os.getcwd())
now at this location , place your Cardetails.csv file and rerun command cars_data = pd.read_csv(‘Cardetails.csv’) ,it will run successfully
Lets kook at the data
give command cars_data.head()
to fetch top 5 rows
Lets Clean Data , remove unnecessary columns
Dropping the column torque
Checking the DataSet Size Number of Rows and Columns
So we having 8128 rows and 12 columns
Check for null records
Remove the null records
Check for duplicate records
Perform Data Analysis
run command cars_data.info()
Check for unique records
Write Function to Get Brand Name & Function to Convert to Float
value=value.split(‘ ‘)[0]
value=value.strip()
if value==”:
value=0
return float(value)
Check if brand name is getting extracted from car name by using the written function
def get_brand_name(car_name):
value=value.split(‘ ‘)[0]
value=value.strip()
if value==”:
value=0
return float(value)
Now clean the other columns, do required typecasting
run follwing command
Check for unique car names
run follwing command
Assign numeric value to car names
run follwing command
Assign numeric value to car names
run follwing command
Rechecking Data Types
run follwing command
Check Data Set
run following command
Split Input and Output Data Set
run following command
LinearRegression Model Creation
run following command
Import pandas
run following command
Saving the model
run following command
Download for Windows
https://code.visualstudio.com/
Run the installer
code for app.py
in same folder place model and csv file
Isstall and Run Streamlit in Terminal