#NEWLINE# def _class_means( X , y ) : #NEWLINE# #INDENT# 'Compute class means.\n\n    Parameters\n    ----------\n    X : array-like, shape (n_samples, n_features)\n        Input data.\n\n    y : array-like, shape (n_samples,) or (n_samples, n_targets)\n        Target values.\n\n    Returns\n    -------\n    means : array-like, shape (n_features,)\n        Class means.\n    ' #NEWLINE# means = [ ] #NEWLINE# classes = np . unique ( y ) #NEWLINE# for group in classes : #NEWLINE# #INDENT# Xg = X [ ( y == group ) , : ] #NEWLINE# means . append ( Xg . mean ( 0 ) ) #NEWLINE# #UNINDENT# return np . asarray ( means )