#NEWLINE# def _partial_fit( self , X , y , alpha , C , loss , learning_rate , n_iter , classes , sample_weight , coef_init , intercept_init ) : #NEWLINE# #INDENT# ( X , y ) = check_X_y ( X , y , 'csr' , dtype = np . float64 , order = 'C' ) #NEWLINE# ( n_samples , n_features ) = X . shape #NEWLINE# self . _validate_params ( ) #NEWLINE# _check_partial_fit_first_call ( self , classes ) #NEWLINE# n_classes = self . classes_ . shape [ 0 ] #NEWLINE# self . _expanded_class_weight = compute_class_weight ( self . class_weight , self . classes_ , y ) #NEWLINE# sample_weight = self . _validate_sample_weight ( sample_weight , n_samples ) #NEWLINE# if ( ( self . coef_ is None ) or ( coef_init is not None ) ) : #NEWLINE# #INDENT# self . _allocate_parameter_mem ( n_classes , n_features , coef_init , intercept_init ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( n_features != self . coef_ . shape [ ( - 1 ) ] ) : #NEWLINE# #INDENT# raise ValueError ( ( 'Number of features %d does not match previous data %d.' % ( n_features , self . coef_ . shape [ ( - 1 ) ] ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# self . loss_function = self . _get_loss_function ( loss ) #NEWLINE# if ( self . t_ is None ) : #NEWLINE# #INDENT# self . t_ = 1.0 #NEWLINE# #UNINDENT# if ( n_classes > 2 ) : #NEWLINE# #INDENT# self . _fit_multiclass ( X , y , alpha = alpha , C = C , learning_rate = learning_rate , sample_weight = sample_weight , n_iter = n_iter ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( n_classes == 2 ) : #NEWLINE# #INDENT# self . _fit_binary ( X , y , alpha = alpha , C = C , learning_rate = learning_rate , sample_weight = sample_weight , n_iter = n_iter ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( 'The number of class labels must be greater than one.' ) #NEWLINE# #UNINDENT# #UNINDENT# return self