Syntax in Python (.T)

The .T accesses the attribute T of the object, which happens to be a NumPy array. The T attribute is the transpose of the array, see the documentation. Apparently you are creating random coordinates in the plane. The output of multivariate_normal() might look like this: The transpose of this matrix is: which can be conveniently separated in x and y parts by sequence unpacking.

LogisticRegression: Unknown label type: ‘continuous’ using sklearn in python

You are passing floats to a classifier which expects categorical values as the target vector. If you convert it to int it will be accepted as input (although it will be questionable if that’s the right way to do it). It would be better to convert your training scores by using scikit’s labelEncoder function. The … Read more