Пример #1
0
 def test_en_diff(self):
     featurizer = ElectronegativityDiff()
     features = dict(zip(featurizer.feature_labels(), featurizer.featurize(self.df["composition"][1])))
     self.assertAlmostEqual(features["minimum EN difference"], 1.6099999999)
     self.assertAlmostEqual(features["maximum EN difference"], 1.6099999999)
     self.assertAlmostEqual(features["range EN difference"], 0)
     self.assertAlmostEqual(features["mean EN difference"], 1.6099999999)
     self.assertAlmostEqual(features["std_dev EN difference"], 0)
Пример #2
0
                                             ignore_errors=True)

    #AtomicOrbital
    from matminer.featurizers.composition import AtomicOrbitals
    atomic_orbitals = AtomicOrbitals()
    atomic_orbitals.set_n_jobs(28)
    labels.append(atomic_orbitals.feature_labels())
    df = atomic_orbitals.featurize_dataframe(df,
                                             'composition',
                                             ignore_errors=True)

    #ElectronegativityDiff
    from matminer.featurizers.composition import ElectronegativityDiff
    electronegativity_diff = ElectronegativityDiff()
    electronegativity_diff.set_n_jobs(28)
    labels.append(electronegativity_diff.feature_labels())
    df = electronegativity_diff.featurize_dataframe(df,
                                                    'composition_oxid',
                                                    ignore_errors=True)

    #ElectronAffinity
    from matminer.featurizers.composition import ElectronAffinity
    electron_affinity = ElectronAffinity()
    electron_affinity.set_n_jobs(28)
    labels.append(electron_affinity.feature_labels())
    df = electron_affinity.featurize_dataframe(df,
                                               'composition_oxid',
                                               ignore_errors=True)

if args.functionalize is True:
    #FunctionFeaturizer