Questions tagged [data-leakage]
The data-leakage tag has no usage guidance.
47
questions
1
vote
1
answer
49
views
Why leaky features are problematic
I want to know why leaky features are problematic in machine learning/data science. I'm reading a book that uses the Titanic dataset for illustration. It says that the column ...
2
votes
1
answer
25
views
Can I create a new target value based on the average target value of same data points for regression?
I am trying to predict profit of retail stores. The orginal dataframe looks like this:
Store No
feature A
feature B
year
profit
A
1
2
2016
20000
A
1
2
2017
40000
B
4
3
2017
50000
B
4
3
2018
40000
...
0
votes
0
answers
12
views
Joining of Technical replicates with experimental data
I have a task in which I need to join data collected from non-destructive biological sensor analyses with data collected from various microbiological "wet-lab" methods, e.g. colony counting, ...
2
votes
1
answer
78
views
Is data leakage giving me misleading results? Independent test set says no!
TLDR:
I evaluated a classification model using 10-fold CV with data leakage in the training and test folds. The results were great. I then solved the data leakage and the results were garbage. I then ...
2
votes
1
answer
64
views
How does a data leakage work?
I'm working with panel data - every row represents a timestamp (observation) and there are multiple rows for a single timestamp (around 20 rows each). I have a total of 8719 unique timestamps.
...
1
vote
2
answers
40
views
How to generate test set with no data-leakage using multiple columns
I am developing a fraud detection algorithm. Among other things, my dataset contains the phone number, email address and a few other fields that should uniquely identify a user (let's call them "...
0
votes
2
answers
36
views
Why label encoding before split is data leakage?
I want to ask why Label Encoding before train test split is considered data leakage?
From my point of view, it is not. Because, for example, you encode "good" to 2, "neutral" to 1 ...
-1
votes
2
answers
381
views
How to fit Word2Vec on test data?
I am working on a Sentiment Analysis problem. I am using Gensim's Word2Vec to vectorize my data in the following way:
...
1
vote
1
answer
23
views
Preprocessing for the final model to be deployed
Typically for a ML workflow, we import the data (X and y), split the X and ...
0
votes
0
answers
17
views
proximity matrix of random forest and data leakage
My objective is to train a random forest classifier on a binary set of data and use the resulting proximity matrix to understand the sub-populations in the data. I have read some papers on this ...
0
votes
0
answers
68
views
Does this make data leakage in time series? # need help for understanding time series data
Does this make data leakage in time series? I already read this, data leakage when scaling time series
Data leakage is when information from outside the training dataset is used to create the model.
...
4
votes
1
answer
127
views
What can I do when my test and validation scores are good, but the submission is terrible?
This is a very broad question, I understand and I'm totally fine if someone believes it's not appropriate to do it. But it's killing me not to understand this...
Here's the thing, I'm doing a machine ...
0
votes
1
answer
490
views
Splitting before tfidf or after?
When should I perform preprocessing and matrix creation of text data in NLP, before or after train_test_split? Below is my sample code where I have done ...
0
votes
0
answers
53
views
Time-Series Cross-Validation for LSTM
Is it at all possible to separate my data into train/test sets with cross validation for time series data? I am experimenting with a LSTM model.
Also, I am hoping to prevent data leakage/peaking in ...
3
votes
1
answer
81
views
Can data leakage be sometimes acceptable?
I have recently started using kaggle and I have stumbled on a few examples of practices I would consider do be data leakage. Many of them were done by people well established on the platform and I ...
1
vote
1
answer
82
views
Data Leakage when preprocessing categorical features?
I am fairly new to machine learning. I came across the concept of Data Leakage. The article says that always split the data before performing preprocessing steps.
My question is, do steps such as ...
1
vote
1
answer
80
views
Is there potentially data leakage during imputation for time-varying sensor data?
I have a time-varying dataset that contains some missing data. I have sensors that continuously monitor some properties at evenly-spaced intervals and I would like to impute the missing values using ...
2
votes
1
answer
51
views
Information leakage when train/test are truly i.i.d.?
I am well aware that to avoid information leakage, it is recommended to fit any transformation (e.g., standardization or imputation based on the median value) on the training dataset and applying it ...
1
vote
2
answers
92
views
Does binning a time series with pd.qcut (using quantiles) create data leakage?
Let's say I want to predict whether a company will default on it's debt at some point in time (so binary classification) and one of the time series variables I'm using is the "revenue" of ...
1
vote
0
answers
57
views
Data\Feature Leakage - feature too close to target?
In General:
The target itself built from very correlated features, because there is no ground truth - only rule based one.
I have a problem in the following method:
Output: binary. built from ...
0
votes
1
answer
389
views
K-Fold cross validation and data leakage
I want to do K-Fold cross validation and also I want to do normalization or feature scaling for each fold. So let's say we have k folds. At each step we take one fold as validation set and the ...
2
votes
1
answer
79
views
How to split up my dataset in a train and testset, in order to prevent data leakage?
I realize that this could be considered a duplicate of this question, Is using samples from the same person in both trainset and testset considers being a data leakage?, where it is stated that "...
1
vote
1
answer
91
views
Is it right to maintain the train distribution in test set for unbalanced data?
If the training set was unbalanced the chances are the model will be biased. But if the data distribution in the test set is the same distribution as the train set, this kind of bias is not going to ...
6
votes
3
answers
2k
views
Does label encoding an entire dataset cause data leakage?
I have a dataset on which one of the features has a lot of different categorical values. Trying to use a LabelEncoder, OrdinalEncoder or a OneHotEncoder results in an error, since when splitting the ...
2
votes
1
answer
35
views
Is using samples from the same person in both trainset and testset considers being a data leakage?
Suppose a neural network is built for a binary classification problem such as recognize the face as a smiley face or not, by using a dataset of 1000 persons and each person has ten images of his face.
...
2
votes
0
answers
187
views
Will setting up time series data in this way cause data leakage?
I am trying to predict future stock market values using a gradient boosted tree model. As far as I know, gradient boosted trees use the data in one row, and only that row, to predict the target ...
2
votes
1
answer
72
views
Can I apply feature selection before splitting by requiring selection occurs > 90% of time
I want to move the feature selection step to before splitting to save time and allow bigger input dataset. If, in repeated subsamples, a feature is selected in over X percentage of cases I will keep ...
1
vote
1
answer
269
views
Mean encoding in times series
Considering a TS from 1-5 blocks and using 1-4 block as train data.
Is it invalid to build mean encode on whole train data / or I should mean encode block 1 / block 1-2 / ... / block 1-2-3-4 ?
Edit 1 :...
1
vote
2
answers
384
views
Need help understanding data leakage
I am a newbie to this stuff so I am sorry if my question is stupid~
I need help understanding what data leakage between X_train and X_test is and when exactly it happens.
I am currently working on a ...
1
vote
1
answer
33
views
Normalizing dependent feature by one of the independent ones
I have a data set with three different features (x1, x2, x3) and I am going to use a regression model to predict y based on the features.
x3 is the total amount of money that a customer invest and y ...
1
vote
0
answers
38
views
Identifying possible data leakage
I am building a binary classification model for imbalanced dataset using XGBoost. I tuned the hyperparameters for four different models based on 2 training datasets and 2 optimization metrics.
Class ...
3
votes
0
answers
268
views
Data leakage in bidirectional LSTM timeseries data
Does it cause data leakage to train a bidirectional LSTM on data where a user can be a sample in the training data multiple times?
Each row is a snapshot at a different point in time for a given ...
1
vote
0
answers
30
views
Is data leakage in time series due to both I's of the IID principe or only one?
I am sure that the Independent part of the IID principle gives you data leakage because of the correlation. But the identical part I am not so sure. Identical in time series means that your data is ...
4
votes
2
answers
27
views
Does using user-specific accumulative variables causes data leakage?
Let's say I have a scenario in which my observational unit is a bill that was issued after a certain service was given and my goal is to predict if this bill is going to be paid or not. I have users ...
1
vote
1
answer
291
views
How to keep the test data from leaking into the training process of a machine learning algorithm?
I read in many different sources that I need to split my data into a training set and a test set. Then I have to make sure that the algorithm is trained only on the training data, and do my best to ...
0
votes
2
answers
1k
views
Frequency/Count encoding
How do I perform frequency/count encoding for a train and test set?
The implementations of this encoding I've seen simply frequency encode the categorical variables on a particular dataset (no ...
1
vote
1
answer
106
views
Will historical data lead to target leakage?
I'm bulding a employee churn model. I've employee data from 2016 to 2019 (of people who stayed/left the company), my goal is to train using data from 2016 to 2018 and predict on 2019.
Since there's ...
1
vote
2
answers
111
views
Is it safe to use labels created from unsupervised model to train a supervised model using the same data?
I have a dataset where I have to detect anomalies. Now, I use a subset of the data(let's call that subset A) and apply the DBSCAN algorithm to detect anomalies on set A.Once the anomalies are detected,...
3
votes
2
answers
184
views
Manual feature engineering based on the output
So, I'm working on a ML model that would have as potential predictors : age , a code for his city , his social status ( married / single and so on ) , number of his children and the output signed ...
3
votes
1
answer
540
views
Is normalizing the validation set of time series a kind of look ahead bias?
Here's the data normalization process of a time series in a paper about stock prediction using LSTM:
Split train and test set based on time (e.g. training set: 2001-2010, test set:2011-2012). This ...
7
votes
1
answer
1k
views
How to deal with possible data leakage in time series data?
I have historical consumer data who have taken out a loan at some point in time. The task is to predict if a consumer will default when requesting a loan.
My issue is that for some customer in the ...
1
vote
1
answer
200
views
Data leakage and predictive models: should we use past predictions as a feature?
I want to develop a Random Forest Classifier model to predict whether or not a customer will convert 7 days from today. The model is re-trained once a week and makes predictions for the following week....
3
votes
2
answers
210
views
Can preprocessing the whole population cause data leakage?
Introduction
I understand the problem of data leakage that could be caused by the preprocessing step when our training and test sets are just samples of an unknown population. The preprocessing ...
1
vote
1
answer
344
views
Dropping less frequently used categorical data?
I'm new to the datascience field and working on an assignment. I have a dataset with 150K rows with a categorical and numerical data, the target is a boolean. A categorical column consist of quite ...
3
votes
2
answers
148
views
What is the difference between data leakage and endogeneity?
I have the impression the former is used in ML whereas the latter is used in econometrics. They both carry the idea that information from the target is "leaking" in explanatory variables.
Is there ...
2
votes
0
answers
58
views
information leakage when using empirical Bayesian to generate a predictor
Consider the following problem: I want to predict the next bat of a set of baseball player. I have a training data set, where it contains the historical bat records (0-1 encoded, which is our target ...
2
votes
1
answer
106
views
classification feature selection
I have a system which sends invitations to users to participate in online questionnaires and want to use machine learning in order to predict the likelihood of fulfilling the questionnaires in a ...