generated from LufsX/Experiment-LogReg
This commit is contained in:
+2
-1
@@ -33,7 +33,7 @@ from sklearn.linear_model import LogisticRegression
|
||||
from sklearn.metrics import accuracy_score, classification_report
|
||||
|
||||
# 读取数据
|
||||
data_path = '.\\data\\horse-colic.data'
|
||||
data_path = 'C:\\Users\\star\\Desktop\\机器学习\\experiment-log\\data\\horse-colic.data'
|
||||
data = pd.read_csv(data_path, header=None, delim_whitespace=True, na_values='?')
|
||||
|
||||
# 处理缺失值(用0填充)
|
||||
@@ -66,3 +66,4 @@ report = classification_report(y_test, y_pred)
|
||||
print(f"Accuracy: {accuracy:.2f}")
|
||||
print("Classification Report:")
|
||||
print(report)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user