Пример #1
0
 def test_accuracy_string_index(self):
     sample_ids = ["V01", "V02", "V03", "V04"]
     results = pd.Series(["a", "b", "c", "a"], index=sample_ids)
     labels = pd.Series(["a", "b", "c", "b"], index=sample_ids)
     dataset = self.create_dataset(labels, sample_ids=sample_ids)
     classified = ClassifiedDataSet(dataset, results)
     self.assertAlmostEqual(classified.compute_accuracy(), 0.75, places=2)
Пример #2
0
 def test_accuracy_string_index(self):
     sample_ids = ["V01", "V02", "V03", "V04"]
     results = pd.Series(["a", "b", "c", "a"], index=sample_ids)
     labels = pd.Series(["a", "b", "c", "b"], index=sample_ids)
     dataset = self.create_dataset(labels, sample_ids=sample_ids)
     classified = ClassifiedDataSet(dataset, results)
     self.assertAlmostEqual(classified.compute_accuracy(), 0.75, places=2)
Пример #3
0
 def test_accuracy_integer_index(self):
     dataset = self.create_dataset(labels=["a", "b", "c", "b"])
     classified = ClassifiedDataSet(dataset, 
                                    pd.Series(["a", "b", "c", "a"]))
     self.assertAlmostEqual(classified.compute_accuracy(), 0.75, places=2)
Пример #4
0
 def test_accuracy_integer_index(self):
     dataset = self.create_dataset(labels=["a", "b", "c", "b"])
     classified = ClassifiedDataSet(dataset, pd.Series(["a", "b", "c",
                                                        "a"]))
     self.assertAlmostEqual(classified.compute_accuracy(), 0.75, places=2)