def test_prefit():
 clf = SGDClassifier(alpha=0.1, n_iter=10, shuffle=True, random_state=0)
 model = SelectFromModel(clf)
 model.fit(data, y)
 X_transform = model.transform(data)
 clf.fit(data, y)
 model = SelectFromModel(clf, prefit=True)
 assert_array_equal(model.transform(data), X_transform)
 model = SelectFromModel(clf, prefit=False)
 model.fit(data, y)
 assert_array_equal(model.transform(data), X_transform)
 model = SelectFromModel(clf, prefit=True)
 assert_raises(ValueError, model.fit, data, y)

def test_prefit ( ) : clf = SGDClassifier ( alpha = 0.1 , n_iter = 10 , shuffle = True , random_state = 0 ) model = SelectFromModel ( clf ) model . fit ( data , y ) X_transform = model . transform ( data ) clf . fit ( data , y ) model = SelectFromModel ( clf , prefit = True ) assert_array_equal ( model . transform ( data ) , X_transform ) model = SelectFromModel ( clf , prefit = False ) model . fit ( data , y ) assert_array_equal ( model . transform ( data ) , X_transform ) model = SelectFromModel ( clf , prefit = True ) assert_raises ( ValueError , model . fit , data , y )
test all possible combinations of the prefit parameter .