我正在尝试拟合一个 SVM 模型,其中我的预测真实值是匹配的多索引。问题是我不知道如何指定多索引是真实值。
我不能使用记录链接分类步骤,因为它不是很灵活。
from sklearn.svm import SVC
golden_pairs = filter_tests_new_df[:training_value]
golden_matches_index = golden_pairs[golden_pairs['ev_2'] == 1].index
# This is a multiindex type
svm = SVC(gamma='auto')
svm.fit(golden_pairs, golden_matches_index)
# I dont know how to specify that the golden_matches_index are the good matches
# Predict the match status for all record pairs
result_svm = svm.predict(test_pairs[columns_to_keep])