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
1 answer
31 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
  • 13
0 votes
0 answers
19 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
42 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
0 answers
18 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
2 votes
0 answers
48 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 ...
Tina J's user avatar
  • 217
1 vote
4 answers
85 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
0 votes
0 answers
24 views

Multimodal classification - multiple images for each record

I have a multimodal classification task. In my dataset, each record consists of a text a list of 1 to 4 associated images a label Probably, I'd want to use transformers encoders to represent both ...
Stefano Fiorucci - anakin87's user avatar
1 vote
1 answer
87 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
665 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
  • 617
-1 votes
1 answer
376 views

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

...
Wajeeh Rathore's user avatar
0 votes
1 answer
64 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
33 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
0 answers
53 views

Why don't we use binary vectors in positional coding?

I found this article on positional encoding (https://towardsdatascience.com/master-positional-encoding-part-i-63c05d90a0c3). But I don't understand when the author says that you have to measure a ...
Redia's user avatar
  • 1
0 votes
1 answer
20 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
0 answers
24 views

Which model is best to predict range from large vector of positive integers?

I'm creating a predictor, which takes a vector of table row counts (list of about 150 positive integers) and predict based on it the duration of the upgrade procedure (expressed as a set of ranges). ...
Anton Golubev's user avatar
0 votes
1 answer
73 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
80 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
49 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
25 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
111 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
461 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
44 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
1 vote
1 answer
284 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
310 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
112 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
53 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
51 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
42 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
2 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
  • 21
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,487
0 votes
1 answer
797 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
206 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
131 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
136 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
1k 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
82 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
253 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
730 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
808 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
78 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
1 vote
3 answers
4k views

One-hot-encoded variables dominating clustering

I am performing some unsupervised clustering with k-means on some transaction data that contains the following information: Customer units purchased in category_1 units purchased in category_1 time ...
user1636588's user avatar
1 vote
1 answer
24 views

Encoding distance variable that is continuous until out-of-range

I have a varaible distance which is continous until a "hard stop" at which we stop measuring the distance itself and just label the distance as "out ...
user1636588's user avatar
0 votes
1 answer
641 views

Encoding with OrdinalEncoder: TypeError: unhashable type: 'numpy.ndarray'

I am trying to do a Random Forest in a dataset with numerical and categorical variables in order to obtain a categorical result (two possible classes, column name "predicción"). I am using ...
Jose Cle's user avatar
0 votes
2 answers
44 views

Encoding feature containing both text and string?

I have a feature which has following entries:- | Exterior | | -------- | | Vinyl | | Wd Sdng | | MetalSd | | Wd Sdng | | HdBoard | | BrkFace | | Wd Sdng | ...
spectre's user avatar
  • 1,941
2 votes
3 answers
2k views

Does One-Hot encoding increase the dimensionality and sparsity of dataset?

There are two ways to convert object datatype into numeric datatype, first is One-Hot encoding and second is simply map the numerical tags to different values. For example for column Age containing ...
Ahmad Bilal's user avatar