#NEWLINE# def _check_solver_option( solver , multi_class , penalty , dual ) : #NEWLINE# #INDENT# if ( solver not in [ 'liblinear' , 'newton-cg' , 'lbfgs' , 'sag' ] ) : #NEWLINE# #INDENT# raise ValueError ( ( 'Logistic Regression supports only liblinear, newton-cg, lbfgs and sag solvers, got %s' % solver ) ) #NEWLINE# #UNINDENT# if ( multi_class not in [ 'multinomial' , 'ovr' ] ) : #NEWLINE# #INDENT# raise ValueError ( ( 'multi_class should be either multinomial or ovr, got %s' % multi_class ) ) #NEWLINE# #UNINDENT# if ( ( multi_class == 'multinomial' ) and ( solver == 'liblinear' ) ) : #NEWLINE# #INDENT# raise ValueError ( ( 'Solver %s does not support a multinomial backend.' % solver ) ) #NEWLINE# #UNINDENT# if ( solver != 'liblinear' ) : #NEWLINE# #INDENT# if ( penalty != 'l2' ) : #NEWLINE# #INDENT# raise ValueError ( ( 'Solver %s supports only l2 penalties, got %s penalty.' % ( solver , penalty ) ) ) #NEWLINE# #UNINDENT# if dual : #NEWLINE# #INDENT# raise ValueError ( ( 'Solver %s supports only dual=False, got dual=%s' % ( multi_class , dual ) ) )