def __init__(self, exclude=None): super(StructureFeaturizers, self).__init__(exclude=exclude) self._fast_featurizers = [ sf.DensityFeatures(), sf.GlobalSymmetryFeatures(), sf.EwaldEnergy(), sf.SineCoulombMatrix(flatten=True) ] ssf = sf.SiteStatsFingerprint self._slow_featurizers = [ ssf.from_preset('CrystalNNFingerprint_ops'), ssf.from_preset("BondLength-dejong2016"), ssf.from_preset("BondAngle-dejong2016"), ssf.from_preset("Composition-dejong2016_SD"), ssf.from_preset("Composition-dejong2016_AD"), ssf.from_preset("CoordinationNumber_ward-prb-2017"), ssf.from_preset("LocalPropertyDifference_ward-prb-2017"), sf.ChemicalOrdering(), sf.StructuralHeterogeneity(), sf.MaximumPackingEfficiency(), sf.XRDPowderPattern(), sf.Dimensionality(), sf.OrbitalFieldMatrix(flatten=True), sf.JarvisCFID(), ] # Prevent import errors self._require_external = [] if torch and cgcnn: self._require_external.append(sf.CGCNNFeaturizer()) if dscribe: self._require_external.append(sf.SOAP()) self._need_fitting_featurizers = [ sf.PartialRadialDistributionFunction(), sf.BondFractions(), sf.BagofBonds(coulomb_matrix=sf.CoulombMatrix()), sf.BagofBonds(coulomb_matrix=sf.SineCoulombMatrix()), ] self._matrix_featurizers = [ sf.CoulombMatrix(flatten=False), sf.RadialDistributionFunction(), # returns dict sf.MinimumRelativeDistances(), # returns a list sf.ElectronicRadialDistributionFunction() ] # these are the same as _need_fitting_featurizers self._many_features_featurizers = [ sf.PartialRadialDistributionFunction(), sf.BondFractions(approx_bonds=False), sf.BagofBonds(coulomb_matrix=sf.CoulombMatrix()), sf.BagofBonds(coulomb_matrix=sf.SineCoulombMatrix()), sf.OrbitalFieldMatrix(flatten=True), sf.JarvisCFID() ]
def all(self): fs = [ # Vector self.ssf.from_preset('CrystalNNFingerprint_ops'), self.ssf.from_preset("BondLength-dejong2016"), self.ssf.from_preset("BondAngle-dejong2016"), self.ssf.from_preset("Composition-dejong2016_SD"), self.ssf.from_preset("Composition-dejong2016_AD"), self.ssf.from_preset("CoordinationNumber_ward-prb-2017"), self.ssf.from_preset("LocalPropertyDifference_ward-prb-2017"), sf.BondFractions(approx_bonds=False), sf.BagofBonds(coulomb_matrix=sf.CoulombMatrix()), sf.BagofBonds(coulomb_matrix=sf.SineCoulombMatrix()), sf.CoulombMatrix(flatten=True), sf.BondFractions(), # Non vector sf.CoulombMatrix(flatten=False), # returns matrix sf.SineCoulombMatrix(flatten=False), # returns matrix sf.RadialDistributionFunction(), # returns dict sf.MinimumRelativeDistances(), # returns a list sf.ElectronicRadialDistributionFunction(), # returns ?? sf.PartialRadialDistributionFunction(), # returns ?? ] fs += self.heavy return self._get_featurizers(fs)
def need_fit(self): fs = [ sf.PartialRadialDistributionFunction(), sf.BondFractions(), sf.BagofBonds(coulomb_matrix=sf.CoulombMatrix()), sf.BagofBonds(coulomb_matrix=sf.SineCoulombMatrix()), ] return self._get_featurizers(fs)
def __init__(self, exclude=None): super(StructureFeaturizers, self).__init__(exclude=exclude) self._fast_featurizers = [ sf.DensityFeatures(), sf.GlobalSymmetryFeatures(), sf.EwaldEnergy() ] self._slow_featurizers = [ sf.SiteStatsFingerprint.from_preset('CrystalNNFingerprint_ops'), sf.ChemicalOrdering(), sf.StructuralHeterogeneity(), sf.MaximumPackingEfficiency(), sf.XRDPowderPattern(), sf.Dimensionality(), sf.OrbitalFieldMatrix(flatten=True) ] self._need_fitting_featurizers = [ sf.PartialRadialDistributionFunction(), sf.BondFractions(), sf.BagofBonds() ] self._matrix_featurizers = [ sf.RadialDistributionFunction(), # returns dict sf.CoulombMatrix(), # returns a matrix sf.SineCoulombMatrix(), # returns a matrix sf.OrbitalFieldMatrix(flatten=False), # returns a matrix sf.MinimumRelativeDistances(), # returns a list sf.ElectronicRadialDistributionFunction() ] # these are the same as _need_fitting_featurizers self._many_features_featurizers = [ sf.PartialRadialDistributionFunction(), sf.BondFractions(), sf.BagofBonds(), sf.OrbitalFieldMatrix(flatten=True) ]