public class LIMEColumnar extends LIMEBase implements ColumnarExplainer<Regressor>
If the supplied RowProcessor
doesn't reference any text or binarised fields
then it delegates to LIMEBase.explain(org.tribuo.Example<org.tribuo.classification.Label>)
, though it's still more expensive at
construction time.
See:
Ribeiro MT, Singh S, Guestrin C. "Why should I trust you?: Explaining the predictions of any classifier" Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining 2016.
DISTANCE_DELTA, evaluator, explanationTrainer, innerModel, kernelWidth, numSamples, numTrainingExamples, regressionFactory, rng, WIDTH_CONSTANT
Constructor and Description |
---|
LIMEColumnar(SplittableRandom rng,
Model<Label> innerModel,
SparseTrainer<Regressor> explanationTrainer,
int numSamples,
RowProcessor<Label> exampleGenerator,
Tokenizer tokenizer)
Constructs a LIME explainer for a model which uses the columnar data processing system.
|
Modifier and Type | Method and Description |
---|---|
LIMEExplanation |
explain(Map<String,String> input)
Explains the supplied data.
|
protected com.oracle.labs.mlrg.olcut.util.Pair<LIMEExplanation,List<Example<Regressor>>> |
explainWithSamples(Map<String,String> input) |
protected String |
nameFeature(String fieldName,
String name,
int idx)
Generate the feature name by combining the word and index.
|
explain, explainWithSamples, kernelDist, measureDistance, samplePoint, trainExplainer, transformOutput
public LIMEColumnar(SplittableRandom rng, Model<Label> innerModel, SparseTrainer<Regressor> explanationTrainer, int numSamples, RowProcessor<Label> exampleGenerator, Tokenizer tokenizer)
rng
- The rng to use for sampling.innerModel
- The model to explain.explanationTrainer
- The trainer for the sparse model used to explain.numSamples
- The number of samples to generate in each explanation.exampleGenerator
- The RowProcessor
which converts columnar data into an Example
.tokenizer
- The tokenizer to use on any text fields.public LIMEExplanation explain(Map<String,String> input)
ColumnarExplainer
Example
using a RowProcessor
, before being
supplied to the internal Model
.explain
in interface ColumnarExplainer<Regressor>
input
- The data to explain.protected com.oracle.labs.mlrg.olcut.util.Pair<LIMEExplanation,List<Example<Regressor>>> explainWithSamples(Map<String,String> input)
protected String nameFeature(String fieldName, String name, int idx)
fieldName
- The name of the column this text feature came from.name
- The word.idx
- The index.Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.