Skip to content
Advertisement

Tag: pipeline

Make available .best_params_ after pipeline

How to go about making available the clf.best_params_ after carrying a pipeline? For the code I have below, I get an: AttributeError: ‘GridSearchCV’ object has no attribute ‘best_params_’ Here is my code: Answer Your clf is never fitted. You probably meant clf.fit(X_train,y_train). Also, np.linspace(10,50,11) yields floats, while max_depth expects ints, so this may fail and you should probably add a

Extracting feature names from sklearn column transformer

I’m using sklearn.pipeline to transform my features and fit a model, so my general flow looks like this: column transformer –> general pipeline –> model. I would like to be able to extract feature names from the column transformer (since the following step, general pipeline applies the same transformation to all columns, e.g. nan_to_zero) and use them for model explainability

Scrapy can’t find items

I am currently still learning Scrapy and trying to work with pipelines and ItemLoader. However, I currently have the problem that the spider shows that Item.py does not exist. What exactly am I doing wrong and why am I not getting any data from the spider into my pipeline? Running the Spider without importing the items works fine. The Pipeline

NoSuchElementException: Failed to find a default value for layers in MultiLayerPerceptronClassifier

I am having a problem running a prediction using a saved MultiLayerPerceptronClassifier model. It throws error: The original mlpc in the pipeline had layers defined: My attempts to solve it: If I run the pipeline model and do predictions without first saving the model. I works with no error. But saving and re-using the model throws this error. Any help

Advertisement