Question: The data file for this project is available from the Seaborn website. To load this data into a DataFrame, run this code: data = sns
The data file for this project is available from the Seaborn website. To load this data into a DataFrame, run this code:
data snsloaddatasetdiamonds
Display the first five rows of data.
Use a condensed heatmap to identify correlations for the price column. Sort the results, include annotations that format the values with three decimal places, and remove the color bar.
Use the column with the strongest correlation to split the data into test and training datasets, where the test dataset consists of of the total dataset. Be sure to specify a value for the randomstate parameter.
Create a LinearRegression object, and then fit the training dataset to the model.
Score the model using the test dataset.
Predict the y values based on the x values in the test dataset, and store the results in a variable.
Put the predicted values in a DataFrame.
Join the ytest and predicted data with the xtest data, save the joined data in a new DataFrame, and then display the first five rows of data.
Melt the actual and predicted price columns together, assigning appropriate values to the variable and value names.
Use a Seaborn line plot without a confidence interval to plot the predicted data.
Please upload your ipynb files
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
