1. 首页
  2. 人工智能
  3. 计算广告
  4. python实现逻辑回归的示例

python实现逻辑回归的示例

上传者: 2020-12-17 18:55:52上传 PDF文件 36.69KB 热度 12次
代码 import numpy as np import matplotlib.pyplot as plt from sklearn.datasets.samples_generator import make_classification def initialize_params(dims): w = np.zeros((dims, 1)) b = 0 return w, b def sigmoid(x): z = 1 / (1 + np.exp(-x)) return z def logistic(X, y, w, b): num_train = X.shape
用户评论