Questions tagged [pipelines]

A pipeline is a sequence of functions (or the equivalent thereof), composed so that the output of one is input for the next, in order to create a compound transformation. Famously, a shell pipeline looks like "command | command2 | command3" (but use the tag "pipe" for this). It's also used in computer architecture to define a sequence of serial stages that execute in parallel over elements being fed into a pipe, in order to increase the overall throughput.

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

When I use imblearn pipeline instead of sklearn pipeline all textual features disappear. Any solution?

This is my code below, I need to use SMOTENC to balance the dataset, which means I have to use the pipeline from the imblearn library. However, it does not recognize the CountVectorizer features ...
user avatar
0 votes
1 answer
27 views

Need an example of a custom class whose instance is fed to sklearn Pipeline / make_pipeline to use with GridSearchCV

According to sklearn.pipeline.Pipeline documentation, the class whose instance is a pipeline element should implement fit() and transform(). I managed to create a custom class that has these methods ...
user avatar
  • 131
0 votes
0 answers
17 views

Can anyone tell me why is my pipeline wrong?

I am trying to build a pipeline in order to perform GridSearchCV to find the best parameters. I already split the data into train and validation and have the following code: ...
user avatar
1 vote
2 answers
47 views

I cannot work out the benefits of a pipeline over a linear sequence of code instructions

I've looked at quite a number of how to 'create a pipeline' instructions, but I have yet to see an explanation of the benefits over what I am showing below. To keep my example code agnostic I'll use ...
user avatar
  • 111
0 votes
0 answers
93 views

Pass information between pipeline steps in sklearn

I am working on a simple text generation problem with LSTMs. To make the preprocessing more compact and reproducible, I decided to implement everything in sklearn fashion, using custom sklearn ...
user avatar
  • 259
0 votes
1 answer
81 views

Dynamic creation of sklearn pipeline

I am trying to create an automatic pipeline builder functionality that takes into account a large set of conditions such as the existence of missing values, the scale of numerical features, etc., and ...
user avatar
  • 259
0 votes
0 answers
47 views

How to retrain sklearn pipeline with new data?

I have trained and saved a data processing pipeline and an LGBM regressor on 3 months of historical data. Now I know that I can retrain the LGBM regressor on new data every day by passing my trained ...
user avatar
0 votes
1 answer
57 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)? ...
user avatar
0 votes
0 answers
29 views

Does sklearn.pipeline have a single mechanism for cross-validation regardless of model API?

With a single standard interface (sklearn.pipeline) on top of different regressors, how do I use cross-validation? The example below uses two regressors with different internal cross-validation ...
user avatar
0 votes
1 answer
108 views

Custom vectorizer transformer in sklearn with cross validation

I created a custom transformer class called Vectorizer() that inherits from sklearn's ...
user avatar
  • 259
0 votes
1 answer
24 views

Explaining the logic behind the pipe_line method for cross-validation of imbalance datasets

Reading the following article: https://kiwidamien.github.io/how-to-do-cross-validation-when-upsampling-data.html There is an explanation of how to use ...
user avatar
  • 101
0 votes
1 answer
96 views

How to combine preprocessor/estimator selection with hyperparameter tuning using sklearn pipelines?

I'm aware of how to use sklearn.pipeline.Pipeline() for simple and slightly more complicated use cases alike. I know how to set up pipelines for homogeneous as well ...
user avatar
  • 259
0 votes
1 answer
48 views

Custom preprocessing using piplines

I have searched a lot for this issue but unfortunately came up with nothing. Usually in a ML model, during preprocessing, we use Pipelines and ...
user avatar
  • 1,261
1 vote
1 answer
153 views

ColumnTransformer worse performance than sklearn pipeline

I have an (unbalanced , binary data) pipeline model consisting of two pipelines (preprocessing and the actual model). Now I wanted to include SimpleImputer into my ...
user avatar
1 vote
2 answers
172 views

Deep Neural Network Model in sklearn Pipeline

Is it possible to add a deep neural network model as the estimator/model in an sklearn Pipeline? or is it only possible for ML models as the estimator. For example, ...
user avatar
  • 258
0 votes
0 answers
483 views

Shap after scikit pipeline - feature name

I'm using pipeline to transform data and predict model and I want to apply SHAP after that. However, when I apply it, it returns SHAP chart just fine, but the name of the feature are like feature 1, ...
user avatar
  • 21
1 vote
1 answer
670 views

How can I get the dataframe after scikit pipeline?

I'm making many data transformations and fitting a model using scikit pipeline, but I need to extract X_train and X_test right after transformations (imputer, encoding, etc) in order to use it for ...
user avatar
  • 21
1 vote
1 answer
41 views

when I only give command 'fit', my class does 'transform' too

I have created 2 classes, first of which is: ...
user avatar
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 ...
user avatar
0 votes
2 answers
2k views

AttributeError: 'numpy.ndarray' object has no attribute 'fit' [closed]

I am relatively new to ML and in the process of learning pipelines. I am creating a pipeline of custom transformers and get this error: AttributeError: 'numpy.ndarray' object has no attribute 'fit'. ...
user avatar
0 votes
1 answer
734 views

How to get column names after One Hot Encoding when using Pipelines?

I am using Pipeline and ColumnTransformer to preprocess the data. Basically I am using them to impute null values, scale the ...
user avatar
  • 1,261
1 vote
2 answers
67 views

unsupervised anomaly detection for univariate fast frequency time series data?

I have a univariate time series (there is a value for each time sampling) (sampling time: 66.66 micro second, number of samples/sampling time=151) coming from a scala customer This time series ...
user avatar
  • 1,526
0 votes
1 answer
22 views

determining size of batch, time of sending and memory in to send from scala to ML section

I have a time series (sampling time: 66.66 micro second, number of samples/sampling time=151), I would like to determine some anomalies in them, the inputs are made by scala customer message bus. ...
user avatar
  • 1,526
0 votes
0 answers
219 views

Pipelines with categorical and nan values

I am trying a Regression model on a dataset which has categorical and numerical variables along with nan values. I want to use Pipelines for imputation and encoding purposes. Now I have a few ...
user avatar
  • 1,261
1 vote
1 answer
74 views

Alternative to EC2 for running ML batch training jobs on AWS

We are building an ML pipeline on AWS, which will obviously require some heavy-compute components including preprocessing and batch training. Most the the pipeline is on Lambda, but Lambda is known to ...
user avatar
1 vote
0 answers
73 views

Data Pipeline Best Practices

I am looking more for concepts or pointed in the right direction for best practices for a project I am working on. I am currently playing around with Luigi for a data pipeline. I followed the tutorial ...
user avatar
  • 11
1 vote
1 answer
130 views

TPOT machine learning

I trained a regression TPOT algorithm on Google Colab, where the output of the TPOT process is some boiler plate Python code as shown below. ...
user avatar
  • 359
1 vote
0 answers
22 views

Working with others: Tidy data vs Pretty data [closed]

When working with someone whose background and skill level in data work may not be strong, how do you best make the argument for tidy data over "pretty" data? There are notes of what I want ...
user avatar
1 vote
1 answer
356 views

How to use SMOTE in Stacking in SKLearn?

I have a data set X,y and split them to train and test data. ...
user avatar
  • 181
2 votes
1 answer
4k views

Why GridSearchCV returns nan?

I am using gridsearchcv to tune the parameters of my model and I also use pipeline and cross-validation. When I run the model to tune the parameter of XGBoost, it returns ...
user avatar
  • 181
1 vote
1 answer
125 views

cost-complexity-pruning-path with pipeline

I'm using Kaggle's titanic set. I'm using pieplines and I'm trying to prune my decision tree and for that I want the cost_complexity_pruning_path. The last line of code produces the error: ...
user avatar
0 votes
1 answer
681 views

How to remove features from a sklearn pipeline after it has already been fitted?

Background: I have created a basic modeling workflow in sklearn that utilizes sklearn's pipeline object. There are some preprocessing steps within the pipeline, and the last step of the pipeline is to ...
user avatar
1 vote
0 answers
46 views

Data Lineage/Traceability in Pipelines

I want to collect information about: 1) from which single data signals a feature is composed in a ML pipeline and 2) what data preprocessing operations are/were executed on a data signal. Does anyone ...
user avatar
2 votes
2 answers
325 views

Is it good practice to include data cleaning or feature engineering steps in an sklearn pipeline to create a scalable pipeline?

I am working on implementing a scalable pipeline for cleaning my data and pre-processing it before modeling. I am pretty comfortable with the sklearn Pipeline ...
user avatar
  • 156
0 votes
1 answer
23 views

How is the target variable passed to the final estimator in this pipeline?

There is a pipeline like below. X is features and y is the target variable. I would like to know how ...
user avatar
0 votes
0 answers
17 views

Create a pipeline for recursive eliminartion using artifical neural nets

I am trying to use RFE with Artificial neural nets but I am getting the error that "'Sequential' object has no attribute '_get_tags'" . Here is my code snippet. Any help would be appreciated....
user avatar
0 votes
1 answer
61 views

Compare cross validation and test set results

I am having a hard time understanding the results of a cross validation test and a test run on a test set. First I made the following pipeline: ...
user avatar
-1 votes
1 answer
136 views

Deep Learning Pipeline motivation

A Deep Learning Pipeline consists of the following 5 points: Define and prepare problem Summarize and understand data Process and prepare data Evaluate algorithms Improve results Here is the source: ...
user avatar
  • 129
1 vote
2 answers
1k views

sklearn - How to create a sequential pipeline

Update: The examples in this post were updated I am reposting this question here after not getting a clear answer in a previous SO post I am looking for a help building a data preprocessing pipleline ...
user avatar
0 votes
0 answers
90 views

Apply two different Sklearn classifiers to two different subsets of the same data

I have a dataset that I need to run through a classification Pipeline. The dataset has 2 types of rows: described: description column POPULATED non-described: <...
user avatar
0 votes
2 answers
27 views

Selecting Transforms with sklearn pipelines

So I am currently working on a Data set, and I want to use Pipelines to select the transforms. Here is an example of what I want to do : ...
user avatar
7 votes
2 answers
873 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 ...
user avatar
2 votes
1 answer
581 views

How to restrict the columns to be passed to final classifier in PMML Pipeline

I am working on building XGBoost PMML using SKLearn and SKLearn2PMML. I am having some numerical,somecategorical and datetime columns from which i am creating new feature inside the pipeline. When i ...
user avatar
1 vote
1 answer
869 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). ...
user avatar
  • 11
1 vote
1 answer
336 views

How to use ColumnTransformer and FunctionTransformer to apply the same function to many columns, but separately?

I want to apply pd.cut as a transformer in a pipeline, like this: ...
user avatar
  • 191
0 votes
2 answers
289 views

Error when trying to run RandomForestClassifer with Pipieline and GridSearch [closed]

I am trying to run a RandomForest Classifier using Pipeline, GridSerach and CV I am getting an error when I fit the data. I am not sure how to fix it. Will appreciate any help on this. My code is: ...
user avatar
  • 243
1 vote
1 answer
323 views

How does imblearn apply the transformations during prediction?

Let's say I have a sklearn pipeline that: Imputes the data Randomly oversamples the minority class ...
user avatar
0 votes
1 answer
196 views

Google DataFlow

I'm trying to build a Google dataflow pipeline through one of the posts in Medium. https://levelup.gitconnected.com/scaling-scikit-learn-with-apache-beam-251eb6fcf75b However, it seems like I'm ...
user avatar
  • 103
1 vote
0 answers
17 views

Efficient way of adding new columns to datamart without reprocessing complete pipeline

I have a software engineering background and relatively new to data engineering. I am building out tables/datamarts in our datalake for data scientists and analysts to use. We use Airflow for ...
user avatar
  • 11
2 votes
1 answer
1k views

sklearn - SimpleImputer in an empty Pipeline

When building a Pipeline I'm ending up at a scenario that can be simplified like this: FeatureUnion(NumericalPipeline(steps), CategoricalPipeline(steps)) Since this is one intermediary step in a ...
user avatar
  • 121