def test_run(): x, y = get_iris(True) print_summary(x) x, y = get_boston() print_summary(x) x, y = get_titanic(True) print_summary(x)
@author: mvanoudh """ #import numpy as np import pandas as pd from sklearn2.utils import split_xy, print_summary from sklearn2.datasets import get_titanic_clean from sklearn2.covariance import compute_correls pd.options.display.width = 160 df = get_titanic_clean()['Fare Age Sex Embarked Pclass Survived'.split()] print_summary(df) def test1(): return compute_correls(df) def test2(): return compute_correls(df, model='entropy') def test3(): return compute_correls(df, model='linear') def test4():
#from sklearn.decomposition import TruncatedSVD from sklearn2.utils import TransformerWrap, PassThrought, todf from sklearn2.utils import object_cols, numeric_cols pd.options.display.width = 160 logging.basicConfig(format='%(asctime)s - %(name)s - %(message)s') logging.getLogger().setLevel(level=logging.INFO) seed(0) x, y = get_titanic(True) #x, y = get_iris() print_summary(x) ppl = Pipeline([ ('in', ConstantInputer()), ("da", DateEncoder()), ('en', FeatureUnion([('nu', Pipeline([('ft', FunctionTransformer()), ("sc", TransformerWrap(StandardScaler()))])), ('ca', make_pipeline(FunctionTransformer(), SparseCatEncoder(), FunctionTransformer()))])), ('fi', make_union(SelectKBest2(), TruncatedSVD2())) ]) params = { 'en__nu__ft__func': lambda x: x[numeric_cols(x)],
def test_date_encoder(): df = get_titanic() df.fillna(0, inplace=True) df2 = DateEncoder(ascategory=True).fit_transform(df) print_summary(df2)
def test_run(): df = pd.DataFrame({'a': [1, 2], 'b': ['bonjour x', 'hello y']}) df['c'] = df.b.apply(lambda s: s.split(' ')) print_summary(df)