Ejemplo n.º 1
0
    def test_figure(self):
        report = Report(
            self.data,
            self.cols,
            model_name=self.model_name,
            dataset_name=self.dataset_name,
        )

        # Original unsorted data should cause an error
        self.assertRaises(ValueError, report.figure)

        # Sort should resolve that error
        report.sort()
        try:
            report.figure()
        except ValueError:
            self.fail("report.figure() raised ValueError unexpectedly!")
Ejemplo n.º 2
0
    def test_display(self):
        report = Report(
            self.data,
            self.cols,
            model_name=self.model_name,
            dataset_name=self.dataset_name,
        )

        report.sort()
        figure = report.figure()
        figure.show()

        report.sort(category_order={"Cat C": 1, "Cat A": 2, "Cat B": 3})
        report.rename(slice_map={"Slice A": "A"}, category_map={"Cat B": "B"})
        report.filter(slices=["A", "Slice B", "Slice C"])
        report.set_range("f1", 0.05, 0.45)
        report.update_config(font_size_heading=16)
        figure = report.figure(show_title=True)
        figure.show()
Ejemplo n.º 3
0
 def test_display_2(self):
     data = pd.DataFrame([
         [
             "Eval",
             "snli1",
             0.8799999952316284,
             0.876409113407135,
             [0.368, 0.304, 0.328],
             [0.344, 0.288, 0.368],
             125,
         ],
         [
             "Eval",
             "snli2",
             0.8799999952316284,
             0.876409113407135,
             [0.368, 0.304, 0.328],
             [0.344, 0.288, 0.368],
             125,
         ],
         [
             "Eval",
             "snli3",
             0.8799999952316284,
             0.876409113407135,
             [0.368, 0.304, 0.328],
             [0.344, 0.288, 0.368],
             125,
         ],
     ])
     cols = [
         ScoreColumn("F1", min_val=0, max_val=1, is_0_to_1=True),
         ScoreColumn("Accuracy", min_val=0, max_val=1, is_0_to_1=True),
         ClassDistributionColumn("Class Dist", ["e", "n", "c"]),
         ClassDistributionColumn("Pred Dist", ["e", "n", "c"]),
         NumericColumn("Size"),
     ]
     report = Report(data, cols)
     report.figure().show()