#NEWLINE# def ExpectationMaximization( self , iterr = 10 ) : #NEWLINE# #INDENT# example_to_worker_label = self . example_to_worker_label #NEWLINE# worker_to_example_label = self . worker_to_example_label #NEWLINE# label_set = self . label_set #NEWLINE# label_to_priority_probability = self . InitPriorityProbability ( label_set ) #NEWLINE# worker_to_confusion_matrix = self . InitConfusionMatrix ( worker_to_example_label . keys ( ) , label_set ) #NEWLINE# while ( iterr > 0 ) : #NEWLINE# #INDENT# example_to_softlabel = self . ProbabilityMajorityVote ( example_to_worker_label , label_to_priority_probability , worker_to_confusion_matrix ) #NEWLINE# label_to_priority_probability = self . PriorityProbability ( example_to_softlabel ) #NEWLINE# worker_to_confusion_matrix = self . ConfusionMatrix ( worker_to_example_label , example_to_softlabel ) #NEWLINE# iterr -= 1 #NEWLINE# #UNINDENT# return ( example_to_softlabel , label_to_priority_probability , worker_to_confusion_matrix )