Can a categorical variable have 100 different levels?

Can a categorical variable have 100 different levels?

If we have HUGE amount of data (say 1 billion data points), a categorical variable that has 100 different levels may not be a problem. Since it is very likely that we have sufficient “training examples” on each level. However, the aforementioned example is less likely happen in real data.

Are there too many categorical variables in machine learning?

Closed 4 years ago. I have a machine learning problem where the dependent variable is binomial (Yes/No) and some of the independent variables are categorical (with more than 100 levels). I’m not sure whether dummy coding these categorical variables and then passing them to the machine learning model is a optimal solution.

How are the levels of a categorical predictor ordered?

Specifically, the solution orders the levels of the categorical predictor by the number of occurrence of each level in one class, and then treats the predictor as an ordered predictors. I wonder for models other than classification tree, such as linear regression, what would be proper ways of handling categorical predictors with too many levels.

Are there any real world examples of too many levels?

However, the aforementioned example is less likely happen in real data. In most real world data, the data has “80-20” rules, which means few levels will be very often, and most levels will not have sufficient data in. Then you may consider to combine them into “Other” category.

Why do we need categorical data in machine learning models?

All machine learning models are some kind of mathematical model that need numbers to work with. This is one of the primary reasons we need to pre-process the categorical data before we can feed it to machine learning models. Let’s consider following data set:

Why are there so many levels in machine learning?

Since it is very likely that we have sufficient “training examples” on each level. However, the aforementioned example is less likely happen in real data. In most real world data, the data has “80-20” rules, which means few levels will be very often, and most levels will not have sufficient data in.

Are there only two predictor covariates in Cox PH?

Coefficient or Covariate? Stat Question: I only have two predictor covariates for my cox ph model, and they are both categorical. They both violate assumptions of proportional hazards.

How can I create a Cox PH Model?

I want to create a cox ph model, using group (parasitized or unparasitized) and treatment (concentration). I eliminate one concentration (0) as there was no mortality.

What are techniques for collapsing many categories to a few?

What techniques are available for collapsing (or pooling) many categories to a few, for the purpose of using them as an input (predictor) in a statistical model? Consider a variable like college student major (discipline chosen by an undergraduate student). It is unordered and categorical, but it can potentially have dozens of distinct levels.

How can I reduce the number of levels for categorical?

When you include the three categories in your model, one of them, let’s say XL1 will be the baseline category with which the others will be compared. The model will give you coefficients and p-values for XL2 and XL3 that will tell you if each of these is significantly associated with the outcome.

What to consider when choosing a statistical test?

You also want to consider the nature of your dependent variable, namely whether it is an interval variable, ordinal or categorical variable, and whether it is normally distributed (see What is the difference between categorical, ordinal and interval variables? for more information on this).

How to choose the correct statistical test in SAS?

The table below covers a number of common analyses and helps you choose among them based on the number of dependent variables (sometimes referred to as outcome variables), the nature of your independent variables (sometimes referred to as predictors).