60
61classifier = get_classifier(classifier_name,d)
62
63x_train,x_test,y_train,y_test = train_test_split(x,y,test_size = 0.2, random_state=1234)64classifier.fit(x_train,y_train)
65y_pred = classifier.predict(x_test)
66acc = accuracy_score(y_test,y_pred)
60
61classifier = get_classifier(classifier_name,d)
62
63x_train,x_test,y_train,y_test = train_test_split(x,y,test_size = 0.2, random_state=1234)64classifier.fit(x_train,y_train)
65y_pred = classifier.predict(x_test)
66acc = accuracy_score(y_test,y_pred)
55 if classifier_name == "SVM":
56 classifier = SVC(C = d['C'])
57 if classifier_name == "Random Forest":
58 classifier = RandomForestClassifier(n_estimators=d["Number of Estimators"], max_depth=d["Max Depth"], random_state = 1234)59 return classifier
60
61classifier = get_classifier(classifier_name,d)
55 if classifier_name == "SVM":
56 classifier = SVC(C = d['C'])
57 if classifier_name == "Random Forest":
58 classifier = RandomForestClassifier(n_estimators=d["Number of Estimators"], max_depth=d["Max Depth"], random_state = 1234)59 return classifier
60
61classifier = get_classifier(classifier_name,d)
53 if classifier_name == 'KNN':
54 classifier = KNeighborsClassifier(n_neighbors = d['K'])
55 if classifier_name == "SVM":
56 classifier = SVC(C = d['C'])57 if classifier_name == "Random Forest":
58 classifier = RandomForestClassifier(n_estimators=d["Number of Estimators"], max_depth=d["Max Depth"], random_state = 1234)
59 return classifier
There should be no spaces before or after the =
in a function definition.