(answers, encoder)
return Y
Converts string objects to class labels

	Input:
	answers:	a list of unicode objects
	encoder:	a scikit-learn LabelEncoder object

	Output:
	A numpy array of shape (nb_samples, nb_classes)
Converts string objects to class labels
Converts string objects to class labels
def get_answers_matrix(answers, encoder):
	'''
	Converts string objects to class labels

	Input:
	answers:	a list of unicode objects
	encoder:	a scikit-learn LabelEncoder object

	Output:
	A numpy array of shape (nb_samples, nb_classes)
	'''
	assert not isinstance(answers, basestring)
	y = encoder.transform(answers) #string to numerical class
	nb_classes = encoder.classes_.shape[0]
	Y = np_utils.to_categorical(y, nb_classes)
	return Y
def get_answers_matrix ( answers , encoder ) : assert not isinstance ( answers , basestring ) y = encoder . transform ( answers ) #string to numerical class nb_classes = encoder . classes_ . shape [ 0 ] Y = np_utils . to_categorical ( y , nb_classes ) return Y