Comments (5)
Are you sure pipe_stacking.predict_proba(test_data) works perfectly fine? In this line:
self.prob_result = [self.classifiers[0].predict_proba(X)[0][0], self.classifiers[1].predict_proba(X)[0][0], self.classifiers[2].predict_proba(X)[0][0], np.asarray(list( self.classifiers[3].predict_proba(X)))[0][0], np.asarray(list( self.classifiers[4].predict_proba(X)))[0][0]]
you seem to be taking the first row and first column ([0][0]) of the prediction probability for each classifier, regardless of the size of the input. That is, I think you'll always output one row in predict_proba, even if the input is 10 rows.
LimeTabular assumes the X in predict_proba can be a 2d array, not only a 1d array.
from lime.
This is a use case specific implementation, wherein the pipeline is used only for prediction against a single input vector. Henceforth the size of the input is one here. X in predict_proba comes after PCA, which is a 2d array. I have used the same training input matrix for initialization & used the same input data point against lime explainer built on Random forest earlier, it did work fine. It doesnt seem to work for the custom stacking implementation.
The error log has marked this an error;
--> 531 check_consistent_length(X, y)
ValueError: Found input variables with inconsistent numbers of samples: [44, 1]
from lime.
can you share a notebook with the error?
from lime.
Sure. I have shared the same to your inbox.
from lime.
Thanks for the right direction. Your previous correction was perfectly right, the stacking predict_proba function was returning only the first output. I had changed it to work on an array of any given size. Since the sample in my implementation was initialized with a size 44, the ideal output from the predict_proba from my stacking implementation should be (44x2).
from lime.
Related Issues (20)
- Is this Repo Maintained? HOT 2
- Can LIME only be used for text classification tasks?
- How to explain prediction for a data with just a few features (from all features of training dataset)? HOT 2
- Trying to explaine a simple Neural Network using LIME HOT 1
- submodular pick
- ans = self.domain_mapper.map_exp_ids(self.local_exp[label_to_use], **kwargs) KeyError: 1
- Getting error when my predict_fn is actually a method from a class HOT 1
- `show_in_notebook` shows no bars
- importance score for all tokens
- Unexpected keyword argument 'progress_bar' for lime_image.LimeImageExplainer().explain_instance()
- Issues with LIME Implementation in Image Classification
- How to use lime with 3 dim time series data and lstm
- Distances derivation, explain_instance() method in Tabular LIME
- How to handle binary features
- RecurrentTabularExplainer for regression task
- Question: using LIME for text generation HOT 1
- LIME and multi-correlated variables
- update Python support
- Inverse scaling/ normalization to get actual unscaled values in explanation : Old issue but I made a way around
- Met the issue about TypeError when using lime_image.LimeImageExplainer()
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lime.