4
$\begingroup$

Lets say I am classifying if a user will like a Airbnb listing or not (binary classification model)

I have 2 features:

  1. Number of house rules the Airbnb host has. Since this is a count, this is a discrete (categorical) variable. We will store this as an int because it is ordered (10 house rules is greater than 9 house rules).
  2. Price of the Airbnb listing, rounded to the nearest whole dollar. This is clearly a continuous variable. It is also stored as an int.

If I'm not missing anything, do I need to specify anything myself to the machine learning model (let's say logistic regression since XGBoost classifier probably auto handles this) to distinguish between the discrete and continuous int? Or is there nothing to worry about here and it will automatically be handled for me?

$\endgroup$
0

1 Answer 1

10
$\begingroup$

Discrete $\ne$ Categorical

The number of house rules is a numerical variable. You might find value in having individual indicator variables for each house rule, each of which would be categorical, but the count of house rules is every bit as numerical as the price.

Your software does not need to distinguish between these and should run fine.

Also, I contest that your price variable is continuous when it is rounded to the nearest full dollar. Both variables seem to be counts (number of house rules or number of dollars paid).

$\endgroup$
2
  • $\begingroup$ Gotcha. So what would you call a Count variable? Sounds like either discrete or numerical, not categorical? $\endgroup$
    – Katsu
    Commented Apr 26, 2023 at 18:45
  • 6
    $\begingroup$ Counts are discrete and numerical variables. $\endgroup$
    – Dave
    Commented Apr 26, 2023 at 18:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.