ferent files learnproblem py -(continued class data_from_files(data_set)def __init__(selftrain_file_nametest_file_nameseparator=','has_header=falsetarget_index= boolean_features=truecategorical=[]target_typenoneinclude_only=none)"""create dataset from separate training and 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(train_file_name,' ',newline=''as train_filewith open(test_file_name,' ',newline=''as test_filedata_all csv reader(csvfile,delimiter=separatorfor more complicated csv files train_data (line strip(split(separatorfor line in train_filetest_data (line strip(split(separatorfor line in test_fileif include_only is not nonetrain_data ([ for ( ,vin enumerate(lineif in include_onlyfor line in train_datatest_data ([ for ( ,vin enumerate(lineif in include_onlyfor line in test_dataif has_headerthis assumes the training file has header and the test file doesn' header next(train_dataelseheader none train_tuples [interpret_elements(dfor in train_data if len( )> test_tuples [interpret_elements(dfor in test_data if len( )> data_set __init__(self,train_tuplestest_tuplestarget_index=target_indexheader=headerversion june