Ejemplo n.º 1
0
def test_comp_descriptor_1():
    desc = Compositions(n_jobs=1)

    desc.fit_transform(pd.Series([{'H': 2}], name='composition'))
    desc.fit_transform(pd.Series([{'H': 2}], name='other'))

    tmp1 = desc.fit_transform(pd.Series([{
        'H': 2
    }], name='other'),
                              composition='other')
    tmp2 = desc.fit_transform([{'H': 2}])

    assert tmp1.shape == (1, 290)
    assert isinstance(tmp1, pd.DataFrame)
    assert isinstance(tmp2, pd.DataFrame)

    assert np.all(tmp1.values == tmp2.values)

    tmp = desc.transform([{'H': 2}], featurizers=['WeightedAverage'])
    assert tmp.shape == (1, 58)

    tmp = desc.transform([{'H': 2}], featurizers='all')
    assert tmp.shape == (1, 500)

    tmp = desc.transform([{'H': 2}], featurizers=Compositions.classic)
    assert tmp.shape == (1, 290)
Ejemplo n.º 2
0
def test_comp_descriptor_1():
    desc = Compositions(n_jobs=1)

    desc.fit_transform(pd.Series([{'H': 2}], name='composition'))
    desc.fit_transform(pd.Series([{'H': 2}], name='other'))

    tmp1 = desc.fit_transform(pd.Series([{'H': 2}], name='other'), composition='other')
    tmp2 = desc.fit_transform([{'H': 2}])

    assert tmp1.shape == (1, 290)
    assert isinstance(tmp1, pd.DataFrame)
    assert isinstance(tmp2, pd.DataFrame)

    assert np.all(tmp1.values == tmp2.values)
Ejemplo n.º 3
0
def test_comp_descripotor():
    desc = Compositions(n_jobs=1)
    desc.fit_transform(pd.Series([{'H': 2}], name='composition'))