Questions tagged [categorical-encoding]

Representing categorical variables as sets of numerical variables. Necessary in many types of analysis for them to process categorical data. A common example is using a categorical predictor in regression/ANOVA via dummy coding, effect coding, Helmert coding, user-defined contrasts, etc.

Filter by
Sorted by
Tagged with
0
votes
0answers
3 views

Association/difference of checkbox data (when there is one value and not binary) with ordinal data?

I have data from SurveyMonkey for some checkbox (multiple answers) questions. The data are not in binary, basically, they have been coded as 1 only. Sof if a user ticked a box, there is 1 and if not ...
0
votes
0answers
10 views

Machine Learning Pipeline and remove weak correlated variables [on hold]

I am very new to machine learning and I am trying to understand the whole process of preparing the data for the machine learning part. I am making use of pipeline from sklearn. Lets say I have the ...
0
votes
0answers
12 views

Generating maps from sprite indexes as one hot vectors

Goal: Use a Autoencoder to allow me generate new maps from the set of sprites from old game boy games. Old games tended to be made out of sprite/tile maps. So you can cut up their maps into 16x16 ...
0
votes
1answer
26 views

Term for the non-reference category for a dummy variable

For a dummy variable, what is a non-reference category called? Is there a general term for these categories other than non-reference categories?
0
votes
0answers
30 views

GLM Logistic regression in R: one category is significant, but others are not. Should I drop the variable? [duplicate]

so I am using GLM for logistic regression in R and I have some variables with many factors. I ran the model and has the result like this: My question is: 1. Is this variable significant? ...
0
votes
0answers
15 views

Vector Auto Regression handling dummy encoded variables

Firstly, apologies if this question is obvious, I am new to Time Series Forecasting & ML in general. I have an application whereby I collect prices from betting exchanges on an interval. This ...
1
vote
0answers
16 views

Logic of forward or backward difference coding

Two systems of contrast coding for ordinal data are forward difference coding and backward difference coding. I will focus on the latter system here because it seems to be more commonly used, but my ...
0
votes
1answer
26 views

Should I treat variables representing level of disease risk as ordinal?

I'm working with a study where we have collected the subjects' genotypes for risk factors for a disease. These can be homozygous non-risk (e.g. AA), homozygous risk (e.g. TT) or heterozygous (e.g. AT) ...
0
votes
1answer
34 views

Gaussian processes with categorical input

Is there a standard way of applying Gaussian processes to regression problems with categorical input? Are they standard kernels that one should apply to this problem?
2
votes
1answer
50 views

What are appropriate methods for preparing categorical features for recurrent networks to ensure efficient backpropagation?

Given a 1D sequential categorical input variable, e.g. [rainy, sunny, rainy, cloudy, cloudy], with a small domain {rain, sunny, cloudy}, what encoding methods (e.g. one-hot, dummy, binary) and what ...
0
votes
0answers
16 views

Ordinal multinomial logistic regression on one-hot encoded data

I have a task I am unable to tackle by principle. I'm working on survey data for one of our clients such that my design matrix is made of one-hot vectors with 15 features (originally 3 variables with ...
0
votes
0answers
6 views

encoding the true labels of radial basis neural network for binary classsification

I am working on a binary classification problem (my class labels are 1 or 0) and I have three layers (input, hidden, output) radial basis neural network. I put two neurons, one per class, in the ...
0
votes
1answer
18 views

One-hot encoding for duplicate words

I'm currently studying NLP and was practicing one-hot encoding for sentences at the word level. My question is, if we have multiple examples of the same word in a sentence, does one-hot encoding ...
0
votes
0answers
23 views

Interpretation of Marginal Effects for Dummy Variable (using mfx package in R)

So, I calculated a negative binomial regression model and I am trying to estimate the mean marginal effects in R. To do this, I used the mfx package and wrote the ...
1
vote
0answers
40 views

Does the isolation forest care about integer-encoded categorical variables?

The isolation forest (initial paper, follow-up paper) as well as the proposed extended isolation forest (paper) seem like very appealing unsupervised anomaly detection techniques. However, the ...
0
votes
1answer
14 views

How to encode categorical variables in a video game predictive model

I'd like to make a model to predict the result of a match in a video game (win or loss). The game is 3 players against 3 players, and each player has a specific character with specific ...
1
vote
1answer
85 views

Which ML Algorithms are affected by dummy variable trap?

My understanding is that regression models are affected by the dummy variable trap. What about other machine learning algorithms e.g. linear svm, logistic regression? Also, if an algorithm is not ...
3
votes
1answer
32 views

Can I remove a dummy variable when it is not significant by itself, but its interaction with another variable is?

I have the following model based on the financial returns of a company as a dependent variable of a stock market index, and a dummy variable interacting with USD exchange rates to my currency. The ...
0
votes
0answers
9 views

Basic question about dummy variables for breakpoint treatment

I am studying basic Econometrics and trying to understand how to deal with breakpoints using dummy variables. I found 3 significant break-points in my data (using 5% confidence) with the Chow ...
2
votes
1answer
103 views

Clear explanation of dummy variable trap [duplicate]

I have a confusion in multiple regression about dummy variable trap, so far I had seen tutorials explaining about dummy variable trap and multicollinearity but I'm unable to understand it fully.
2
votes
3answers
197 views

Standardizing dummy variable in multiple linear regression?

I have a multiple linear regression model with several independent variables in different units. Because some of my data is negative, I am unable to take the log and therefore am standardizing the ...
0
votes
0answers
11 views

Are predictions from an OLS model that only contains categorical covariates biased, if the mean of the residuals does not equal zero?

I understand that the mean of the residuals being zero is a requirement for an OLS model. I also know that when you include the intercept in a regression model, it forces the mean of the residuals to ...
0
votes
1answer
17 views

Using one-hot encoded features along with continuous-valued features?

The task I wanted to do is a prediction task where most of the features are continuous numbers and some of the features are one-hot encoded. I am training a neural network and I wondered that, is it ...
0
votes
0answers
72 views

What's the effect of using TF-IDF encoded instead of one-hot encoded categorical data as input to a neural network?

As input into a simple neural network multi-class classifier, I am considering using a variation of the standard one-hot sparse matrix to represent categorical variables. Instead of each element ...
2
votes
2answers
27 views

Linear model with binary variable VS create two linear models

Let's say, there is a variable sex in the data set. I could either: Build one model on the whole data and encode the sex into <...
4
votes
1answer
68 views

Problems from having too many interactions in a regression?

Excluding the 'dummy variable trap', are the problems from including too many interaction terms in a regression any different from the problems of including too many continuous or binary variables in ...
2
votes
1answer
53 views

Is it a good practice to drop rare categorical data?

I have a dataset with about 100K samples described mostly by categorical features. The number of unique values in the categories range from 20 to almost 7000. Since these are categorical values and ...
0
votes
1answer
42 views

Should I convert a target variable with StandardScaler?

For a multiple linear regression model, I have done two things to preprocess my data: I have scaled continuous variables with StandardScaler I have encoded categorical variables with OneHotEncoder ...
1
vote
1answer
318 views

Encoding of categorical variables with high cardinality

For unsupervised anomaly detection / fraud analytics on credit card data (where I don't have labeled fraudulent cases), there are a lot of variables to consider. The data is of mixed type with ...
0
votes
1answer
21 views

Dummy coding, ranking of categorical variables

I need to rank categorical variables (top 5 reasons for staying married, top five reasons for divorce). I need to find a method for dummy coding these variables, and then ranking/weighting them (for ...
0
votes
0answers
54 views

Should we penalize dummy variables? [duplicate]

Using glmnet we run the following regression cvfit = cv.glmnet(x,y, alpha = 0, intercept = FALSE) where $y$ is the response variable and $x$ is the input matrix....
1
vote
3answers
66 views

How many dummy variables should we include in our multiple linear regression analysis?

I am building a multiple linear regression model and wonder how many dummy variables can be included. I have 2 categorical variables: 1 with 13 levels and the second with 20 levels. Can I include ...
1
vote
2answers
103 views

How to calculate Helmert Coding

I am trying to understand how Helmert Coding works I know it compares levels of a variable with the mean of the subsequent levels of the variable, but what are these levels and how can I calculate ...
2
votes
1answer
32 views

Label encoding vs Dummy variable/one hot encoding - correctness?

i understand that when label encoding is used, the numeric number can be interpreted to have an order and a model could assume a linear relationship. However shouldn't this be a problem when there are ...
0
votes
0answers
20 views

Collinearity when regressing against three sets of dummies

I would like to regress price of food products against three sets of dummy variables: 1. the food product itself (13 products) 2. the country where the food product was priced (119 countries) 3. the ...
0
votes
0answers
48 views

How to interpret coefficients obtained from an ordinal variable in a linear regression?

I'm following this example https://stats.idre.ucla.edu/r/library/r-library-contrast-coding-systems-for-categorical-variables/ I was wondering what is the correct interpretation of the coefficients ...
0
votes
0answers
8 views

Categorical control variables PROCESS

At the moment I want to perform a mediated regression analysis using PROCESS. My Independent value (IV), Dependent value (DV) and Mediator (M) are all numerical data. I analyze a simple mediation and ...
0
votes
1answer
28 views

Interpreting dummy variable interaction terms

I am attempting to model monthly retail electricity sales. To account for both the effects of seasonality and weather, I created an interaction term by multiplying 12 monthly dummy variables by the ...
1
vote
1answer
33 views

Inputting playing card values to aneural network

I am trying to create a NN to play a card game wherein each state is represented by the hands of 4 players. Every round, the hand of each player is decreased by 1 (discarded). Each player starts with ...
0
votes
0answers
29 views

What does the intercept represent in a model matrix?

I am making a KNN algorithm to predict close_price with about 80,000 rows of this data. ...
1
vote
1answer
27 views

Dummy code interaction among categorical variables [on hold]

Do you know if there is a way of dummy coding the interactions among three independent categorical variables using SPSS? (with two levels each)
3
votes
1answer
77 views

Is it valid to have all zeroes in a One-Hot Encoded categorical feature?

I'm building an MLP classification model and one of my features is the name of certain products. These names can be anything and in theory there could be an infinite number of different names in the ...
1
vote
1answer
96 views

How to calculate the coefficient of a dummy variable reference category?

I am currently building a regression model with numerous continuous, categorical (employing dummies) and interaction variables. I understand we must use k-1 dummies with one variable becoming the ...
0
votes
0answers
30 views

Condensing values of categorical data

Beginner ML question here. I have a dataframe with a categorical column, a lot of the values are slightly different but essentially mean the same thing. Here's an example of such values: ...
0
votes
1answer
55 views

Replacing CNNs with Random Forests

Suppose I have a sequence like "ADTGESW". Each character in this sequence can attain a number of possible values, let's say 10. I can then one-hot encode this sequence and obtain a matrix with shape ...
0
votes
1answer
38 views

For Matching on a categorical variable with N categories, will it suffice to create (N-1) binary features and match on them?

I have data on patients who received different amounts of Occupational therapy (High Dose vs Low Dose) after a stroke. We are investigating if there are differences in recovery between patients from ...
0
votes
0answers
18 views

Multiple linear regression with dependent as a dummy predictor

I have a model $Y = \alpha + \beta_1X_1 + \beta_2X_2$. $Y$ has a bimodal normal(ish) distribution, so I'm looking to see if the relationship between the predictors and the response is different for ...
0
votes
1answer
28 views

Do we need a reference dummy variable for non-mutually exclusive groups?

I am trying to build a GLMM and have converted a group of factors to dummy variables. Many have multiple groups and I would like to test the interactions between them as well. Do I need a reference ...