Perform a PolynomialFeatures transformation

Assignment Help Basic Statistics
Reference no: EM133189705

Assignment - Polynomial Regression I

Details - The purpose of this assignment is expose you to a polynomial regression problem. Your goal is to:

1. Create the following figure using matplotlib, which plots the data from the file called PolynomialRegressionData_I.csv. This figure is generated using the same code that you developed in Assignment 3 of Module 2 - you should reuse that same code.

2. Perform a PolynomialFeatures transformation, then perform linear regression to calculate the optimal ordinary least squares regression model parameters.

3. Recreate the first figure by adding the best fit curve to all subplots.

4. Infer the true model parameters.

Below is the first figure you must emulate:

Below is the second figure you must emulate:

Each of the two figures has four subplots. Note the various viewing angles that each subplot presents - you can achieve this with the view_init() method. Use the same color scheme for the datapoints shown here, which is called jet. Be sure to label your axes as shown.

Create First Image - Use the scatter3D to plot in three dimensions. Create four subplots with the appropriate viewing angles using the view_init() function.

Perform Polynomial Features Transformation - Perform a polynomial transformation on your features.

Train Linear Regression Model - From the sklearn.linear_model library, import the LinearRegression class. Instantiate an object of this class called model, and fit it to the data. x and y will be your training data and z will be your response. Print the optimal model parameters to the screen by completing the following print() statements.

Create Second Image - Use the following x_fit and y_fit data to compute z_fit by invoking the model's predict() method. This will allow you to plot the line of best fit that is predicted by the model.

Infer the True Model Parameters - Provided that the true model parameters are integer values, you are able to infer the true model parameters by rounding the coefficients and the intercept to the nearest integer value. You may "hard-code" these values into the below print statements. (See the assignment 3 template for more information)

Use the get_feature_names() (this has been deprecated -- depending on your version of sklearn, you may need to use get_feature_names_out()) method of the PolynomialFeatures class to be certain of which coefficients you calculated! You need to report your final answers in a format that is abundantly clear to me which which coefficient corresponds to which dependent variable of the model! You may add more print() statements to accomplish this if you must.

Attachment:- Assignment File - Polynomial Regression.rar

Reference no: EM133189705

Questions Cloud

Perform the horizontal, vertical and financial ratios : Perform the horizontal, vertical and financial ratios and analysis. Based on the results, identify the weaknesses and strengths of the company
What is the conversion cost per equivalent unit in june : Timekeeper Inc. manufactures clocks on a highly automated assembly line. What is the conversion cost per equivalent unit in June
What do you know about your chosen lga : Are there public health issues within that LGA? Does your LGA have storm water guttering for rainwater runoff? Is the LGA on septic tank systems
How much is the interest expense for the year : Annual rental payable in advance on December 31 of each year P70,000. How much is the interest expense for the year 2021
Perform a PolynomialFeatures transformation : Perform a PolynomialFeatures transformation, then perform linear regression to calculate the optimal ordinary least squares regression model parameters
Create a spreadsheet that automatically calculates grade : MGMT 650 Assignment - Create a spreadsheet that automatically calculates your grade in this class as you enter the grades that you receive
Prepare an end user instruction : Compute-task must implement the Task interface. Executing the executeTask() method will perform the task and set the result
What is purpose of the australian guide to healthy eating : What is the purpose of the Australian Guide to Healthy Eating - List 5 alternatives for salt which can be used during preparation and cooking of foods
MTH 230 Probability and Statistics Assignment : MTH 230 Probability and Statistics Assignment - Estimation and Hypothesis Tests-One Population- What sample size is necessary to ensure an interval width

Reviews

Write a Review

Basic Statistics Questions & Answers

  What quantity would it produce

If the firm could perfectly price-discriminate, and each unit of output were infinitely divisible, what quantity would it produce and what would its profit

  Independent bernoulli random variables

Hi, the problem is this. Pls choose only one to answer thanks Let X1, X2,..., Xn, be independent Bernoulli random variables with P[Xi = 0] = 1- p, p = 1, 2,...,n. Prove that  is sufficient for p. Let X1 & X2 be Poisson random variables with. Prove th..

  Values of probability on discrete distribution

A bookcase contains 3 statistics books and 4 biology books. If 2 books are chosen at random, find the chance that both are statistics books.

  Would you be able to make a better prediction by knowing

Which do you think has a stronger relationship with value of the property-the number of square feet in the home or the number of fireplaces in the home.

  What is the probability of at least one spade being

From an ordinary deck of 52 cards, 10 cards are drawn at random. If exactly four of them are hearts, what is the probability of at least one spade being among t

  Determine the expected number of acceptances

Determine the expected number of acceptances for the next 7 applicants and the standard deviation.

  What is the probability you picked bag i

This time, you pick a Bag at random, each of the two Bags being picked with probability ½, and you pick an object at random from the chosen Bag. Given the ball is black, what is the probability you picked Bag I?

  Find the probability that at least one of them has brown eye

If 87 % of people have brown eyes and 4 people selected at random, find the probability that at least one of them has brown eyes

  Think of some bad examples

Give two examples of situations where there are two possible outcomes, as in the coin-tossing model, but the model is not appropriate.

  Develop a scatter diagram with price as independent variable

Develop a scatter diagram with price as the independent variable and what does the scatter diagram developed in part (a) indicate about the relationship between the two variables?

  Satisfies the three properties of the gale shapley algorithm

Prove that this algorithm satisfies the three properties of the Gale-Shapley algorithm.- Prove that this algorithm terminates, and that it always yields a stable matching.

  Describe the scale of measurement of each variable

An individual federal tax return form asks, among other things, for the following information: income (in dollars and cents), number of dependents.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd