These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.# Importing required packages
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error
from sklearn.metrics import r2_score
# This class contains various methods performing
# - Reading data from file.
# - Printing summary of the data
# - Plotting data
# - Fitting linear regression to predict house price of a county
# Default constructor of the class,
# it calls read_data method to get data from excel.
# This method reads excel file, and stores the data in the instance variable.
self.data = pd.read_excel("2019-MedianPricesofExistingDetachedHomesHistoricalData.xlsx",
# This method displays the summary of the data
print("Data is not available")
# This method takes x, y, and predicted data as the required features,
# and plots the scatter plot and fitted line on the plot.
def plot_data(self, x_data, y_data, pred, xlab="CA", ylab="Alameda"):
By purchasing this solution you'll be able to access the following files:
Solution.xlsx, Solution.docx and Solution.py.