Skip to main content

Questions tagged [encoding]

Encoding in machine learning and data science refers to the process by which non-numeric data is transformed into a numeric representation that can be fed into machine learning algorithms.

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

Why is positional encoding preferable over adding additional features for transformer models?

Why is information about the position not added as an additional feature? I read in forums that the only reason would be length-based overfitting, but I couldn't find a reliable source for that. What ...
kot's user avatar
  • 11
0 votes
1 answer
11 views

issue with data sample

...
lyel's user avatar
  • 1
0 votes
0 answers
16 views

What is the advantage of positional encoding over using additional features?

Popular models such as the transformer model use positional encoding on existing feature dimensions. Why is this preferred over adding more features to the feature dimension of the tensor which can ...
kot's user avatar
  • 11
0 votes
1 answer
23 views

Dealing with only categorical features dataset

I'm trying to do multi-class classification on a labeled dataset with purely categorical features. There are around 30 features in total. 3 of the features in particular have around 100 unique values (...
Shaurya Uniyal's user avatar
0 votes
0 answers
7 views

Strategies for Encoding Large Datasets in Symbolic Music Generation for BERT-type Model

I am creating a BERT-type model for symbolic music generation. An observation of my database is a musical piece. Actually, is a "viewpoint" of the piece: ...
Kikolo's user avatar
  • 101
0 votes
2 answers
298 views

Handling categorical variables for Xgboost?

Currently there seems to be two approaches for handling categorical variables in gbdts: Xgboost as an option, but data need to be encoded properly (integers) Catboost can handle everything provided ...
Lucas Morin's user avatar
  • 2,196
0 votes
0 answers
8 views

Best way to encode a tag column for clustering

I have a dataset which tells me a tech support case used a particular tech document. Every case has been tagged with which product it pertains to. Similarly tech documents are tagged with certain key ...
haldar55's user avatar
2 votes
0 answers
55 views

Attention mechanisms without a linear layer

I am currently looking into attention mechanism as they are used in (non-Transformer) encoder-decoder architectures, meaning an architecture where some RNN (usually LSTM or GRU) is used in both the ...
krise's user avatar
  • 121
0 votes
1 answer
47 views

Beginner clustering project, what are the input features and how do I analyze the data?

I am a beginner to data science. I have this dataset on natural disaster events in Afghanistan from 2016 - 2017. Columns: REGION (ex. North, North West, etc) PROVINCE_NAME (kind of like US 50 states) ...
Mas's user avatar
  • 55
0 votes
1 answer
25 views

Encoding soft clustering results as features

I want to use cluster numbers from soft clustering algorithm output as a some sort of categorical feature (or features), add them to other features for further training in another model (Y's from soft ...
franz-german's user avatar
1 vote
0 answers
98 views

In rotary positional embeddings (RoPE), why do we not rotate the values as well?

Actually, the question is all there is As per the paper I see that the rotations are applied only to the keys and the queries. Why are the rotations not applied to the values as well? The reasons for ...
figs_and_nuts's user avatar
0 votes
1 answer
31 views

Why are 1/n, 2/n, 3/n ... 2048/n not good positional encodings to be concatenated to the word vectors in transformers?

The transformer architecture has no sense of the relative positions of the word and hence we need to pass that information apriori to the along with the word embeddings to the model The positional ...
figs_and_nuts's user avatar
1 vote
0 answers
126 views

CLIP Visual Transformer image encoder

I was doing some experiments with the CLIP's visual transformer encoder output (clip-ViT-B-32). So basically given the same scene or image, it should output almost ...
Mary's user avatar
  • 217
1 vote
4 answers
134 views

Are scalers or encoders supposed to be serialized along with trained models?

Consider the very basic example below: ...
Muhammad Usman's user avatar
0 votes
1 answer
22 views

Trouble Loading Lines from Text File with Various Encodings

I have been facing difficulties while loading specific lines from a text file. The lines contain characters such as ٹام بیمار ÛÛ’Û” ٹام بیمار ÛÛ’. I have tried using different ...
Abdul Basit Niazi's user avatar
1 vote
1 answer
148 views

How to encode & scale IP addresses as input for ML models

Im currently working on an anomaly detection while making a transaction. As a part of the data that I extracted, I have the IP addresses of the indivduals who made the transaction. Since the IP ...
Sivadithiyan official's user avatar
1 vote
2 answers
1k views

Can decision trees handle Nominal Categorical variables?

I have read that decision trees can handle categorical columns without encoding them. However, as decision trees make splits on the data, how does it handle Nominal Categorical variables? Surely a ...
Connor's user avatar
  • 631
-1 votes
1 answer
1k views

y should be a 1d array, got an array of shape (60630, 2) instead

...
Wajeeh Rathore's user avatar
0 votes
1 answer
140 views

How to treat categorical columns after ordinal encoding?

If encode three categorical variables like "bad", "normal", "good" into 0,1,2, after that can I treat them as numerical values? So can I perform on them MinMaxScaler or ...
Flavio Brienza's user avatar
2 votes
1 answer
40 views

What ML techniques could be used for biometric feature extraction and ID generation?

I'm working on a project that involves generating a unique ID for a given biometric (such as an iris image). I'm interested in exploring the use of ML techniques for feature extraction and ID ...
Sedan Grib's user avatar
0 votes
1 answer
22 views

How do I handle "Greater than X" in a field of integers?

I've been tasked with cleaning a dataset with a "Drive Time" column that lists times taken to drive to a specific location in whole minutes. The values range from 3 to 180 minutes but there ...
Leon's user avatar
  • 1
0 votes
1 answer
75 views

What are more advanced categorical encoding methods?

I'm familiar with the common methods: Label Encoding: {A, B, C} -> [0, 1, 2] One-Hot Encoding: ...
cmauck10's user avatar
0 votes
2 answers
116 views

Does one-hot encoding result in information loss?

BACKGROUND: I'm working with a nominal feature variable cancer_type with $5$ different classes to develop a machine learning model. One-hot encoding this feature ...
Snehal Patel's user avatar
0 votes
0 answers
14 views

How to encode data set with all categorical predictors

I have a data set with all categorical predictors. They are 14 in number. If I do one-hot encoding, I would be getting more than 35 new features, which I think is not right due to the curse of ...
emekadavid's user avatar
1 vote
1 answer
59 views

How do well informed labels for ordinal encoding improve model performance?

From Kaggle's intermediate machine learning tutorial, it was stated that for each column, we randomly assign each unique value to a different integer. This is a common approach that is simpler than ...
Terrarium's user avatar
  • 113
0 votes
1 answer
31 views

Tool/package for merging tables with inconsistent column names and categorical variable encoding?

I have 10s of spreadsheets with facility-level rows. Each spreadsheet corresponds to a month. They each contain approximately the same variables (10s of them), but often with different column naming ...
katriel's user avatar
  • 111
0 votes
1 answer
125 views

Best way to encode product names in NLP?

I am supposed to train a classifier with historical shopping data that predicts the probability of an item being returned. The only human language contained for each purchase is the name of the ...
christallclear's user avatar
1 vote
1 answer
605 views

How to predict on data that is label encoded as end user will input a categorical data?

My dataset contains about 29 features with 3 class labels as result. Among these 29 features around 24 features are categorical i cannot transform each category into numbers as there are many more ...
Muhammad Minhas's user avatar
0 votes
1 answer
53 views

Encoding Categorical feature with high cardinality - in my case IP adresses

I'm working on an intrusion detection project, I have many categorical features, for some I used label encoding since I don't have many possible values. But for IP addresses, it's a high cardinality ...
biihu's user avatar
  • 11
2 votes
1 answer
409 views

Encoding for Linear Regression

I have a CSV file with salary information and other columns. I am trying to transform some of these columns into proper values, for a ...
Alix Blaine's user avatar
1 vote
2 answers
521 views

At what point do I have to many dummy variables?

When does one-hot-encoding simply create too many dummy variables? For example, should I one hot encode a country name? This in the worst case could create close to 200 dummy variables. Should I one ...
christallclear's user avatar
0 votes
2 answers
129 views

When to use Label Encoder and One Hot encoding with target variables?

As the title says, When to use Label Encoder and One Hot encoding with target variables ?
John adams's user avatar
1 vote
2 answers
59 views

Enocding of months for machine learning project

I've been doing a project where I want to use random forest algorithm. There is a column with months, but it is categorical. Was wondering what kind of encoding I should use. I've read that for Random ...
Tomasz Przybyło's user avatar
2 votes
0 answers
69 views

Catboost: Categorcial Feature Encoding

I would like to understand all the methods available in Catboost for encoding categorical features. Unfortunately, the published articles by Yandex ("CatBoost: gradient boosting with categorical ...
calpyte's user avatar
  • 121
0 votes
1 answer
59 views

Comparing encoders to same input of differnt output size

Let's say I have an input s1 and I pass it to two encoders e1 and e2. They output encodings ...
adityagabbar's user avatar
0 votes
0 answers
26 views

Feature Engineering Encoding for multiple category with huge category range

I need to encode a column "Tags" that has a total of 144 different types and at the same time a row can contain multiple tags. What's the best encoding method in this situation? One-hot ...
victor's user avatar
  • 1
3 votes
1 answer
2k views

How do I specify encoding in scikit-learn OrdinalEncoder?

Scikit-learn object OrdinalEncoder() allows the user to create a lineary based encoding principle for ordinal data, however the the codes are encoded randomly. Is there any way I can specify how the ...
Sam's user avatar
  • 31
0 votes
0 answers
19 views

Is the result of my feature encoding numeric or categorical?

I have the following categorical feature in a data table (recording the day of week when a certain action happened): ...
Hendrik's user avatar
  • 8,617
0 votes
1 answer
970 views

How does Catboost regressor deal with categorical features at predict time?

I understand that Catboost regressor uses target-based encoding to convert categorical features to numerical features when training. But how does Catboost deal with categorical features at predict ...
cap99's user avatar
  • 3
0 votes
0 answers
240 views

What is the difference between one hot encoding and 1-of-c encoding?

I am tasked with using 1-of-c encoding for a NN problem but I cannot find an explanation of what it is. Everything I have read sounds like it is the same as one hot encoding... Thanks
Bryon's user avatar
  • 111
0 votes
0 answers
160 views

Do I need to encode numerical variables like "year"?

I have a simple time-series dataset. it has a date-time feature column. ...
smarks70's user avatar
2 votes
2 answers
1k views

Is it vital to do label encoding with target variable

Should I always use label encoding while doing binary classification?
Rus Pylypyuk's user avatar
0 votes
1 answer
159 views

Should I encode the categorical data before making a training validation split?

I am looking at some examples in kaggle and I'm not sure what is the correct approach. If I split the training data for training and validation and only encode the categorical data in the training ...
parse5214's user avatar
1 vote
1 answer
2k views

Converting binary valued data to boolean or one hot?

I am dealing with a dataset that contains multiple columns (features) that contain binary variables, e.g., a gender feature that contains 'male' and 'female'. I want to apply some supervised learning ...
Erik M's user avatar
  • 83
0 votes
1 answer
105 views

What's the minimum percentage of categories should be present in the categorical variable for to ignore the variable entirely

For example, if i have a feature "colour_codes" that has close to 5000 distinct color codes inside it. And the number of samples/rows is 10 million. Then should I ignore the feature "...
insomniac's user avatar
1 vote
1 answer
270 views

Categorical feature encoding

I am making a classification model. I have categorical and continuous data. The categorical columns include columns with 2 classes such as sex (male, female), and multi-class columns such as location. ...
Alis's user avatar
  • 11
0 votes
1 answer
907 views

Retrieving the ordinal encoding of a variable after it's placed in a pipeline/columntransformer

I am applying ordinal encoding to a dataset through a column transformer - how can I retrieve the ordinal encoding of a feature (e.g. Area)? ...
lostwanderer's user avatar
1 vote
1 answer
965 views

Getting dummies for both train and test data

Should I apply pd.get_dummies() for both train and test data? And would it not result in data leakage?
A Arbitrage's user avatar
2 votes
1 answer
80 views

Encode a set of skills into a feature

I am working with a dataset where users have a set of skills. I have more than 500 skills and I was wondering what is the best way of encoding a vector, e.g., ...
vftw's user avatar
  • 143
1 vote
0 answers
5 views

quereies related to autoencoder

i want to design an deep auto encoder after following keras tutorial. Input is a simple 2-dimensional image consists of 512 rows and 50 columns matrix My trial code is ...
simond's user avatar
  • 73