python使用sklearn逻辑回归示例代码
代码语言:python
所属分类:大数据分析
代码描述:python使用sklearn逻辑回归示例代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
#!/usr/local/python3/bin/python3 # -*- coding: utf-8 -* #!/usr/local/python3/bin/python3 # -*- coding: utf-8 -* from sklearn.preprocessing import PolynomialFeatures import numpy as np from sklearn.linear_model import LogisticRegression x = np.array([5, 15, 25, 35, 45, 55]).reshape((-1, 1)) y = np.array([5, 20, 14, 32, 22, 38]) #建模 model = LogisticRegression(random_state=0, solver='lbfgs', multi_class='ovr') model = model.fit(x,.........完整代码请登录后点击上方下载按钮下载查看
网友评论0