Machine Learning Process

24 / 38

Select all the categorical variables


Titanic Dataset

The attributes have the following meaning:

  • Survived - that's the target, 0 means the passenger did not survive, while 1 means he/she survived.
  • Pclass - passenger class.
  • Name, Sex, Age - self-explanatory
  • SibSp - how many siblings & spouses of the passenger aboard the Titanic.
  • Parch - how many children & parents of the passenger aboard the Titanic.
  • Ticket - ticket id
  • Fare - the price paid (in pounds)
  • Cabin - passenger's cabin number
  • Embarked - where the passenger embarked the Titanic

Hint: You can ignore name, id and ticket# columns because these are just identifiers and don't offer value as a feature.


Note - Having trouble with the assessment engine? Follow the steps listed here


Please login to comment

27 Comments

I am not able to close this popup even manully, please work on this.

  Upvote    Share

Hi Kuldeep,

Sure. We will look into it.

  Upvote    Share

This error POP Up is blocking my view and not able to remove it

 

 1  Upvote    Share

Hi Arun,

We can understand the frustation it's causing. We are currently working on fixing it. Till then, you can close the pop-up manually.

 1  Upvote    Share

How is "Survived" a categorical variable ? 

  Upvote    Share

Hi Rajat,

Can you please explain what type of variable it should be?

  Upvote    Share

I am sucked , I tried all the knowledge of the book no one works . I listen again and again to the lecture, still having problem to select the correct answer. All the hints did not work. Any one to help with the correct anwser please.?

  Upvote    Share

Hi,

The answer and the hint is given below the question.

Thanks.

  Upvote    Share

I am not getting the answer, can anybody tell me correct answer.

  Upvote    Share

Hi,

The answer and the hint is given below the question.

Thanks.

  Upvote    Share

This comment has been removed.

I selected Survived and sex as categorical variables but it's throwing error.

  Upvote    Share

Hi,

Feel free to have a look at the hint/answer if you are stuck.

Thanks.

  Upvote    Share

Hi, Could you pls guide - how to identify a categorical variable. I am kind of confused in this case.

As per the guidelines: Any variable that is not quantitative in nature, generally falls under categorical variables. Think about it like this - if the variable represents different classes that the instances belong to, it most probably is a categorical variable.

That means in this case, categorical attributes would be: Pclass, sex, age, sibsb

Am I on the right track? or am I missing some attributes.

Thanks.

  Upvote    Share

Hi,

SibSp is the number of siblings, it has a numerical significance. Same goes for age. Categorical variables are those which are either alphabetical, or even if they are numerical the usual numerical operations are not valid for them.

Thanks.

 1  Upvote    Share

What do you mean by ;usual numerical operations .?

 

  Upvote    Share

I didn't understand this. 

As per content, Varialble cab be Numeric or 
Categorical. 

Now, as per instance value :: 

Pclass - is numeric like 3 , 1 

Survived is Numeric like 0,1

then why these are categorized as Categorical variable. I do understand that they can't be fraction.

 

Also, Embarked is alphabet as per instance value then why this option is not an answer. 

 

  Upvote    Share

Hi Kulwinder,

Here's a clear and professional response to their query:

Your question is great, and it touches on an important distinction between numeric and categorical variables! Let me clarify:

1. Categorical vs. Numeric Variables

A numeric variable represents a quantity and supports mathematical operations like addition or averaging. Examples: Age, Fare.

A categorical variable represents distinct groups or categories and often has a limited set of possible values. Examples: Gender (Male/Female), Embarked (C/Q/S).

2. Why is Pclass Categorical?

Although Pclass (Passenger Class) is represented with numbers (1, 2, 3), these numbers do not represent a continuous numerical value (like age or fare). Instead, they indicate categories (Class 1 = Upper, Class 2 = Middle, Class 3 = Lower).

You wouldn't calculate an "average Pclass" meaningfully, just like you wouldn't average shirt sizes (S, M, L).

3. Why is Survived Categorical?

Survived (0 = No, 1 = Yes) is also categorical because it represents two distinct groups (survived or not).

While it uses numbers, you wouldn’t perform numerical operations like "average survival" in the same way you would for continuous values.

4. Why is Embarked Not in the Answer?

You’re absolutely right that Embarked (C, Q, S) is categorical. However, it was likely not mentioned because the question focused on variables that might appear numeric but are actually categorical.

Since Embarked is obviously non-numeric (letters), there’s no confusion about its type.

Hope this clears it up! Let me know if you need further clarification. 

  Upvote    Share

what is the answer. What ever I am selecting ,is wrong

  Upvote    Share
Abhinav Singh

Hi Indranil,

You can try hint if you are stuck

  Upvote    Share

Hi Abhinav,

I tried but still not able to get the answer.
Guess some tech issue or something.. i tried the non quantitative variables. Please let me know the answer.

Thanks

  Upvote    Share
Abhinav Singh

I just check the question and answers are correct in the backend. Can you please drop an email to support?

It is not good to paste the answer here and kill the curiosity of other learners :)

  Upvote    Share

i did email to support. But no support yet !

  Upvote    Share

You can try now. I have tried to make it little more simpler.

  Upvote    Share

Need help on the above question, I had chosen Pclass, Survived, Sex, Age and Embarked. It seems to incorrect. Cant we choose multiple variables for category or even if i choose one lets say "Pclass" even then it does not accept. Either it should have an option on how many categories need to be chosen or a hint.

  Upvote    Share

Thanks for input, have added some hints that could help you get to the answer.
Also note - Age is not a categorical variable.

  Upvote    Share

Thanks a ton

  Upvote    Share