#NEWLINE# def joint_feature( self , x , y , y_true = None ) : #NEWLINE# #INDENT# 'Compute joint feature vector of x and y.\n\n        Feature representation joint_feature, such that the energy of the configuration\n        (x, y) and a weight vector w is given by np.dot(w, joint_feature(x, y)).\n\n        Parameters\n        ----------\n        x : nd-array, shape=(n_features,)\n            Input sample features.\n\n        y : int\n            Class label. Between 0 and n_classes.\n\n        y_true : int\n            True class label. Needed if rescale_C==True.\n\n\n        Returns\n        -------\n        p : ndarray, shape (size_joint_feature,)\n            Feature vector associated with state (x, y).\n        ' #NEWLINE# result = np . zeros ( ( result . n_states , self . n_features ) ) #NEWLINE# result [ y , : ] = x #NEWLINE# if self . rescale_C : #NEWLINE# #INDENT# if ( y_true is None ) : #NEWLINE# #INDENT# raise ValueError ( 'rescale_C is true, but no y_true was passed to joint_feature.' ) #NEWLINE# #UNINDENT# result *= self . class_weight [ y_true ] #NEWLINE# #UNINDENT# return result . ravel ( )