what-if-tool icon indicating copy to clipboard operation
what-if-tool copied to clipboard

Multiclass classification

Open swaticolab opened this issue 2 years ago • 1 comments

Hi Team,

I see that there is one demo prepared for the multiclass classification of Iris dataset. I was trying to do the same, and added the option of .set_multi_class(True)in the WitConfigBuilder. But in my output report I am seeing the page as below:

image

This output does not see right. Is there something that I am missing. Below is the adjust_prediction function i am using:

def adjust_prediction(x):
  x_df = pd.DataFrame(x, columns=data.columns.tolist())
  return bst.predict_proba(x_df)

Is there any sample notebook running behind Iris demo?

swaticolab avatar Apr 19 '22 12:04 swaticolab

I believe your problem will be solved if you provide WIT with a label vocab that converts the class indicies for your prediction lists into readable names. See the last cell in https://colab.sandbox.google.com/github/pair-code/what-if-tool/blob/master/WIT_Model_Comparison.ipynb#scrollTo=NUQVro76e38Q for example.

You will call something like .set_label_vocab(['Setosa', 'Versicolor', 'Verginica']) when constructing the wit widget.

jameswex avatar Apr 25 '22 17:04 jameswex