ICP 5 - AsharGit/Python-ICP GitHub Wiki

Welcome to the Python-ICP-5 wiki!

This ICP we use machine learning to read csv files to train and test datasets and present them graphically.

Video for this ICP: https://youtu.be/7ZNkycuh55g

First part of the ICP asks us to visualize garage area vs price and then to remove outlier values.

For the first part, I used pandas library to read the file and assigned x and y variables to garage area and sale price.

I then used matplotlib to scatter and plot the data below which includes the outliers.

Code

Graph of garage area with outliers.

Graph

I was able to figure out a way to find the outliers in the model by using z-score but was unable to implement it into my code.

For the second part of the ICP we used linear regression to find predicted price.

I ran into problems with this and was unable to get an accurate results as shown with my output and graph.

I used pandas to read the file and used training and testing on the data, next I applied the linear regression model fit and finally used matplotlib to visualize the data.

Code

R2 and RMSE output value don't appear to be accurate.

Values

Graph of the output value.

Graph

Correlation

For the last part of this ICP, we use the corr feature to find correlation in the numerical data with revenue and use sort_values to sort them by descending order.

Code

Output for the 5 most correlated features with revenue.

Output