schrodinger.application.matsci.mlearn.features module

Classes and functions to deal with ML features.

Copyright Schrodinger, LLC. All rights reserved.

schrodinger.application.matsci.mlearn.features.avg_atomic_vol(struct)

Get average atomic volume.

Parameters:struct (schrodinger.structure.Structure) – Structure to be used for feature calculation
Return type:float
Returns:Average atomic volume (A^3)
schrodinger.application.matsci.mlearn.features.get_distance_cell(struct, cutoff, cell, pbc)

Create an infrastructure Distance Cell. Struct MUST have the Chorus box properties.

Parameters:
  • struct (schrodinger.structure.Structure) – Input structure
  • cutoff (float) – The cutoff for finding nearest neighbor atoms
  • cell (schrodinger.infra.structure.DistanceCell) – Distance cell object for the struct
  • pbc (schrodinger.infra.structure.PBC) – PBC object for the struct
Return type:

schrodinger.structure.Structure, , schrodinger.infra.structure.DistanceCell, schrodinger.infra.structure.PBC

Returns:

Supercell, an infrastructure Distance Cell that accounts for the PBC, and the pbc used to create it.

Raise:

ValueError if struct is missing PBCs

schrodinger.application.matsci.mlearn.features.elemental_generator(struct, element, is_equal=True)
schrodinger.application.matsci.mlearn.features.avg_neighbor_count(struct, element, cutoff, cell=None, pbc=None)

Get average neighbor count.

Parameters:
  • struct (schrodinger.structure.Structure) – Input structure
  • element (str) – Element for which to compute the count
  • cutoff (float) – The cutoff for finding nearest neighbor atoms
  • cell (schrodinger.infra.structure.DistanceCell) – Distance cell object for the struct
  • pbc (schrodinger.infra.structure.PBC) – PBC object for the struct
Return type:

float

Returns:

Average neighbor count

schrodinger.application.matsci.mlearn.features.std_neighbor_count(struct, element, cutoff, cell=None, pbc=None)

Get standard deviation of neighbor count.

Parameters:
  • struct (schrodinger.structure.Structure) – Input structure
  • element (str) – Element for which to compute the count
  • cutoff (float) – The cutoff for finding nearest neighbor atoms
  • cell (schrodinger.infra.structure.DistanceCell) – Distance cell object for the struct
  • pbc (schrodinger.infra.structure.PBC) – PBC object for the struct
Return type:

float

Returns:

Average neighbor count

schrodinger.application.matsci.mlearn.features.avg_element_neighbor_count(struct, cutoff, element, cell=None, pbc=None)

Get average element neighbor count.

Parameters:
  • struct (schrodinger.structure.Structure) – Input structure
  • cutoff (float) – The cutoff for finding nearest neighbor atoms
  • element (str) – Element for which to compute the average
  • cell (schrodinger.infra.structure.DistanceCell) – Distance cell object for the struct
  • pbc (schrodinger.infra.structure.PBC) – PBC object for the struct
Return type:

float

Returns:

Average number of bonds per element

schrodinger.application.matsci.mlearn.features.avg_sublattice_neighbor_count(struct, element, cutoff, cell=None, pbc=None)

Get average sublattice neighbor count.

Parameters:
  • struct (schrodinger.structure.Structure) – Input structure
  • element (str) – Element for which to compute the average
  • cutoff (float) – The cutoff for finding nearest neighbor atoms
  • cell (schrodinger.infra.structure.DistanceCell) – Distance cell object for the struct
  • pbc (schrodinger.infra.structure.PBC) – PBC object for the struct
Return type:

float

Returns:

Average sublattice neighbor count

schrodinger.application.matsci.mlearn.features.avg_neighbor_ion(struct, element, cutoff, cell=None, pbc=None)

Get average neighbor ionicity.

Parameters:
  • struct (schrodinger.structure.Structure) – Input structure
  • element (str) – Element for which to compute the average
  • cutoff (float) – The cutoff for finding nearest neighbor atoms
  • cell (schrodinger.infra.structure.DistanceCell) – Distance cell object for the struct
  • pbc (schrodinger.infra.structure.PBC) – PBC object for the struct
Return type:

float

Returns:

Average neighbor ionicity

schrodinger.application.matsci.mlearn.features.std_neighbor_ion(struct, element, cutoff, cell=None, pbc=None)

Get standard deviation of neighbor ionicity.

Parameters:
  • struct (schrodinger.structure.Structure) – Input structure
  • element (str) – Element for which to compute the average
  • cutoff (float) – The cutoff for finding nearest neighbor atoms
  • cell (schrodinger.infra.structure.DistanceCell) – Distance cell object for the struct
  • pbc (schrodinger.infra.structure.PBC) – PBC object for the struct
Return type:

float

Returns:

Average neighbor ionicity

schrodinger.application.matsci.mlearn.features.avg_sublattice_neighbor_ion(struct, element, cutoff, cell=None, pbc=None)

Get average sublattice neighbor ionicity.

Parameters:
  • struct (schrodinger.structure.Structure) – Input structure
  • element (str) – Element for which to compute the average
  • cutoff (float) – The cutoff for finding nearest neighbor atoms
  • cell (schrodinger.infra.structure.DistanceCell) – Distance cell object for the struct
  • pbc (schrodinger.infra.structure.PBC) – PBC object for the struct
Return type:

float

Returns:

Average sublattice neighbor count

schrodinger.application.matsci.mlearn.features.get_anion(struct)

Get the most electronegative element in the structure (anion).

Parameters:struct (schrodinger.structure.Structure) – Input structure
Return type:str, float, int
Returns:Element, it’s electronegativity, number of anions in the cell
schrodinger.application.matsci.mlearn.features.vol_per_anion(struct)

Get volume per anion.

Parameters:struct (schrodinger.structure.Structure) – Input structure
Return type:float
Returns:Volume per anion
schrodinger.application.matsci.mlearn.features.avg_anion_anion_short_distance(struct, supercell)

Get average anion anion shortest distance.

Parameters:
Return type:

float

Returns:

Average anion anion shortest distance

schrodinger.application.matsci.mlearn.features.avg_element_anion_short_distance(struct, element, supercell)

Get average element anion shortest distance.

Parameters:
  • struct (schrodinger.structure.Structure) – Input structure
  • element (str) – Element for which to compute the average
  • struct – Supercell input structure
Return type:

float

Returns:

Average element anion shortest distance

schrodinger.application.matsci.mlearn.features.avg_element_element_short_distance(struct, element, supercell)

Get average element element shortest distance.

Parameters:
  • struct (schrodinger.structure.Structure) – Input structure
  • element (str) – Element for which to compute the average
  • struct – Supercell input structure
Return type:

float

Returns:

Average element element shortest distance

schrodinger.application.matsci.mlearn.features.anion_frame_coordination(struct, supercell)

Get anion framework coordination.

Parameters:
Return type:

float

Returns:

Anion framework coordination

schrodinger.application.matsci.mlearn.features.avg_sublattice_eneg(struct, element)

Get average sublattice electronegativity.

Parameters:
Return type:

float

Returns:

Average sublattice electronegativity

schrodinger.application.matsci.mlearn.features.packing_fraction(struct, cutoff, cell=None, pbc=None)

Get packing fraction of the crystal.

Parameters:
  • struct (schrodinger.structure.Structure) – Input structure
  • cutoff (float) – The cutoff for finding nearest neighbor atoms
  • cell (schrodinger.infra.structure.DistanceCell) – Distance cell object for the struct
  • pbc (schrodinger.infra.structure.PBC) – PBC object for the struct
Return type:

float

Returns:

Packing fraction

class schrodinger.application.matsci.mlearn.features.LatticeFeatures(element='Li', cutoff=4.0)

Bases: schrodinger.application.matsci.mlearn.base.BaseFeaturizer

Class to generate lattice-based features.

transform(structs)

Get numerical features from structures. Also sets features names in self.labels. See parent class for more documentation.

Parameters:structs (list(schrodinger.structure.Structure)) – List of structures to be featurized
Return type:numpy array of shape [n_samples, n_features]
Returns:Transformed array