APPLICATION OF SUPERVISED LEARNING
MACHINE LEARNINGHARD QUESTIONS
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
How to check missing values in categorical variables
|
df[categorical].isnull(). sum ()
|
|
df[categorical].isnull()
|
|
df[categorical]. sum ()
|
|
df[categorical].null(). sum ()
|
Explanation:
Detailed explanation-1: -The easiest way to check for missing values in a Pandas dataframe is via the isna() function. The isna() function returns a boolean (True or False) value if the Pandas column value is missing, so if you run df. isna() you’ll get back a dataframe showing you a load of boolean values.
Detailed explanation-2: -– Generally, replacing the missing values with the mean/median/mode is a crude way of treating missing values. Depending on the context, like if the variation is low or if the variable has low leverage over the response, such a rough approximation is acceptable and could give satisfactory results.
There is 1 question to complete.