def test_calibration_nan_imputer():
 (X, y) = make_classification(n_samples=10, n_features=2, n_informative=2, n_redundant=0, random_state=42)
 X[(0, 0)] = np.nan
 clf = Pipeline([('imputer', Imputer()), ('rf', RandomForestClassifier(n_estimators=1))])
 clf_c = CalibratedClassifierCV(clf, cv=2, method='isotonic')
 clf_c.fit(X, y)
 clf_c.predict(X)

def test_calibration_nan_imputer ( ) : ( X , y ) = make_classification ( n_samples = 10 , n_features = 2 , n_informative = 2 , n_redundant = 0 , random_state = 42 ) X [ ( 0 , 0 ) ] = np . nan clf = Pipeline ( [ ( 'imputer' , Imputer ( ) ) , ( 'rf' , RandomForestClassifier ( n_estimators = 1 ) ) ] ) clf_c = CalibratedClassifierCV ( clf , cv = 2 , method = 'isotonic' ) clf_c . fit ( X , y ) clf_c . predict ( X )
test that calibration can accept nan .