#NEWLINE# def test_fm_sgd_classification( ) : #NEWLINE# #INDENT# ( w0 , w , V , y , X ) = get_test_problem ( task = 'classification' ) #NEWLINE# X_test = X . copy ( ) #NEWLINE# X_train = sp . csc_matrix ( X ) #NEWLINE# fm = sgd . FMClassification ( n_iter = 1000 , init_stdev = 0.1 , l2_reg_w = 0 , l2_reg_V = 0 , rank = 2 , step_size = 0.1 ) #NEWLINE# fm . fit ( X_train , y ) #NEWLINE# y_pred = fm . predict ( X_test ) #NEWLINE# print ( y_pred ) #NEWLINE# assert ( metrics . accuracy_score ( y , y_pred ) > 0.95 )