<jupyter_start><jupyter_text>Work with Sklearn Pipeline<jupyter_code>import numpy as np
from sklearn import svm
from matplotlib import pylab as plt 
from sklearn.model_selection import KFold 
from sklearn.datasets import samples_generator
from sklearn.feature_selection import SelectKBest
from sklearn.feature_selection import f_regression
from sklearn.pipeline import Pipeline

from sequd import SeqUD

X, y = samples_generator.make_classification(
    n_informative=5, n_redundant=0, random_state=42)

anova_filter = SelectKBest(f_regression, k=5)
clf = svm.SVC(kernel='linear')
anova_svm = Pipeline([('anova', anova_filter), ('svc', clf)])

anova_svm.set_params(anova__k=10, svc__C=.1).fit(X, y)
ParaSpace = {'anova__k':      {'Type': 'integer',        'Mapping':  np.linspace(2, 10, 9)},
             'svc__C':        {'Type': 'continuous',     'Range': [-6, 16], 'Wrapper': np.exp2}
            }

cv = KFold(n_splits=5, random_state=0, shuffle=True)
clf = SeqUD(ParaSpace, estimator=anova_svm, cv=cv, verbose=True)
clf.fit(X, y)<jupyter_output>/home/r7user1/anaconda2_local/envs/tf2/lib/python3.6/site-packages/sklearn/utils/deprecation.py:143: FutureWarning: The sklearn.datasets.samples_generator module is  deprecated in version 0.22 and will be removed in version 0.24. The corresponding classes / functions should instead be imported from sklearn.datasets. Anything that cannot be imported from sklearn.datasets is now part of the private API.
  warnings.warn(message, FutureWarning)
/home/r7user1/anaconda2_local/envs/tf2/lib/python3.6/site-packages/statsmodels/tools/_testing.py:19: FutureWarning: pandas.util.testing is deprecated. Use the functions in the public API at pandas.testing instead.
  import pandas.util.testing as tm
{'fraction_non_alphanumeric': 0.10556511761331039, 'fraction_numerical': 0.023522662076878944, 'mean_word_length': 5.184397163120567, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '532276', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 616, 'n_tokens_neox': 583, 'n_words': 149, 'path': 'examples/demo_sklearn_pipeline.ipynb', 'repo_name': 'ZebinYang/SeqMM', 'size': '1743'}