Beispiel #1
0
    def O_Task(self):
        # Get a new knowledgeability table
        knowledgeability = Task.NKnowledgeability_Task(self.hypo_table,
                                                       self.num_hypo,
                                                       self.num_feature,
                                                       self.num_label,
                                                       self.knowledge)
        # knowledgeability = [self.delta_g_h]
        for n in range(len(knowledgeability)):
            print(knowledgeability[n])
            p, s = Task.Probability_Task(self.hypo_table, self.num_hypo,
                                         self.num_feature, self.num_label,
                                         copy.deepcopy(knowledgeability[n]),
                                         1000)
            print(p, s, sep="\n")
            Report.Plot_P(Task.Average_Hypo(p, self.num_hypo),
                          self.num_feature, n)

            # If reaches the identitly matrix, the loop will be ended
            if numpy.array_equal(knowledgeability[n],
                                 numpy.eye(self.num_hypo)):
                break
        mtp.legend()
        mtp.show()
        return