Der Versuch, ein logistisches Regressionsmodell für das Iris-Dataset zu erstellen, ist nicht geeignet. Was stimmt nicht mit dem Code? Danke ..Ein logistisches Regressionsmodell für den Iris-Datensatz kann nicht passen
# Dependencies used: numpy, matpotlib.pyplot, csv
# dataset: Iris
# Binary classification using gradient descent
# python 3.5
# input data matrix = x(99 X 1) # including ones vector
# discrete output data matrix = y(99 X 1)
# parameters matrix = theta(5 X 1)
for j in range(3500):
# hypothesis function
h = 1/(1 + np.exp(-x.dot(theta)))
# gradient descent
theta = theta - (0.00001/m) * np.sum(x.T.dot(h - y)) + (30.0/m)*np.sum(np.sum(theta[1:5, :]**2))
# cost function
cost = -(1/m) * np.sum(y.T.dot(np.log(h)) + (1-y).T.dot(np.log(1-h)))
j_iter.append(cost)
Iter.append(j)
Dies fehlt [mcve]. – ImportanceOfBeingErnest