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

  Statistics-probability assignment

MATH1550H: Assignment:  Question:  A word is selected at random from the following poem of Persian poet and mathematician Omar Khayyam (1048-1131), translated by English poet Edward Fitzgerald (1808-1883). Find the expected value of the length of th..

  What is the least number

MATH1550H: Assignment:  Question:     what is the least number of applicants that should be interviewed so as to have at least 50% chance of finding one such secretary?

  Determine the value of k

MATH1550H: Assignment:  Question:     Experience shows that X, the number of customers entering a post office during any period of time t, is a random variable the probability mass function of which is of the form

  What is the probability

MATH1550H: Assignment:Questions: (Genetics) What is the probability that at most two of the offspring are aa?

  Binomial distributions

MATH1550H: Assignment:  Questions:  Let’s assume the department of Mathematics of Trent University has 11 faculty members. For i = 0; 1; 2; 3; find pi, the probability that i of them were born on Canada Day using the binomial distributions.

  Caselet on mcdonald’s vs. burger king - waiting time

Caselet on McDonald’s vs. Burger King - Waiting time

  Generate descriptive statistics

Generate descriptive statistics. Create a stem-and-leaf plot of the data and box plot of the data.

  Sampling variability and standard error

Problems on Sampling Variability and Standard Error and Confidence Intervals

  Estimate the population mean

Estimate the population mean

  Conduct a marketing experiment

Conduct a marketing experiment in which students are to taste one of two different brands of soft drink

  Find out the probability

Find out the probability

  Linear programming models

LINEAR PROGRAMMING MODELS

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