Questions tagged [one-hot-encoding]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-1
votes
0answers
9 views

Approach for multiclass multioutput Variables [closed]

A1 |A2 |B1 |B2 |C1 |C2 | A_state | B_state | C_state .1 |.2 |.3 |.1 |-.2|.3 | Bad | Best | Good .5 |.5 |.4 |.8 |.5 |.4 | Worst | Worst | Best .5 |-.4|-.4|.3 |.4 |.5 | Good ...
0
votes
1answer
34 views

One-Hot-Encoding for features!

I have a question about One-Hot-Encoding, something confusing me.:\ I have this sample dataset. My dataset is categorical: F1 F2 F3 F4 Target 1 Blue 3 Car Yes 4 Red 6 Ship No 3 Pink 3 Cow Yes 9 ...
1
vote
0answers
22 views

How do I convert strings in a dataframe column to int or float [closed]

Encoding the column seperately works ,but when I try it on the dataset directly it throws an error. The error is something like this. ...
0
votes
1answer
19 views

How to use prediction model after onehot encoding?

I have created a prediction model for this dataset ...
0
votes
1answer
21 views

OneHotEncoding target variable? [duplicate]

I'm working on a multiclass classifier with 6 classes on the target column and I was thinking about Hot Encoding the classes, thus having 6 target columns. Will this improve efficiency? I am using <...
3
votes
1answer
36 views

One hot encoding of target variable containing classes 1 to 9 not including zero

While predicting a solution for a sudoku puzzle using CNN, the target variable should predict values from 1 to 9 for all the 81(9*9) values in the puzzle. Hence the target value shape is (81,9). Using ...
6
votes
5answers
137 views

How do I encode the categorical columns if there are more than 15 unique values?

I'm trying to use this data to make a data analysis report using regression. Since regression only allows for numerical types, I then need to encode the categorical data. However, most of these have ...
0
votes
1answer
20 views

For very simple linear regression can we quantify the prediction accuracy hit between using one hot encoding and simple numerical mapping?

Suppose I had a simple linear regression model that had the following input or X variable: ...
0
votes
0answers
33 views

OneHotEncoder in ColumnTransformer: passthrough not returning original column names

I'm using a column transformer to pass in categorical data of the Kaggle Titanic dataset to one-hot encode. I'm using a pipeline as well so I can expand the process later on, but the dataframe column ...
0
votes
0answers
20 views

With NN Model data preprocessing, is One Hot Encoding WITH PCA a good or bad idea?

With Tabular Data (containing both continuous and categorical data) preprocessing, does the One Hot Encoding of Categorical Features help or hinder the effectiveness of PCA prior to Neural Network ...
2
votes
1answer
87 views

What exactly is a dummy trap? Is dropping one dummy feature really a good practice?

So I'm going through a Machine Learning course, and this course explains that to avoid the dummy trap, a common practice is to drop one column. It also explains that since the info on the dropped ...
1
vote
1answer
69 views

TensorFlow 2 one-hot encoding of labels

I was following this basic TensorFlow Image Classification problem, where images of flowers have to be classified into one of 5 possible classes. The labels in the training set are not one-hot encoded,...
1
vote
1answer
37 views

How to handle One Hot Encoded columns with changing categories in supervised ML Problem?

Scenario: I have the following game data about participants, game and the winner in the following format: ...
1
vote
1answer
24 views

One-hot vector for fixed vocabulary

given a vocabulary with $|V|=4$ and V = {I, want, this, cat} for example. How does the bag-of-words representation with this vocabulary and one-hot encoding look like regarding example sentences: You ...
0
votes
1answer
29 views

how do tree based methods deal with missing feature columns?

all, i have trained a model using xgboost. Some of the features are one hot encoded e.g. currency where it is either gbp or usd. it seems that when i output the feature importance gbp and usd were in ...
2
votes
0answers
15 views

Encoding ML classification features that are relative to the dependant categories

I have a classification problem with three classes A, B & C. I have features x1, x2 and x3 that represent my data items. But I also have a fourth feature that represents a similarity between my ...
0
votes
0answers
116 views

Binary cross entropy loss for one hot encoded 2 class problem

My aim is to predict whether a person is alive or dead. In the case there are two classes which can either be alive (1) or dead (0). The output could be only one class i.e 1 or 0 and not multi label ...
0
votes
1answer
24 views

Reduce Categorical Values

I'm working on one use case where I have to explore source code repo files. Different files will be a categorical values for me. But with such large number of files, One Hot Encoding comes out to be ...
1
vote
1answer
54 views

Predicting game scores using sklearn

I am using onehotencoding and RandomForestRegressor to predict scores of a set of soccer games. How can I use it into ...
0
votes
1answer
104 views

What is multi-hot encoding?

I was read and paper for machine learning, and i found this term "multi-hot encoding" without explanation. Can you help me please? the paper: https://arxiv.org/abs/2001.06917
1
vote
1answer
48 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
1answer
121 views

onehotencoder random forest

In a Random Forest context, do I need to setup dummies/OnehotEncoder in a dataset where features/varibles are numerical but refer to some kind of category? Let's say I have the following variables: ...
1
vote
1answer
50 views

Encoding for classifiers

I have some doubts regarding encoding (i am not familiar with tasks like these) categorical variables in order to use them as parameters in a model like logistic regression or SVM. My dataset looks ...
0
votes
1answer
109 views

Shall I use ordinal encoding or One-Hot-Encoding when using DBSCAN for content clustering on websites?

I want to cluster the preparation steps on cooking recipes websites in one cluster so I can distinguish them from the rest of the website. To achieve this I extracted for each text node of the website ...
0
votes
1answer
33 views

Variables for SVM [closed]

I would like to predict if an email is spam or not spam based on the information that I have, i.e. date, email address, subject and text. Three of these parameters are text data, so they would need to ...
3
votes
2answers
70 views

Treating missing data in categorical features

I have a dataset with one of the categorical columns having a considerable number of missing values. The interesting thing about this column is that it has values only for a particular category in &...
1
vote
1answer
442 views

Categorical cross-entropy works wrong with one-hot encoded features

I'n struggling with categorical_crossentropy problem with one-hot encoding data. The problem is in unchanged output of code presenting below: ...
3
votes
1answer
183 views

Encoding and cross-validation

Recently I've been thinking about the proper use of encoding within cross-validation scheme. The customarily advised way of encoding features is: Split the data into train and test (hold-out) set Fit ...
0
votes
1answer
597 views

Setting sparse=True in Scikit Learn OneHotEncoder does not reduce memory usage

I have a dataset that consists of 85 feature columns and 13195 rows. Approximately 50 of these features are categorical features which I encoded using OneHotEncoder. I was reading this article about ...
1
vote
1answer
106 views

Dropping one category for regularized linear models

While reviewing the sklearn's OneHotEncoder documentation (attached below) I noticed that when applying regularization (e.g., lasso, ridge, etc.) it is not recommended to drop the first category. ...
6
votes
2answers
184 views

Possible harm in standardizing one-hot encoded features

While there may not be any added value in standardizing one-hot encoded features prior to applying linear models, is there is any harm in doing so (i.e., affecting model performance)? Standardizing ...
1
vote
1answer
104 views

splitting mechanism with one hot encoded variables (tree based/boosting)

I am using xgboost and have a categorical unordered feature with 25 levels. So when i apply one hot encoding i have 25 columns. This introduces alot of sparsity. Even more unusual, my feature ...
0
votes
0answers
67 views

One-Hot Encoded Matrix Inupt/Ouput for Autoencoder

I am trying to write an autoencoder to reduce the dimensionality of my genomic data. Currently, my data is in the form of a $273278 \times 1$ vector. Each element of the vector indicates whether a ...
3
votes
1answer
136 views

When to One-Hot encode categorical data when following Crisp-DM

I have a dataset that contains 15 categorical features (2 and 3 level factors which are non-ordinal) and 3 continuous numeric features. Seeing as most machine learning algorithms require numerical ...
3
votes
1answer
83 views

On gradient boosting and types of encodings

I am having a look at this material and I have found the following statement: For this class of models [Gradient Boosting Machine algorithms] [...] it is both safe and significantly more ...
1
vote
1answer
69 views

Got some troubles with using OneHotEncoder to multiple categories

I'm trying to get the final pipeline on the titanic dataset(Example was taken from the 'Hands-on ML' book). ...
5
votes
1answer
440 views

One Hot Encoding for any kind of dataset

How can I make a one hot encoding for a unknown dataset which can iterate and check the dytype of the dataset and do one hot encoding by checking the number of unique values of the columns, also how ...
1
vote
1answer
20 views

Is there any problem with dropping only part of the OneHot generated features?

The one hot encoder adds more columns to the data, one for each category in the encoded feature. In the example below, the column City was transformed into 4 other ...
1
vote
2answers
84 views

Will one hot encoding / unbalanced columns cause bias to Clustering Analysis?

I'm wondering if having too many columns about one certain feature is gonna cause bias to the clustering analysis. For example, if my dataset has columns = ['incoming calls', 'outgoing calls', '...
2
votes
1answer
71 views

Random Forrest Sklearn gives different accuracy for different target label encoding with same input features

I'm using sklearn Random Forrest to train my model. With the same input features for the model I tried passing the target labels first with label_binarize to create one hot encodings of my target ...
0
votes
0answers
34 views

Handle OneHot Encoder in a pipeline with unseen data

so I have my data and split it in the beginning in test and train set. Then I apply following Pipelines on it: ...
0
votes
1answer
26 views

What are the sparse and dense vector ? I cant undestand ,can you explain to me?please.Why do we use for?

I am new to neural networks, embeddings, etc. I am struggling understanding things like sparse representation, embeddings, and especially sparse vectors. Could you explain these to me? Why do we need ...
0
votes
1answer
33 views

Categorical data - how to handle [closed]

Few questions on categorical data. Need suggestions / pointers: How can we check for correlation between categorical features and target or between the features themselves? How about correlation ...
0
votes
0answers
10 views

sklearn decision trees categorical data error [duplicate]

Decision trees should be able to separate a finite number of categorical variables (such as three cuisines, languages, etc.). Is it necessary to OneHotEncode it for ...
0
votes
2answers
99 views

What to do if one out of 2 one-hot encoding variables have a very high p-value?

I ran an OLS model on a dataset with 2 categorical variables. One of them was gender. The other one had 3 different categories. I used one-hot encoding for it during pre-processing before running my ...
1
vote
0answers
36 views

Using a Subset of Categories in a Categorical Column

I have a XGBoost model and I'm going to retrain it by adding new features. There is a column in my data and it's about professions of the customers. It has 60 categories. I suppose there is no need to ...
1
vote
0answers
502 views

How to remove layers from a TensorFlow2 model?

I have a CNN model which has a lambda layer doing One-Hot encoding of the input. I am trying to remove this Lambda layer after loading the trained network from a h5 file. So far I have tried to create ...
3
votes
1answer
476 views

Difference between tf.keras.backend.one_hot and keras.utils.to_categorical

I'm working on a classification project and need to do one hot encoding on my data set. I'm just wondering what is the difference between tf.keras.backend.one_hot ...
1
vote
0answers
43 views

One Hot Encoding where all sequences don't have all values

Is there a way (other than manually creating dictionaries) to one hot encode sequences in which not all values can be present in a sequence? sklearn's OneHotEncoder ...
2
votes
1answer
53 views

Why encode pitch as one-hot encoding instead of ordinal encoder?

looking at the state-of-the-art publications on deep learning for synthesizing audio one can see that they always resort to encoding pitch as a one-hot vector. I'm curious what the advantage is on ...