Результаты, которые я получаю в связи с проблемой связывания записей, классифицируют больше значений как ложно-положительные, чем ложно-отрицательные.Есть ли способ сбалансировать это?
# Initialize the classifier
logreg = rl.LogisticRegressionClassifier()
# Train the classifier
logreg.fit(golden_pairs, golden_matches_index)
print ("Intercept: ", logreg.intercept)
print ("Coefficients: ", logreg.coefficients)
# Predict the match status for all record pairs
result_logreg = logreg.predict(test_pairs[columns_to_keep])
len(result_logreg)
#true_links = features_complete_new_index[features_complete_new_index['evaluation'] == True].index
true_links = test_pairs[test_pairs['evaluation'] == True].index
print("confusion matrix of Logistic Regression ",rl.confusion_matrix(true_links, result_logreg, len(test_pairs)), "False positives ", rl.false_positives(true_links, result_logreg), "False negatives ", rl.false_negatives(true_links, result_logreg))
The output is Intercept: -6.974042394356818
Coefficients: [-0.07818545 7.83113994 0.96939354 -6.97404239 1.65737031 0.694744 ]
confusion matrix of Logistic Regression [[ 5915 2576]
[ 1075 7167134]] False positives 1075 False negatives 2576
F-Score of Log Regr 0.7641625218009173