コード例 #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)
コード例 #2
0
ファイル: test_elemental.py プロジェクト: wakiara/XenonPy
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)
コード例 #3
0
ファイル: test_elemental.py プロジェクト: cesolution/XenonPy
def test_comp_descripotor():
    desc = Compositions(n_jobs=1)
    desc.fit_transform(pd.Series([{'H': 2}], name='composition'))