I have multiple functions to train different classifiers, each function returns some related output parametes. The execution time of each is slightly long, so I want to take advantage of multiprocessing
.
For example:
test_mthd = 'complete'
row_num = 288
prob_scores_ANN = test_ANN(test_dataset,test_labels, test_mthd, row_num,
input_hidden_weights, hidden_output_weights,
input_hidden_bias, hidden_output_bias)
predictions_KNN= eval_KNN(trainingSet,testSet, test_mthd, row_num)
Now,
from multiprocessing import Process
if __name__=='__main__':
p1 = Process(target=building_tree_CART(trainingSet, depth_cond=8, min_cond=1))
p1.start()
p2 = Process(target= train_ANN(training_data,training_labels))
p2.start()
p1.join()
p2.join()
Inspiration for this is from: LINK
I think its a typo error: I changed training
to target
, and p1
runs and then p2
starts. and how do we return values from each function?
Thanks, Gopi