|
1 |
| -import matminer.featurizers.composition as feat_comp |
2 |
| -import matminer.featurizers.structure as feat_struct |
| 1 | +import matminer.featurizers.composition as fc |
| 2 | +import matminer.featurizers.structure as fs |
3 | 3 | from matminer.featurizers.base import MultipleFeaturizer
|
4 | 4 |
|
5 | 5 | # Create the featurizer: Ward et al. use a variety of different featurizers
|
6 | 6 | # https://journals.aps.org/prb/abstract/10.1103/PhysRevB.96.024104
|
7 |
| -featurizers = [ |
8 |
| - feat_struct.SiteStatsFingerprint.from_preset("CoordinationNumber_ward-prb-2017"), |
9 |
| - feat_struct.StructuralHeterogeneity(), |
10 |
| - feat_struct.ChemicalOrdering(), |
11 |
| - feat_struct.MaximumPackingEfficiency(), |
12 |
| - feat_struct.SiteStatsFingerprint.from_preset( |
13 |
| - "LocalPropertyDifference_ward-prb-2017" |
14 |
| - ), |
15 |
| - feat_struct.StructureComposition(feat_comp.Stoichiometry()), |
16 |
| - feat_struct.StructureComposition(feat_comp.ElementProperty.from_preset("magpie")), |
17 |
| - feat_struct.StructureComposition(feat_comp.ValenceOrbital(props=["frac"])), |
18 |
| - feat_struct.StructureComposition(feat_comp.IonProperty(fast=True)), |
| 7 | + |
| 8 | +composition_features = [ |
| 9 | + # Ward+Wolverton' Magpie https://rdcu.be/c3jug |
| 10 | + fc.ElementProperty.from_preset("magpie"), |
| 11 | + # Ionic property attributes. Similar to ElementProperty. |
| 12 | + fc.IonProperty(fast=True), |
| 13 | + # Calculate norms of stoichiometric attributes. |
| 14 | + fc.Stoichiometry(), |
| 15 | + # Attributes of valence orbital shells |
| 16 | + fc.ValenceOrbital(props=["frac"]), |
| 17 | +] |
| 18 | +structure_features = [ |
| 19 | + # How much the ordering of species in the structure differs from random |
| 20 | + fs.ChemicalOrdering(), |
| 21 | + # Maximum possible packing efficiency of this structure |
| 22 | + fs.MaximumPackingEfficiency(), |
| 23 | + # Differences in elemental properties between site and its neighboring sites |
| 24 | + fs.SiteStatsFingerprint.from_preset("LocalPropertyDifference_ward-prb-2017"), |
| 25 | + # Number of first nearest neighbors of a site. |
| 26 | + fs.SiteStatsFingerprint.from_preset("CoordinationNumber_ward-prb-2017"), |
| 27 | + # Variance in the bond lengths and atomic volumes in a structure |
| 28 | + fs.StructuralHeterogeneity(), |
19 | 29 | ]
|
20 |
| -featurizer = MultipleFeaturizer(featurizers) |
| 30 | +featurizer = MultipleFeaturizer( |
| 31 | + structure_features + [*map(fs.StructureComposition, composition_features)] |
| 32 | +) |
21 | 33 |
|
22 | 34 |
|
23 | 35 | # multiprocessing seems to be the cause of OOM errors on large structures even when
|
|
0 commit comments