Я использую обычную модель SV C, и я получил хороший результат, затем я применил его снова с randomsearchcv, чтобы оптимизировать результат, но результаты еще хуже. это логично и как я могу получить разумные результаты?
это код
parameters = {"C": np. logspace(-1, 3, 100), "gamma": np.linspace(0.0001, 10, 100)}#differnet models has differnet parameters
#parameters = {'kernel':('linear', 'rbf'), 'C':[1, 10]}
svm = sklearn.svc.SVC()
clf_svm = RandomizedSearchCV(svm, parameters)
clf_svm.fit(x_train, y_train)
prediction = clf_svm.predict(x_test)
#report the result
print('Accuracy Score : ' + str(accuracy_score(y_test,prediction)))
print('Precision Score : ' + str(precision_score(y_test,prediction,average='micro')))
print('F1 Score : ' + str(f1_score(y_test,prediction, average='micro')))
print('Recall Score : ' + str(recall_score(y_test,prediction)))
# Create true and false positive rates for AUC of ROC
roc_auc = roc_auc_score(y_test, prediction)
fpr, tpr, _ = metrics.roc_curve(y_test, prediction)
print ("AUC of ROC Curve: {}\n ".format(roc_auc))
print(classification_report(y_test,prediction))
# plot roc
plt.subplots(1, figsize=(6,6))
plt.plot(fpr, tpr)
plt.title('RandomizedSearchCV-SVC ROC - AUC = %.4f'%roc_auc)
plt.plot([0, 1], ls="--")
plt.plot([0, 0], [1, 0] , c=".7"), plt.plot([1, 1] , c=".7")
plt.xlabel("False Positive Rate")
plt.ylabel("True Positive Rate")
plt.show()