def check_no_fit_attributes_set_in_init(name, Estimator):
 estimator = Estimator()
 for attr in dir(estimator):
  if (attr.endswith('_') and (not attr.startswith('__'))):
   assert_false(hasattr(estimator, attr), "By convention, attributes ending with '_' are estimated from data in scikit-learn. Consequently they should not be initialized in the constructor of an estimator but in the fit method. Attribute {!r} was found in estimator {}".format(attr, name))

def check_no_fit_attributes_set_in_init ( name , Estimator ) : estimator = Estimator ( ) for attr in dir ( estimator ) : if ( attr . endswith ( '_' ) and ( not attr . startswith ( '__' ) ) ) : assert_false ( hasattr ( estimator , attr ) , "By convention, attributes ending with '_' are estimated from data in scikit-learn. Consequently they should not be initialized in the constructor of an estimator but in the fit method. Attribute {!r} was found in estimator {}" . format ( attr , name ) )
check that estimator .