Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python code for the comments steps in part 1 and 2 thank you!!! Remember in part 1 we bnned wins (df [] ) to a

image text in transcribedimage text in transcribed

python code for the comments steps in part 1 and 2 thank you!!!

Remember in part 1 we bnned wins (df [] ) to a categorcal varable - that was tor making the analyss a classitcation problem. Sometmes we also using binning for dimensionality reduction purposes. For instance, the feature year (df [ 'yearID' ] ) has more than 100 distinct values, so its dimensionality will be 100+. A lot of machine learning algorithms do not like high-dimensional features, so it is a common practice to bin high-dimensional features. Rule of thumb: if a categorical feature has more than 5 categories, you should consider bin it. In the block below, you are going to create your own function (assign_label) and apply it to your data ( df ). When a categorical variable is low-dimensional, we shoud create dummy variables for that. pandas provides a function called get_dummies ( ) for that. [18] 1 \# define the "assign_label" function An alternative way of binning the yearID feature is to bin it by decade, then create dummy variables based on dacades. This can be done using following code

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions