Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 4 (12 pts). Assume that you are provided with two 2D arrays, X_num and X_cat, whose contents are as shown below. The array x_num

image text in transcribed

Problem 4 (12 pts). Assume that you are provided with two 2D arrays, X_num and X_cat, whose contents are as shown below. The array x_num contains the values for a single numerical (quantitative) feature, while X_cat contains the values for two categorical (qualitative) features. The feature arrays are preprocessed and combined into a single array by running the code below. Provide the contents of the array X_preprocessed by completing the table on the right. You may not need all of the columns provided. If not, leave any extra columns blank. from sklearn.preprocessing import PolynomialFeatures, OneHotEncoder poly= PolynomialFeatures(3) Xp poly.fit_transform(X_num) enc=OneHotEncoder(sparse=False) Xe= enc.fit_transform(X_cat) X_preprocessed | np.hstack((Xp, Xe)) X num X cat X_preprocessed 1 e 2 a a -3 b u 4 b a -1 a u Problem 4 (12 pts). Assume that you are provided with two 2D arrays, X_num and X_cat, whose contents are as shown below. The array x_num contains the values for a single numerical (quantitative) feature, while X_cat contains the values for two categorical (qualitative) features. The feature arrays are preprocessed and combined into a single array by running the code below. Provide the contents of the array X_preprocessed by completing the table on the right. You may not need all of the columns provided. If not, leave any extra columns blank. from sklearn.preprocessing import PolynomialFeatures, OneHotEncoder poly= PolynomialFeatures(3) Xp poly.fit_transform(X_num) enc=OneHotEncoder(sparse=False) Xe= enc.fit_transform(X_cat) X_preprocessed | np.hstack((Xp, Xe)) X num X cat X_preprocessed 1 e 2 a a -3 b u 4 b a -1 a u

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Databases A Tour

Authors: Shashi Shekhar, Sanjay Chawla

1st Edition

0130174807, 978-0130174802

More Books

Students also viewed these Databases questions

Question

1. Evaluate the training program in which Benno was enrolled.

Answered: 1 week ago

Question

What are Electrophoresis?

Answered: 1 week ago

Question

=+j Describe an effective crisis management program.

Answered: 1 week ago