(ainitialize the classes with actual examplesso that the classes will not start empty (do the classes become empty?(bin class predictionwe test whether the code is emptyand make prediction of for an empty class it is possible to make different prediction to "stealan example (but you should make sure that class has consistent value for each feature in loopmake your own suggestionsand compare it with the originaland whichever of these you think may work better em in the following definitiona classcis integer in range [ num classesi is an index of featureso feat[iis the ith featureand feature is function from tuples to values val is value of feature model consists of listswhich form the sufficient statisticsclass counts is list such that class counts[cis the number of tuples with class cwhere each tuple is weighted by its probabilityi class counts[cp(tt:class( )= feature counts is list such that feature counts[ ][val][cis the weighted count of the number of tuples with feat[ ](tval and class(tceach tuple is weighted by its probabilityi feature counts[ ][val][cp(tt:feat[ ]( )=val andclass( )= learnem py -em learning from learnproblem import data_setlearnerdata_from_file import random import math import matplotlib pyplot as plt class em_learner(learner)def __init__(self,datasetnum_classes)self dataset dataset self num_classes num_classes self class_counts none self feature_counts none the function em step goes though the training examplesand updates these counts the first time it is runwhen there is no modelit uses random distributions version june