python scikit
Budget: $10 – $30 CAD
Exercise 1: Linear Regression
Write an application using scikit-learn to train/test the real estate data. Use Linear Regression model. Use the dataset from UCI repository: https://archive.ics.uci.edu/ml/datasets/Real+estate+valuation+data+set.
The target in the dataset is “Y house price of unit area”. Also, determine the coefficient of determination (R2) of the model.
Exercise 2: Polynomial Regression
Write an application using scikit-learn to train/test the real estate data. Use Polynomial Regression model. The dataset is from California housing data: https://scikit-learn.org/stable/modules/generated/sklearn.datasets.fetch_california_housing.html. Use only the two features AveRooms and AveBedrms (out of the eight features). You should invoke the PolynomialFeatures constructor as PolynomialFeatures(degree=2, include_bias=False).
(To understand this way of calling the PolynomialFeatures constructor, the website https://realpython.com/linear-regression-in-python/#polynomial-regression-with-scikit-learn may be helpful.)
Also, determine the coefficient of determination (R2) of the model.
(Hint: X, y = fetch_california_housing(return_X_y=True, as_frame=True) can be used to return the feature data in X (in form of a DataFrame object) and target data in y. Check the type of y. If the type of y is found to be DataFrame, then convert the type of y to Series using the DataFrame method squeeze.)
Write an application using scikit-learn to train/test the real estate data. Use Linear Regression model. Use the dataset from UCI repository: https://archive.ics.uci.edu/ml/datasets/Real+estate+valuation+data+set.
The target in the dataset is “Y house price of unit area”. Also, determine the coefficient of determination (R2) of the model.
Exercise 2: Polynomial Regression
Write an application using scikit-learn to train/test the real estate data. Use Polynomial Regression model. The dataset is from California housing data: https://scikit-learn.org/stable/modules/generated/sklearn.datasets.fetch_california_housing.html. Use only the two features AveRooms and AveBedrms (out of the eight features). You should invoke the PolynomialFeatures constructor as PolynomialFeatures(degree=2, include_bias=False).
(To understand this way of calling the PolynomialFeatures constructor, the website https://realpython.com/linear-regression-in-python/#polynomial-regression-with-scikit-learn may be helpful.)
Also, determine the coefficient of determination (R2) of the model.
(Hint: X, y = fetch_california_housing(return_X_y=True, as_frame=True) can be used to return the feature data in X (in form of a DataFrame object) and target data in y. Check the type of y. If the type of y is found to be DataFrame, then convert the type of y to Series using the DataFrame method squeeze.)