simple Logistic regression : everyone, i tried to solve a simple linear regression problem of two-dimensional classification.
Here I have a feature matrix X_expanded, which has a shape of [826,6], To classify objects we will obtain probability of object belongs to class '1'. To predict probability we will use output of linear model and logistic function.
And here is the function of compute probability. 

def probability(X, w):
    """
    Given input features and weights
    return predicted probabilities of y==1 given x, P(y=1|x), see description above
        
    Don't forget to use expand(X) function (where necessary) in this and subsequent functions.
    
    :param X: feature matrix X of shape [n_samples,6] (expanded)
    :param w: weight vector w of shape [6] for each of the expanded features
    :returns: an array of predicted probabilities in [0,1] interval.
    """

    # TODO:<your code here>
    X = X_expanded
    m = X.shape[0]
    w = np.zeros((m,1))
    Z = np.dot(w.T,X)
    P = 1./(1+np.exp(-Z))
  
    return P

For a simple test:
dummy_weights = np.linspace(-1, 1, 6)
ans_part1 = probability(X_expanded[:1, :], dummy_weights)[0]

But it always returns array([ 0.5,  0.5,  0.5,  0.5,  0.5,  0.5]).

Any Suggestion? Thank you very much.