supervised machine learning """create dataset from file separator is the character that separates the attributes num_train is number specifying the first num_train tuples are trainingor none prob_test is the probability an example should in the test set (if num_train is nonehas_header is true if the first line of file is header target_index specifies which feature is the target boolean_features specifies whether we want to create boolean features (if falseit uses the original featurescategorical is set (or listof features that should be treated as categorical target_type is either none for automatic detection of target type or one of "numerical""boolean""cartegoricalinclude_only is list or set of indexes of columns to include ""self boolean_features boolean_features with open(file_name,' ',newline=''as csvfileself display( ,"loading",file_namedata_all csv reader(csvfile,delimiter=separatorfor more complicated csv files data_all (line strip(split(separatorfor line in csvfileif include_only is not nonedata_all ([ for ( ,vin enumerate(lineif in include_onlyfor line in data_allif has_headerheader next(data_allelseheader none data_tuples (interpret_elements(dfor in data_all if len( )> if num_train is not nonetraining set is divided into training then text examples the file is only read onceand the data is placed in appropriate list train [for in range(num_train)will give an error if insufficient examples train append(next(data_tuples)test list(data_tuplesdata_set __init__(self,traintest=testtarget_index=target_index,header=headerelserandomly assign training and test examples data_set __init__(self,data_tuplestest=noneprob_test=prob_testtarget_index=target_indexheader=headerseed=seedtarget_type=target_typethe following class is used for datasets where the training and test are in difversion june