Questions tagged [categorical-encoding]

The tag has no usage guidance.

25 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
37 views

What is the concept behind the categorical-encoding used in the CatBoost benchmark problems?

I'm working through CatBoost quality benchmark problems (here). I'm particularly intrigued by the methodology adopted to convert categorical features to numerical values as described in the ...
2
votes
0answers
188 views

Multi-valued categorical features in LIME

I am working with the LIME implementation by Marco Ribeiro (https://github.com/marcotcr/lime). Specifically, I am utilizing the LimeTabularExplainer as I have a mixture of numerical and categorical ...
1
vote
0answers
31 views

kNN for non-ordinal variables

kNN is a distance-based method, so it requires the input to be in numerical form. I was wondering if it is possible to use kNN imputer for non-ordinal categorical variables (like color). Since the ...
1
vote
1answer
67 views

Should one-hot encoded categorical features needs to be scaled when used along with text feature while deriving semantic similarity?

My aim is to derive textual similarity using multiple features. Some of the features are textual for which I am using (Tfhub 2.0) Universal Sentence encoder. There are other categorical features which ...
1
vote
0answers
89 views

Cat2Vec implementation X = categorical and y = categorical

I am trying to convert categorical values (zipcodes) with Cat2Vec into a matrix which can be used as an input shape for categorical prediction of a target with binary values. After reading several ...
1
vote
1answer
51 views

One-hot & interaction one-hot on multiple categorical

I was wondering if there is any value to creating combined features out of multiple categorical variables when the individual categorical variables are already one-hot encoded? Simple example: there ...
1
vote
0answers
112 views

Implementing Scikit Learn's FeatureHasher for High Cardinality Categorical Data

Background: I am working on a binary classification of health insurance claims. The data I am working with has approximately 1 million rows and a mix of numeric features and categorical features (all ...
1
vote
1answer
70 views

How to do target encoding when data has repeated rows?

How can I do encoding for a category when data has repeated rows? Can I do target encoding? Or Is there another encoding I can use? I want to figure how to include a categorical variable in a model ...
1
vote
0answers
80 views

Intuition of Categorical Encoding with Helmert Coding and James-Stein Encoder

I was going through the coding categorical variables documents/articles and came across the following things: Helmert Coding James-Stein Encoder I am really having trouble understanding these ...
0
votes
0answers
16 views

Embedding a categorical variable and concatenating with a numerical variable, in a many-to-one sequence problem with multiple features

I have a small data set where I track 4 variables across 4 time periods, 1 categorical and 1 numerical variable. Below is picture of data set that I am using: cat1 - Categorical variable encoded num1 ...
0
votes
0answers
14 views

k-1 vs. k categories for categorical features in decision trees

I have a model with only categorical features. The outcome is binary. I am training binary classifiers. Most of them are coded already as 0/1 . Some have increased cardinality (ie 4 categories). For ...
0
votes
0answers
11 views

How to convert the categorical features into one-hot encoded dense vectors before applying the min-max scaler of sklearn?

like the question says I am trying to figure out how to convert one-hot encoded vectors into dense vectors, because my data-set contains both continuous and categorical features, I used the ...
0
votes
0answers
27 views

Tensorflow - I don't get the right shapes - `ValueError: Shapes (9, 1) and (8, 9) are incompatible`

I want to train a Sequential Neural Net (NN) with Tensorflow. ...
0
votes
0answers
25 views

How to make a Label Encoder trained on a training dataset transform an unseen value of a test dataset?

During the data preprocessing stage, I decided to apply the Label Encoding on one of the columns because it contained data points in string format. Suppose the column contains the following distinct ...
0
votes
0answers
23 views

What's the best method to merge N categorical features into one and keep it as categorical

I'm training a Transformer model and it requires one input sentence and N optional labels, not classes cause it's a multi-label and multi-class problem so the unique classes turned into labels. I have ...
0
votes
0answers
17 views

Normalization of encoded feature?

I am a beginner in ML, and I am working on a classification problem on big data (its shape is (8921483, 52)) which its features are mostly categorical. One of the features has 175365 different ...
0
votes
0answers
30 views

Which is the best way to select categorical features with Autoencoders in Python?

I have a dataset containing both categorical and numerical features. I am trying to work with Autoencoders for feature selection, so the first thing I do is to normalise the numerical features. For ...
0
votes
1answer
25 views

Handling encoding of a dataset which has more than total 2000 columns

Whenever we have a dataset to be pre processed, before feeding it to the model we convert the categorical values to numerical values for which we generally use LabelEncoding, One Hot encoding etc ...
0
votes
0answers
21 views

Collapse categorical variable to reduce levels using a decision tree

I am using zip codes as an independent variable as part of a binary classification problem. Naturally, this feature has many different levels (around 2,000), so I was wondering if there is a ...
0
votes
0answers
19 views

tensorflow-embedding-feature-column-with-value

Using this TF tutorial, Classify structured data with feature columns, I was interested in this Embedding columns feature. ...
0
votes
0answers
25 views

Correlation between features in python

I have a dataset which has categorical variables as features. They are nominal in nature. One of the variable has 312 categories. I want to check how correlated the variables are, to check ...
0
votes
0answers
8 views

Predict values if will be above a threshold (so bottomline behaviour)

this time I am not asking help with coding but on the concept level. I have trained a classifier (RF but this is not important) that provide goods accuracy (around 90%)
0
votes
0answers
38 views

Autoencoder to encode features/categories of data

My question is regarding the use of autoencoders (in PyTorch). I have a tabular dataset with a categorical feature that has 10 different categories. Names of these categories are quite different - ...
0
votes
0answers
13 views

Best Practices for Boosting, Trees, Random Forests re. Number of classes in a feature and number of samples per class

I'm doing a regression to predict house prices using multiple algorithms and the h2o platform. In particular, I'm using a variety of GBM, DRF, and GLMs. I have a large amount of data from several ...
0
votes
1answer
58 views

What to do if a specific label of a category appears only a few times?

Let's say I am trying to predict whether a car will be auctioned or not (not what I'm actually trying to do, but it represents it pretty well) using tabular data. I have the year the car was made, its ...