def test_direct_cross_validation(iris_dataframe): """ Starting with sklearn>=0.16.0 we no longer need CV wrappers for dataframes. See https://github.com/paulgb/sklearn-pandas/issues/11 """ pipeline = Pipeline( [ ( "preprocess", DataFrameMapper( [ ("petal length (cm)", None), ("petal width (cm)", None), ("sepal length (cm)", None), ("sepal width (cm)", None), ] ), ), ("classify", SVC(kernel="linear")), ] ) data = iris_dataframe.drop("species", axis=1) labels = iris_dataframe["species"] scores = sklearn_cv_score(pipeline, data, labels) assert scores.mean() > 0.96 assert (scores.std() * 2) < 0.04
def test_direct_cross_validation(iris_dataframe): """ Starting with sklearn>=0.16.0 we no longer need CV wrappers for dataframes. See https://github.com/paulgb/sklearn-pandas/issues/11 """ pipeline = Pipeline([("preprocess", DataFrameMapper([ ("petal length (cm)", None), ("petal width (cm)", None), ("sepal length (cm)", None), ("sepal width (cm)", None), ])), ("classify", SVC(kernel='linear'))]) data = iris_dataframe.drop("species", axis=1) labels = iris_dataframe["species"] scores = sklearn_cv_score(pipeline, data, labels) assert scores.mean() > 0.96 assert (scores.std() * 2) < 0.04