generated from LufsX/Experiment-LogReg
This commit is contained in:
+1
-1
@@ -35,7 +35,7 @@ def train_logreg(X, y):
|
||||
model.fit(X_processed, y)
|
||||
return model # 返回训练好的模型
|
||||
|
||||
def predict_logreg(model, X):
|
||||
def predict_logreg(X, model):
|
||||
# 确保输入数据是一个 numpy 数组
|
||||
if len(X.shape) == 1:
|
||||
X = X.reshape(1, -1) # 保持输入数据的形状为 (1, n),符合模型的输入要求
|
||||
|
||||
Reference in New Issue
Block a user