Created
September 2, 2019 01:08
-
-
Save prrao87/773fab7dc5f76cf3aece01d316867cf0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ExampleExplainer: | |
| """Class to explain classification results. | |
| The `predict` method outputs a numpy array of floats, which | |
| is the classifier's prediction probability for each class. | |
| """ | |
| def __init__(self, path_to_model: str) -> None: | |
| # Load in a trained classifier model | |
| def predict(self, texts: List[str]) -> np.array([float, ...]): | |
| # Take in a list of strings (LIME text sample of variations) | |
| ... | |
| # Output class probabilities as a numpy array | |
| return np.array(predict_proba) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment