'How to get the list of matched featured names along with the predict_prob in CalibratedClassifierCV?
I am trying to find the profanity score of a given text which is received on the chats. For this is I went through a couple of python(base) libraries and found some of the relevant ones as:
alt-profanity-check -- (currently using)
Now, The one which I am using (profanity-check) is giving me proper results when using predict and predict_prob against the calibrated_classifier used underhood after training.
The problem is that I am unable to identify the words which were used to give the prediction or calculate the probability. In short the list of feature names (profane words) used in the test data when passed as an input.
I know there are no methods to return the same, but I would like to fork and use the library. I wanted to understand if we can add something to this place (edit) to create a method for the same.
e.g
text = ["this is crap"]
predict([text]) - array([1])
predict_prob([text]) - array([0.99868968])
> predict_words([text]) - array(["crap"]) ---- (NEED THIS)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
