Contents
Can logistic regression handle categorical variables?
Similar to linear regression models, logistic regression models can accommodate continuous and/or categorical explanatory variables as well as interaction terms to investigate potential combined effects of the explanatory variables (see our recent blog on Key Driver Analysis for more information).
Can regression be done with categorical variables?
Categorical variables require special attention in regression analysis because, unlike dichotomous or continuous variables, they cannot by entered into the regression equation just as they are. Instead, they need to be recoded into a series of variables which can then be entered into the regression model.
What is cardinality of categorical variables?
In the context of machine learning, “cardinality” refers to the number of possible values that a feature can assume. For example, the variable “US State” is one that has 50 possible values.
Which is an example of a variable with high cardinality?
For categorical variables , the number of possible splits grows non linearly with cardinality. If we are splitting the categorical values into 2 sub sets for example, it has to consider all possible such pair of sub sets. Zip code is a good example of categorical variable with very high cardinality.
How does high cardinality affect machine learning algorithms?
High Cardinality Categorical Variables Even if the Machine Learning algorithms is tolerant of categorical variables, e.g., Decision Tree, high cardinality could be taxing in terms of computing resources. Decision tree splits the feature space into sub spaces such that data population in the sub spaces is as homogeneous as possible.
Which is an example of a categorical variable?
Zip code is a good example of categorical variable with very high cardinality. Generating numerical dummy variables, as alluded to earlier, is not practical when the the cardinality is high. With significant increase in number of dimensions, you will be impacted by so called curse of dimensionality.
Why is the product ID variable high cardinality?
The product Id variable has high cardinality, because there may be several hundred electronic components. We will convert this attribute values to numerical using the encoding algorithms alluded to earlier. This conversion is necessary for the training data set before building the machine learning predictive model.