I have a 2D numpy-array as input for a basic sigmoid-classifier. I would like the classifier to return an array with the probabilities.
import numpy as np
def sigmoid(x):
sigm = 1 / (1 + np.exp(-x))
return sigm
def p(D, w, b):
prob=sigmoid(np.dot(D[:][7],w)+b)
return prob
How can I change p() so that it returns a 1D numpy array with the probabilities listed in order of the input data ?
Atm "prob" is an array of length 14, however the input array "D" is over 400 in size, so there is an error somewhere in the logic.