Question: Step 2. It is this new dataframe df2 that we want to use for machine learning. For each country in the dataset, we have a

Step 2. It is this new dataframe df2 that we want to use for machine learning. For each country in the dataset, we have a set of mean numerical values ('Happiness', 'Positive', 'Negative', etc., which are all listed in the variable key_vars defined above) and a categorical value ('region'). We would like to know if the raw numerical data are predictive of the region. In other words, if someone gave you a set of numerical data on Happiness, etc. for an unknown country, would you be able to predict what region of the world it might be located in? This is an example of classification, where we will train a model based on the numerical data and the associated labels (regions). In order to proceed, we first want to extract and process some data from our df2 dataframe. We need to separate the data into two parts: the region data that we want to be able to predict (we'll call it y) the WHR numerical data that we want to use as input to our prediction (we'll call it x) Again, our goal is to build a classifier that we will train on a subset of the WHR numerical data

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!