@@ -189,8 +189,9 @@ def fit_improve(self, dtlr, total_N, X, y, sample_weight):
189189 # The classifier is not linear and cannot be improved.
190190 if dtlr .fit_improve_algo == 'intercept_sort_always' : # pragma: no cover
191191 raise RuntimeError (
192- "The model is not linear ({}), "
193- "intercept cannot be improved." .format (self .estimator .__class__ .__name__ ))
192+ f"The model is not linear "
193+ f"({ self .estimator .__class__ .__name__ !r} ), "
194+ f"intercept cannot be improved." )
194195 return prob
195196
196197 above = prob [:, 1 ] > self .threshold
@@ -368,8 +369,8 @@ def __init__(self, estimator=None,
368369
369370 if self .fit_improve_algo not in DecisionTreeLogisticRegression ._fit_improve_algo_values :
370371 raise ValueError (
371- "fit_improve_algo='{}' not in {}" . format (
372- self . fit_improve_algo , DecisionTreeLogisticRegression ._fit_improve_algo_values ) )
372+ f "fit_improve_algo={ self . fit_improve_algo !r } "
373+ f"not in { DecisionTreeLogisticRegression ._fit_improve_algo_values } ." )
373374
374375 def fit (self , X , y , sample_weight = None ):
375376 """
@@ -401,8 +402,8 @@ def fit(self, X, y, sample_weight=None):
401402 self .classes_ = numpy .array (sorted (set (y )))
402403 if len (self .classes_ ) != 2 :
403404 raise RuntimeError (
404- "The model only supports binary classification but labels are "
405- "{}." . format ( self .classes_ ) )
405+ f "The model only supports binary classification but labels are "
406+ f" { self .classes_ } ." )
406407
407408 if self .strategy == 'parallel' :
408409 return self ._fit_parallel (X , y , sample_weight )
0 commit comments