Logit模型梯度下降的反向传播

时间:2019-03-05 13:04:04

标签: python pandas

如何使用Logit Model实现反向传播,因此需要90%的精度才能向后传播以进行将来的预测。 这是我的Python代码:

import pandas as pd

import numpy as np

import statsmodels.api as sm

from sklearn.model_selection import train_test_split

fields = ["articleStatus","keywordcount","avgKeywordSum","prominaceRatio"]

df=pd.read_csv("Processing_result.csv",skipinitialspace=True,usecols=fields)

X = df[['keywordcount','prominaceRatio']]
y = df[['articleStatus']]
y = np.ravel(y)
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state= 0)

X2 = sm.add_constant(X)

est = sm.Logit(y, X2)
est2 = est.fit()
print(est2.summary())

0 个答案:

没有答案