33 votes
Accepted

Encoding features like month and hour as categorial or numeric?

Have you considered adding the (sine, cosine) transformation of the time of day variable? This will ensure that the 0 and 23 hour for example are close to each other, thus allowing the cyclical nature ...
Pablo O's user avatar
  • 466
24 votes
Accepted

Feature selection vs Feature extraction. Which to use when?

Adding to The answer given by Toros, These(see below bullets) three are quite similar but with a subtle differences-:(concise and easy to remember) feature extraction and feature engineering: ...
Aditya's user avatar
  • 2,460
23 votes

Are there any tools for feature engineering?

Very interesting question (+1). While I am not aware of any software tools that currently offer comprehensive functionality for feature engineering, there is definitely a wide range of options in that ...
Aleksandr Blekh's user avatar
22 votes

Feature Transformation on Input data

We love the normal form In most cases we try to make them act like normal. Its not classifiers point of view but its feature extraction view! Which Transformation? The main criterion in choosing a ...
Hadi Gharibi's user avatar
20 votes

How to perform feature engineering on unknown features?

You do not need domain knowledge (the knowledge of what your data mean) in order to do feature engineering (finding more expressive ways of framing your data). As Tu N. explained, you can find "...
Winks's user avatar
  • 1,366
20 votes

What is difference between one hot encoding and leave one out encoding?

They are probably using "leave one out encoding" to refer to Owen Zhang's strategy. From here The encoded column is not a conventional dummy variable, but instead is the mean response over ...
Dex Groves's user avatar
20 votes
Accepted

Why do we convert skewed data into a normal distribution

You might want to interpret your coefficients. That is, to be able to say things like "if I increase my variable $X_1$ by 1, then, on average and all else being equal, $Y$ should increase by $\beta_1$"...
Ricardo Magalhães Cruz's user avatar
18 votes

Encoding features like month and hour as categorial or numeric?

The answer depends on the kind of relationships that you want to represent between the time feature, and the target variable. If you encode time as numeric, then you are imposing certain restrictions ...
raghu's user avatar
  • 641
14 votes
Accepted

Is (manual) feature extraction outdated?

In the general case, this is by no means true. Let's break down the case for different data scenarios: For discriminative image models (e.g. image classification/labeling) this is true for some ...
noe's user avatar
  • 23.8k
13 votes

List of feature engineering techniques

Missing Data Imputation: Complete case analysis Mean / Median / Mode imputation Random Sample Imputation Replacement by Arbitrary Value Missing Value Indicator Multivariate imputation ...
Sole G's user avatar
  • 271
12 votes
Accepted

Feature extraction of images in Python

In images, some frequently used techniques for feature extraction are binarizing and blurring Binarizing: converts the image array into 1s and 0s. This is done while converting the image to a 2D ...
Dawny33's user avatar
  • 8,256
11 votes

Is (manual) feature extraction outdated?

No, manual feature extraction is not outdated. In addition, manual feature extraction is hard to do-away, given, a data scientist needs business and domain logic to build a robust model to replicate ...
DataFramed's user avatar
10 votes

List of feature engineering techniques

There is no definite source on how to do feature engineering. It is often dependent on the problem you are trying to solve. Some say it is more of an art than it is science. But I would go through ...
phiver's user avatar
  • 718
9 votes
Accepted

How to get spike values from a value sequence?

This is very simple. Let's say your data in Panda format (named data_df), and extracting peaks/spikes over a certain threshold (e.g. 15000 here) is simply: ...
TwinPenguins's user avatar
  • 4,207
8 votes

Are there any tools for feature engineering?

Featuretools is a recently released python library for automated feature engineering. It's based on an algorithm called Deep Feature Synthesis originally developed in 2015 MIT and tested on public ...
Max Kanter's user avatar
8 votes

Feature extraction of images in Python

This great tutorial covers the basics of convolutional neuraltworks, which are currently achieving state of the art performance in most vision tasks: http://deeplearning.net/tutorial/lenet.html ...
jamesmf's user avatar
  • 3,077
8 votes

How to deal with categorical feature of very high cardinality?

This is an old question. I am surprised that I don't see anyone mentioned Mean Encoding (a.k.a Target Encoding). It is very popular in supervised learning problems. Besides, I have seen people use ...
Diansheng's user avatar
  • 181
8 votes

Encoding features like month and hour as categorial or numeric?

I recommend using numerical features. Using categorical features essentially means that you don't consider distance between two categories as relevant (e.g. category 1 is as close to category 2 as it ...
Tanguy Coatalem's user avatar
8 votes
Accepted

Feature agglomeration: Is it testing interactions?

From the documentation: Similar to AgglomerativeClustering, but recursively merges features instead of samples. In standard agglomerative clustering you receive a matrix $M^{n \times m}$ ...
Dani Mesejo's user avatar
  • 2,226
7 votes
Accepted

How to deal with categorical feature of very high cardinality?

One-hot-encoded ZIP codes shouldn't present a problem with modern tools, where features can be much wider (millions, billions even), but if you really want you could aggregate area codes into regions, ...
Emre's user avatar
  • 10.5k
7 votes

What is the rationale for discretization of continuous features and when should it be done?

One reason to discretize continuous features is to improve the signal-to-noise ratio. Fitting a model using features that have been binned reduces the impact that small fluctuations in the data have ...
Brian Spiering's user avatar
7 votes
Accepted

Why is duplicating inputs bad?

The issue with building a regression model on all 3 of these is that you are potentially introducing multicollinearity into the model. Although log(input) and sqrt(input) are not linear functions of ...
bnorm's user avatar
  • 533
6 votes

Boruta feature selection in R with custom importance (xgboost feature importance)

Boruta is by universal reputation dog-slow and not very good. Boruta runs take many hours or days. VIF feature-selection algorithm is not objective, anyway. You can program your own feature-selection ...
smci's user avatar
  • 331
6 votes

Can GPS coordinates (latitude and longitude) be used as features in a linear model?

You cannot use them directly, as it is unlikely there is a true linear relationship unless you're looking to predict "how far east or north" someone is. As mentioned in the comments, you need to ...
CalZ's user avatar
  • 1,663
6 votes

What is the ideal database that allows fast cosine distance?

If you need to scale beyond 1000 entries in the future, a brute-force approach to find the exact neighbors will become increasingly prohibitive from a computational standpoint. To future-proof your ...
Addison Klinke's user avatar
6 votes
Accepted

To remove Chinese characters as features -

If you want to remove non-English characters then this regex will work, by selecting characters not in a given ASCII range (0 to 122, you can adjust this since it will allow some special characters): ...
Dan Carter's user avatar
  • 1,732
5 votes
Accepted

How to define a distance measure between two IP addresses?

If I understood them correctly, both Jeremy and Edmund's (first) solutions are the same, namely, plain euclidean distance in a 4-dimensional space of IP addresses.BTW, I think a very fast alternative ...
MASL's user avatar
  • 511
5 votes

Unsupervised feature learning for NER

In this 2014 paper (GitHub), the authors compared multiple strategies of incorporating word embeddings in a CRF-based NER system, including dense embedding, binerized embedding, cluster embedding, and ...
user2404894's user avatar
5 votes

What is dimensionality reduction? What is the difference between feature selection and extraction?

Feature selection is about choosing some of features based on some statistical score but feature extraction is using techniques to extract some second layer information from the data e.g. interesting ...
DanielWelke's user avatar
5 votes

How to use GAN for unsupervised feature extraction from images?

Typically to extract features, you can use the top layer of the network before the output. The intuition is that these features are linearly separable because the top layer is just a logistic ...
kenny's user avatar
  • 435

Only top scored, non community-wiki answers of a minimum length are eligible