Questions tagged [one-hot-encoding]

The tag has no usage guidance.

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

Possible harm in standardizing one-hot encoded features

While there may not be any added value in standardizing (mean=0, std=1) one-hot encoded features prior to applying linear models, is there is any harm in doing so? I prefer applying standardization to ...
0
votes
0answers
19 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
13 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 ...
0
votes
1answer
24 views

One Hot Encoding Problem in Keras [closed]

I try to encode my target variable column before fitting the keras model. When I do, the resulting columns size is doubled and I am getting the error: ...
1
vote
1answer
29 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
46 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
19 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
316 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
19 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
22 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
40 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
17 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
16 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
17 views

Categorical data - how to handle

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
9 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
40 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
26 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
52 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 ...
1
vote
1answer
156 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 ...
0
votes
0answers
29 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
29 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 ...
1
vote
2answers
156 views

Scikit-learn OneHotEncoder effect on feature selection

If I need to run feature selection on my dataset isn't it problematic to use OneHotEncoder? Couldn't it then decide to remove a one of the encoding columns? How should I deal with this? Thank you.
3
votes
1answer
157 views

Does Fasttext use One Hot Encoding?

In the original Skipgram/CBOW both context word and target word are represented as one-hot encoding. Does fasttext also use one-hot encoding for each subword when training the skip-gram/CBOW model (...
1
vote
2answers
37 views

If a categorical feature only occurs a few times in a data set, should I drop it?

I have a data set of mostly categorical variables. When I one-hot encoded them some of the features occur less than 3% of the time. For instance the Tech-support feature only occurs 928 times in a ...
2
votes
1answer
40 views

Isn't one-hot encoding a waste of information? [duplicate]

I was just playing around with one-hot representations of features and thought of the following: Say that we're having 4 categories for a given feature (e.g. fruit) {Apple, Orange, Pear, Melon}. In ...
1
vote
1answer
69 views

How to handle potential interactions when one-hot encoding?

Let's say I have two categorical features: Movie, Director. I one-hot encode both the Movie and Director features for use in a linear regression model. The problem is that two or more movies may be ...
0
votes
0answers
27 views

Memory error while trying to apply Multivariate imputation by chained equations?

I have a training set consisting of movies data, which includes features like runtime, keywords, cast etc. The keywords columns consist of json collections of keywords used in the movie with ...
1
vote
2answers
125 views

Is One Hot Encoding Vectorized?

Sorry for such a weird question - I do not even know if this makes sense, however I thought of this during my intro to Python course at uni and have wondered about it since. So I have some ...
2
votes
1answer
45 views

Using One Hot Encoding VS Label Encoder for Football Match Outcomes

I am working on a project to predict football matches using bookmakers' odds. The 6 columns I have are Home Team, Away Team, Home Win Odds, Draw Odds, Away Win Odds, Outcome. The possible football ...
0
votes
1answer
55 views

What is the best way to encode features when clustering data? [duplicate]

I have a dataset with numerical and categorical features. I am trying to run a k-means algorithm to find clusters of data. What is the best way to encode categorical features? I have been doing one ...
0
votes
2answers
157 views

Dummy encoding the categorical variables using the changed version of OneHotEncoder [duplicate]

This is my code, I was trying to dummy encode the first column of X using OneHotEncoder but it was showing error and the documentation page of OneHotEncoder says that it has been changed and I wasn't ...
0
votes
0answers
10 views

ResNet-Architecture 18 to 152 delivers same TPR and FPR

As I ve mentioned in the title. I am using all familiar ResNet-Architectures (18, 34, 50, 101, 152) for classifying two labels ('yes' or 'no') on base of two dimensional one-hot-encoded data (...
3
votes
2answers
554 views

Beyond one-hot encoding for LSTM model in Keras

I have an LSTM model in Keras for categorical classification (20 possible categories). In many cases, my data can fit multiple categories. Obviously, my current model uses one-hot encoding and fits ...