In the week 3 coding exercise, we have planar data.

This data contains two classes;

The shape of X is: (2, 400)

The shape of Y is: (1, 400)

I have m = 400 training examples!

When we train the logistic regression model why do we transpose X and Y? I thought that the training examples are already stacked horizontally to the right. Transposing this will result in a matrix with 2 columns each representing a class. Can someone please help me get an intuition of why we do this?

# Train the logistic regression classifier

clf = sklearn.linear_model.LogisticRegressionCV();

clf.fit(X.T, Y.T);