Question: 5.8 LAB: Structuring data using scale() and MinMaxScaler() The hmeq_small dataset contains information on 5960 home equity loans, including 7 features on the characteristics


5.8 LAB: Structuring data using scale() and MinMaxScaler() The hmeq_small dataset contains information on 5960 home equity loans, including 7 features on the characteristics of the loan. Load the hmeq_small.csv data set as a data frame. Standardize the data set as a new data frame. Normalize the data set as a new data frame. Print the means and standard deviations of both the standardized and normalized data. Ex: Using the first 100 rows, found in hmeq_sample.csv, the output is: The means of hmeqStand are LOAN MORT DUE 1.914178e-17 VALUE -1.790682e-18 YOJ -7.235161e-17 CLAGE -4.194176e-17 CLNO -6.033821e-17 6.125368e-17 DEBTINC dtype: float 64 The standard deviations of hmeqStand are LOAN MORT DUE VALUE YOJ CLAGE CLNO MORTDUE VALUE YOJ CLAGE CLNO 1.005797 1.005420 1.005666 DEBTINC dtype: float 64 The means of hmeqNorm are LOAN 1.005602 1.005479 1.017700 MORTDUE VALUE 0.358735 0.299044 0.292135 0.448986 0.346377 0.624927 -4.984675e-17 DEBTINC dtype: float 64 The standard deviations of hmeqNorm are LOAN 0.247183 0.187587 0.671006 1.005141 0.269531 MORTDUE VALUE YOJ CLAGE CLNO DEBTINC dtype: float 64 The standard deviations of hmeqNorm are LOAN MORT DUE VALUE YOJ CLAGE CLNO 0.358735 0.299044 0.292135 0.448986 0.346377 0.624927 511224.3550566.qx3zqy7 DEBTINC dtype: float 64 LAB ACTIVITY 0.247183 0.187587 0.237945 0.226345 0.188681 0.222946 5.8.1: Structuring data using scale() and MinMaxScaler() 1 import pandas as pd 2 from sklearn import preprocessing 3 4 hmeq = # Read in the file hmeq_small.csv 5 6 # Standardize the data 7 standardized = # Your code here 8 9 # Output the standardized data as a data frame 10 hmeqStand = # Your code here 11 12 # Normalize the data 13 normalized = # Your code here 14 15 # Output the normalized data as a data frame 16 hmeqNorm = # Your code here 0.269531 Develop mode Submit mode main.py 17 18 # Print the means and standard deviations of hmeqstand and hmeqNorm 19 print("The means of hmeqStand are ", # Your code here) 0/1 Load default template... Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box. DEBTINC dtype: float 64 The standard deviations of hmeqNorm are LOAN MORTDUE VALUE YOJ CLAGE CLNO 0.624927 511224.3550566.qx3zqy7 DEBTINC dtype: float 64 LAB ACTIVITY 0.247183 0.187587 0.237945 0.226345 0.188681 0.222946 5.8.1: Structuring data using scale() and MinMaxScaler() 4 hmeq = # Read in the file hmeq_small.csv 5 6 # Standardize the data 7 standardized = # Your code here 8 9 # Output the standardized data as a data frame 10 hmeqStand = # Your code here 11 12 # Normalize the data 13 normalized = # Your code here 14 15 # Output the normalized data as a data frame 16 hmeqNorm = # Your code here Develop mode 17 18 # Print the means and standard deviations of hmeqstand and hmeqNorm 19 print("The means of hmeqStand are ", # Your code here) 20 print("The standard deviations of hmeqStand are ", # Your code here) 21 print("The means of hmeqNorm are " # Your code here) 22 print("The standard deviations of hmeqNorm are ", # Your code here) Submit mode 0.269531 main.py Enter program input (optional) If your code requires input values, provide them here. 0/1 Load default template... Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box.
Step by Step Solution
There are 3 Steps involved in it
I will write the full code filling in all the missing parts After the explanation Ill also show you what the expected output should look like based on ... View full answer
Get step-by-step solutions from verified subject matter experts
