matminer.featurizers package — matminer 0.2.4 documentation

# matminer.featurizers package

## Submodules

## matminer.featurizers.bandstructure module

class `matminer.featurizers.bandstructure.` `BandFeaturizer`(kpoints=None, find_method='nearest', nbands=2)

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  Featurizes a pymatgen band structure object. Args:

  > kpoints ([1x3 numpy array]): list of fractional coordinates of
  >   k-points at which energy is extracted.
  > find_method (str): the method for finding or interpolating for energy

  >   at given kpoints. It does nothing if kpoints is None. options are:

  >   > ‘nearest’: the energy of the nearest available k-point to
  >   >   the input k-point is returned.

  >   > ‘linear’: the result of linear interpolation is returned see the documentation for scipy.interpolate.griddata

  > nbands (int): the number of valence/conduction bands to be featurized

  `__init__`(kpoints=None, find_method='nearest', nbands=2)
  `citations`()
  `feature_labels`()
  `featurize`(bs)
    Args:
      bs (pymatgen BandStructure or BandStructureSymmLine or their dict):
        The band structure to featurize. To obtain all features, bs should include the structure attribute.
    Returns:

      > ([float]): a list of band structure features. If not bs.structure,
      >   features that require the structure will be returned as NaN.

      List of currently supported features:

        band_gap (eV): the difference between the CBM and VBM energy is_gap_direct (0.0|1.0): whether the band gap is direct or not direct_gap (eV): the minimum direct distance of the last

        > valence band and the first conduction band

        p_ex1_norm (float): k-space distance between Gamma point
          and k-point of VBM
        n_ex1_norm (float): k-space distance between Gamma point
          and k-point of CBM

        p_ex1_degen: degeneracy of VBM n_ex1_degen: degeneracy of CBM if kpoints is provided (e.g. for kpoints == [[0.0, 0.0, 0.0]]):

        > n_0.0;0.0;0.0_en: (energy of the first conduction band at
        >   [0.0, 0.0, 0.0] - CBM energy)
        > p_0.0;0.0;0.0_en: (energy of the last valence band at
        >   [0.0, 0.0, 0.0] - VBM energy)

  static `get_bindex_bspin`(extremum, is_cbm)

    Returns the band index and spin of band extremum

    Args:
      extremum (dict): dictionary containing the CBM/VBM, i.e. output of
        Bandstructure.get_cbm()

      is_cbm (bool): whether the extremum is the CBM or not

  `implementors`()

class `matminer.featurizers.bandstructure.` `BranchPointEnergy`(n_vb=1, n_cb=1, calculate_band_edges=True)

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  `__init__`(n_vb=1, n_cb=1, calculate_band_edges=True)

    Calculates the branch point energy and (optionally) an absolute band edge position assuming the branch point energy is the center of the gap

    Args:

      n_vb: (int) number of valence bands to include in BPE calc n_cb: (int) number of conduction bands to include in BPE calc calculate_band_edges: (bool) whether to also return band edge

      > positions

  `citations`()
  `feature_labels`()
  `featurize`(bs, target_gap=None)
    Args:
      bs: (BandStructure) Uniform (not symm line) band structure
    Returns:
      (int) branch point energy on same energy scale as BS eigenvalues
  `implementors`()

## matminer.featurizers.base module

class `matminer.featurizers.base.` `BaseFeaturizer`

  Bases: `object`

  Abstract class to calculate attributes from raw materials input data such a compound formula or a pymatgen crystal structure or bandstructure object.

  `citations`()

    Citation(s) and reference(s) for this feature.

    Returns:
      (list) each element should be a string citation,
        ideally in BibTeX format.
  `feature_labels`()

    Generate attribute names.

    Returns:
      ([str]) attribute labels.
  `featurize`(*x)

    Main featurizer function, which has to be implemented in any derived featurizer subclass.

    Args:
      x: input data to featurize (type depends on featurizer).
    Returns:
      (list) one or more features.
  `featurize_dataframe`(df, col_id, ignore_errors=False, inplace=True, n_jobs=1)

    Compute features for all entries contained in input dataframe.

    Args:

      df (Pandas dataframe): Dataframe containing input data. col_id (str or list of str): column label containing objects to

      > featurize. Can be multiple labels if the featurize function requires multiple inputs.

      ignore_errors (bool): Returns NaN for dataframe rows where
        exceptions are thrown if True. If False, exceptions are thrown as normal.

      inplace (bool): Whether to add new columns to input dataframe (df) n_jobs (int): Number of parallel processes to execute when

      > featurizing the dataframe. If None, automatically determines the number of processing cores on the system and sets n_procs to this number.

    Returns:
      updated dataframe.
  `featurize_many`(entries, n_jobs=1, ignore_errors=False)

    Featurize a list of entries. If featurize takes multiple inputs, supply inputs as a list of tuples.

    Args:
      entries (list): A list of entries to be featurized.
    Returns:
      (list) features for each entry.
  `featurize_wrapper`(x)
  `implementors`()

    List of implementors of the feature.

    Returns:
      (list) each element should either be a string with author name (e.g.,
        “Anubhav Jain”) or a dictionary with required key “name” and other keys like “email” or “institution” (e.g., {“name”: “Anubhav Jain”, “email”: “ajain@lbl.gov”, “institution”: “LBNL”}).

class `matminer.featurizers.base.` `MultipleFeaturizer`(featurizers)

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  Class that runs multiple featurizers on the same data All featurizers must take the same kind of data as input to the featurize function.

  `__init__`(featurizers)

    Create a new instance of this featurizer.

    Args:
      featurizers ([BaseFeaturizer]): list of featurizers to run.
  `citations`()
  `feature_labels`()
  `featurize`(*x)
  `implementors`()

## matminer.featurizers.composition module

class `matminer.featurizers.composition.` `AtomicOrbitals`

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  Determine the highest occupied molecular orbital (HOMO) and lowest unocupied molecular orbital (LUMO) in a composition. The atomic orbital energies of neutral ions with LDA-DFT were computed by NIST. https://www.nist.gov/pml/data/atomic-reference-data-electronic-structure-calculations

  `citations`()
  `feature_labels`()
  `featurize`(comp)
    Args:
      comp: (Composition)
        pymatgen Composition object
    Returns:

      HOMO_character: (str) orbital symbol (‘s’, ‘p’, ‘d’, or ‘f’) HOMO_element: (str) symbol of element for HOMO HOMO_energy: (float in eV) absolute energy of HOMO LUMO_character: (str) orbital symbol (‘s’, ‘p’, ‘d’, or ‘f’) LUMO_element: (str) symbol of element for LUMO LUMO_energy: (float in eV) absolute energy of LUMO gap_AO: (float in eV)

      > the estimated bandgap from HOMO and LUMO energeis

  `implementors`()

class `matminer.featurizers.composition.` `BandCenter`

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  `citations`()
  `feature_labels`()
  `featurize`(comp)

    (Rough) estimation of absolution position of band center using geometric mean of electronegativity.

    Args:
      comp (Composition).
    Returns:
      (float) band center.
  `implementors`()

class `matminer.featurizers.composition.` `CationProperty`(data_source, features, stats)

  Bases: `matminer.featurizers.composition.ElementProperty`

  Features based on the properties of cations in a material

  Requires that oxidation states have already been determined

  Computes composition-weighted statistics of different elemental properties

  `citations`()
  `feature_labels`()
  `featurize`(comp)
  classmethod `from_preset`(preset_name)

class `matminer.featurizers.composition.` `CohesiveEnergy`(mapi_key=None)

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  `__init__`(mapi_key=None)

    Get cohesive energy per atom of a compound by adding known elemental cohesive energies from the formation energy of the compound.

    Parameters:
      mapi_key (str): Materials API key for looking up formation energy
        by composition alone (if you don’t set the formation energy yourself).
  `citations`()
  `feature_labels`()
  `featurize`(comp, formation_energy_per_atom=None)
    Args:

      comp: (str) compound composition, eg: “NaCl” formation_energy_per_atom: (float) the formation energy per atom of

      > your compound. If not set, will look up the most stable formation energy from the Materials Project database.

  `implementors`()

class `matminer.featurizers.composition.` `ElectronAffinity`

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  Calculate average electron affinity times formal charge of anion elements. Note: The formal charges must already be computed before calling featurize. Generates average (electron affinity*formal charge) of anions.

  `__init__`()
  `citations`()
  `feature_labels`()
  `featurize`(comp)
    Args:
      comp: (Composition) Composition to be featurized
    Returns:
      avg_anion_affin (single-element list): average electron affinity*formal charge of anions
  `implementors`()

class `matminer.featurizers.composition.` `ElectronegativityDiff`(stats=None)

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  Features based on the electronegativity difference between the anions and cations in the material.

  These features are computed by first determining the concentration-weighted average electronegativity of the anions. For example, the average electronegativity of the anions in CaCoSO is equal to 1/2 of that of S and 1/2 of that of O. We then compute the difference between the electronegativity of each cation and the average anion electronegativity.

  The feature values are then determined based on the concentration-weighted statistics in the same manner as ElementProperty features. For example, one value could be the mean electronegativity difference over all the anions.

  Parameters:
    data_source (data class): source from which to retrieve element data stats: Property statistics to compute

  Generates average electronegativity difference between cations and anions

  `__init__`(stats=None)
  `citations`()
  `feature_labels`()
  `featurize`(comp)
    Args:
      comp: Pymatgen Composition object
    Returns:
      en_diff_stats (list of floats): Property stats of electronegativity difference
  `implementors`()

class `matminer.featurizers.composition.` `ElementFraction`

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  Class to calculate the atomic fraction of each element in a composition. Generates a vector where each index represents an element in atomic number order.

  `__init__`()
  `feature_labels`()
  `featurize`(comp)
    Args:
      comp: Pymatgen Composition object
    Returns:
      vector (list of floats): fraction of each element in a composition
  `implementors`()

class `matminer.featurizers.composition.` `ElementProperty`(data_source, features, stats)

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  Class to calculate elemental property attributes. To initialize quickly, use the from_preset() method.

  Parameters:
    data_source (AbstractData or str): source from which to retrieve
      element property data (or use str for preset: “pymatgen”, “magpie”, or “deml”)
    features (list of strings): List of elemental properties to use
      (these must be supported by data_source)
    stats (list of strings): a list of weighted statistics to compute to for each
      property (see PropertyStats for available stats)
  `__init__`(data_source, features, stats)
  `citations`()
  `feature_labels`()
  `featurize`(comp)

    Get elemental property attributes

    Args:
      comp: Pymatgen composition object
    Returns:
      all_attributes: Specified property statistics of features
  classmethod `from_preset`(preset_name)

    Return ElementProperty from a preset string Args:

    > preset_name: (str) can be one of “magpie”, “deml”, or “matminer”

    Returns:

  `implementors`()

class `matminer.featurizers.composition.` `IonProperty`(data_source=<matminer.utils.data.PymatgenData object>, fast=False)

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  Class to calculate ionic property attributes

  `__init__`(data_source=<matminer.utils.data.PymatgenData object>, fast=False)
    Args:

      > data_source - (OxidationStateMixin) - A AbstractData class that supports
      >   the get_oxidation_state method.

      fast - (boolean) whether to assume elements exist in a single oxidation state,
        which can dramatically accelerate the calculation of whether an ionic compound is possible, but will miss heterovalent compounds like Fe3O4.
  `citations`()
  `feature_labels`()
  `featurize`(comp)

    Ionic character attributes

    Args:
      comp: (Composition) Composition to be featurized
    Returns:
      cpd_possible (bool): Indicates if a neutral ionic compound is possible max_ionic_char (float): Maximum ionic character between two atoms avg_ionic_char (float): Average ionic character
  `implementors`()

class `matminer.featurizers.composition.` `Miedema`(struct_types='inter', ss_types='min', data_source='Miedema')

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  Calculate the formation enthalpies of the intermetallic compound, solid solution and amorphous phase of a given composition, based on the semi-empirical Miedema model (and some extensions), particularly for transitional metal alloys.

  Support elemental, binary and multicomponent alloys.
    For elemental/binary alloys, the formulation is based on the original works by Miedema et al. in 1980s; For multicomponent alloys, the formulation is basically linear combination of sub-binary systems. This is reported to work well for ternary alloys, but needs to be careful with quaternary alloys and more.
  Args:
    struct_types (str / list of str): default=’inter’

      if str, one target structure; if list, a list of target structures.

      ‘inter’: intermetallic compound ‘ss’: solid solution ‘amor’: amorphous phase ‘all’: same for [‘inter’, ‘ss’, ‘amor’] [‘inter’, ‘ss’]: amorphous phase and solid solution, as an example

    ss_types (str / list of str): default=’min’, only for ss

      if str, one structure type of ss; if list, a list of structure types of ss.

      ‘fcc’: fcc solid solution ‘bcc’: bcc solid solution ‘hcp’: hcp solid solution ‘no_latt’: solid solution with no specific structure type ‘min’: min value of [‘fcc’, ‘bcc’, ‘hcp’, ‘no_latt’] ‘all’: same for [‘fcc’, ‘bcc’, ‘hcp’, ‘no_latt’] [‘fcc’, ‘bcc’]: fcc and bcc solid solutions, as an example

    data_source (str): default=’Miedema’, source of dataset
      -‘Miedema’: read from ‘Miedema.csv’

        parameterized by Miedema et al. in 1980s, containing following parameters for 73 types of elements:

        > ‘molar_volume’ ‘electron_density’ ‘electronegativity’ ‘valence_electrons’ ‘a_const’ ‘R_const’ ‘H_trans’ ‘compressibility’ ‘shear_modulus’ ‘melting_point’ ‘structural_stability’

  Returns:
    (list of floats) Miedema formation enthalpies (per atom)

      -formation_enthalpy_inter: for interatomic compound -formation_enthalpy_ss: for solid solution, can be divided into

      > ‘min’, ‘fcc’, ‘bcc’, ‘hcp’, ‘no_latt’
      >   for different lattice_types

      -formation_enthalpy_amor: for amorphous phase

  `__init__`(struct_types='inter', ss_types='min', data_source='Miedema')
  `citations`()
  `data_dir` = '/Users/ajain/Documents/code_matgen/matminer/matminer/featurizers/../utils/data_files'
  `deltaH_chem`(elements, fracs, struct)

    Chemical term of formation enthalpy Args:

    > elements (list of str): list of elements fracs (list of floats): list of atomic fractions struct (str): ‘inter’, ‘ss’ or ‘amor’

    Returns:
      deltaH_chem (float): chemical term of formation enthalpy
  `deltaH_elast`(elements, fracs)

    Elastic term of formation enthalpy Args:

    > elements (list of str): list of elements fracs (list of floats): list of atomic fractions

    Returns:
      deltaH_elastic (float): elastic term of formation enthalpy
  `deltaH_struct`(elements, fracs, latt)

    Structural term of formation enthalpy, only for solid solution Args:

    > elements (list of str): list of elements fracs (list of floats): list of atomic fractions latt (str): ‘fcc’, ‘bcc’, ‘hcp’ or ‘no_latt’

    Returns:
      deltaH_struct (float): structural term of formation enthalpy
  `deltaH_topo`(elements, fracs)

    Topological term of formation enthalpy, only for amorphous phase Args:

    > elements (list of str): list of elements fracs (list of floats): list of atomic fractions

    Returns:
      deltaH_topo (float): topological term of formation enthalpy
  `feature_labels`()
  `featurize`(comp)

    Get Miedema formation enthalpies of target structures: inter, amor, ss (can be further divided into ‘min’, ‘fcc’, ‘bcc’, ‘hcp’, ‘no_latt’

    > for different lattice_types)

    Args:
      comp: Pymatgen composition object
    Returns:
      miedema (list of floats): formation enthalpies of target structures
  `implementors`()

class `matminer.featurizers.composition.` `OxidationStates`(stats=None)

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  Statistics about the oxidation states for each specie. Features are concentration-weighted statistics of the oxidation states.

  `__init__`(stats=None)
    Args:
      stats - (list of string), which statistics compute
  `citations`()
  `feature_labels`()
  `featurize`(comp)
  classmethod `from_preset`(preset_name)
  `implementors`()

class `matminer.featurizers.composition.` `Stoichiometry`(p_list=(0, 2, 3, 5, 7, 10), num_atoms=False)

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  Calculate stoichiometric attributes.

  Parameters:
    p_list (list of ints): list of norms to calculate num_atoms (bool): whether to return number of atoms per formula unit
  `__init__`(p_list=(0, 2, 3, 5, 7, 10), num_atoms=False)
  `citations`()
  `feature_labels`()
  `featurize`(comp)

    Get stoichiometric attributes Args:

    > comp: Pymatgen composition object p_list (list of ints)

    Returns:
      p_norm (list of floats): Lp norm-based stoichiometric attributes.
        Returns number of atoms if no p-values specified.
  `implementors`()

class `matminer.featurizers.composition.` `TMetalFraction`

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  Class to calculate fraction of magnetic transition metals in a composition.

  Parameters:
    data_source (data class): source from which to retrieve element data

  Generates: Fraction of magnetic transition metal atoms in a compound

  `__init__`()
  `citations`()
  `feature_labels`()
  `featurize`(comp)
    Args:
      comp: Pymatgen Composition object
    Returns:
      frac_magn_atoms (single-element list): fraction of magnetic transitional metal atoms in a compound
  `implementors`()

class `matminer.featurizers.composition.` `ValenceOrbital`(orbitals=('s', 'p', 'd', 'f'), props=('avg', 'frac'))

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  Class to calculate valence orbital attributes

  Parameters:

    data_source (data object): source from which to retrieve element data orbitals (list): orbitals to calculate props (list): specifies whether to return average number of electrons in each orbital,

    > fraction of electrons in each orbital, or both

  `__init__`(orbitals=('s', 'p', 'd', 'f'), props=('avg', 'frac'))
  `citations`()
  `feature_labels`()
  `featurize`(comp)

    Weighted fraction of valence electrons in each orbital

    Args:
      comp: Pymatgen composition object
    Returns:
      valence_attributes (list of floats): Average number and/or
        fraction of valence electrons in specfied orbitals
  `implementors`()

`matminer.featurizers.composition.` `has_oxidation_states`(comp)

  Check if a composition object has oxidation states for each element

  TODO: Does this make sense to add to pymatgen? -wardlt

  Args:
    comp - (Composition) Composition to check
  Returns:
    (Boolean) Whether this composition object contains oxidation states

## matminer.featurizers.dos module

class `matminer.featurizers.dos.` `DOSFeaturizer`(contributors=1, significance_threshold=0.1, energy_cutoff=0.5, sampling_resolution=100, gaussian_smear=0.1)

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  Featurizes a pymatgen density of states, CompleteDos, object.

  `__init__`(contributors=1, significance_threshold=0.1, energy_cutoff=0.5, sampling_resolution=100, gaussian_smear=0.1)
    Args:
      contributors (int):
        Sets the number of top contributors to the DOS that are returned as features. (i.e. contributors=1 will only return the main cb and main vb orbital)
      significance_threshold (float):
        Sets the significance threshold for orbitals in the DOS. Does not impact the number of contributors returned. Only determines the feature value xbm_significant_contributors. The threshold is a fractional value between 0 and 1.
      energy_cutoff (float in eV):
        The extent (into the bands) to sample the DOS
      sampling_resolution (int):
        Number of points to sample DOS
      gaussian_smear (float in eV):
        Gaussian smearing (sigma) around each sampled point in the DOS
  `feature_labels`()
  `featurize`(dos)
    Args:
      dos (pymatgen CompleteDos or their dict):
        The density of states to featurize. Must be a complete DOS, (i.e. contains PDOS and structure, in addition to total DOS) and must contain the structure.
    Returns:

      xbm_score_i (float): fractions of ith contributor orbital xbm_location_i (str): fractional coordinate of ith contributor.

      > For example, ‘0.0;0.0;0.0’ if Gamma

      xbm_specie_i: (str) elemental specie of ith contributor (ex: ‘Ti’) xbm_character_i: (str) orbital character of ith contributor (s p d or f) xbm_nsignificant: (int) the number of orbitals with contributions

      > above the significance_threshold

  `implementors`()

`matminer.featurizers.dos.` `get_cbm_vbm_scores`(dos, energy_cutoff, sampling_resolution, gaussian_smear)
  Quantifies the strength of the contribution of all orbitals of various
    species/sites to the conduction band minimum (CBM) and the valence band maximum (VBM) up to energy_cutoff inside the bands from the CBM/VBM. An example use of the output may be sorting it based on cbm_score or vbm_score.
  Args:
    dos (pymatgen CompleteDos or their dict):
      The density of states to featurize. Must be a complete DOS, (i.e. contains PDOS and structure, in addition to total DOS)
    energy_cutoff (float in eV):
      The extent (into the bands) to sample the DOS
    sampling_resolution (int):
      Number of points to sample DOS
    gaussian_smear (float in eV):
      Gaussian smearing (sigma) around each sampled point in the DOS
  Returns:
    orbital_scores [(dict)]:
      A list of how much each orbital contributes to the partial density of states up to energy_cutoff. Dictionary items are: .. cbm_score: (float) fractional contribution to conduction band .. vbm_score: (float) fractional contribution to valence band .. species: (pymatgen Specie) the Specie of the orbital .. character: (str) is the orbital character s, p, d, or f .. location: [(float)] fractional coordinates of the orbital

## matminer.featurizers.site module

class `matminer.featurizers.site.` `AGNIFingerprints`(directions=(None, 'x', 'y', 'z'), etas=None, cutoff=8)

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  Integral of the product of the radial distribution function and a
    Gaussian window function. Originally used by [Botu et al] (http://pubs.acs.org/doi/abs/10.1021/acs.jpcc.6b10908) to fit empiricial potentials. These features come in two forms: atomic fingerprints and direction-resolved fingerprints. Atomic fingerprints describe the local environment of an atom and are computed using the function: :math:`A_i(eta) = sumlimits_{i

  e j} e^{-( rac{r_{ij}}{eta})^2} f(r_{ij})`

  > where is the index of the atom, is the index of a neighboring atom, is a scaling function, is the distance between atoms and , and is a cutoff function where :math:`f(r) = 0.5[cos(

  rac{pi r_{ij}}{R_c}) + 1]` if and 0 otherwise.
    The direction-resolved fingerprints are computed using :math:`V_i^k(eta) = sumlimits_{i

  e j} rac{r_{ij}^k}{r_{ij}} e^{-( rac{r_{ij}}{eta})^2} f(r_{ij})`

  > where is the component of

  > System Message: WARNING/2 (`old{r}_i - old{r}_j`)

  > latex exited with error [stdout] This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=latex) restricted \write18 enabled. entering extended mode (./math.tex LaTeX2e <2015/01/01> Babel <3.9l> and hyphenation patterns for 79 languages loaded. (/usr/local/texlive/2015/texmf-dist/tex/latex/base/article.cls Document Class: article 2014/09/29 v1.4h Standard LaTeX document class (/usr/local/texlive/2015/texmf-dist/tex/latex/base/size12.clo)) (/usr/local/texlive/2015/texmf-dist/tex/latex/base/inputenc.sty (/usr/local/texlive/2015/texmf-dist/tex/latex/ucs/utf8x.def)) (/usr/local/texlive/2015/texmf-dist/tex/latex/ucs/ucs.sty (/usr/local/texlive/2015/texmf-dist/tex/latex/ucs/data/uni-global.def)) (/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amstext.sty (/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsopn.sty)) (/usr/local/texlive/2015/texmf-dist/tex/latex/amscls/amsthm.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/amsfonts/amssymb.sty (/usr/local/texlive/2015/texmf-dist/tex/latex/amsfonts/amsfonts.sty)) (/usr/local/texlive/2015/texmf-dist/tex/latex/tools/bm.sty) (./math.aux) (/usr/local/texlive/2015/texmf-dist/tex/latex/ucs/ucsencs.def) (/usr/local/texlive/2015/texmf-dist/tex/latex/amsfonts/umsa.fd) (/usr/local/texlive/2015/texmf-dist/tex/latex/amsfonts/umsb.fd) ! Package inputenc Error: Keyboard character used is undefined (inputenc) in inputencoding `utf8x'. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.12 $^^H old{r}_i - ^^Hold{r}_j$ ! Package inputenc Error: Keyboard character used is undefined (inputenc) in inputencoding `utf8x'. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.12 $^^Hold{r}_i - ^^H old{r}_j$ [1] (./math.aux) ) (see the transcript file for additional information) Output written on math.dvi (1 page, 328 bytes). Transcript written on math.log.
  > . Parameters: TODO: Differentiate between different atom types (maybe as another class)

  `__init__`(directions=(None, 'x', 'y', 'z'), etas=None, cutoff=8)
    Args:
      directions (iterable): List of directions for the fingerprints. Can
        be one or more of ‘None`, ‘x’, ‘y’, or ‘z’

      etas (iterable of floats): List of which window widths to compute cutoff (float): Cutoff distance (Angstroms)

  `citations`()
  `feature_labels`()
  `featurize`(struct, idx)
  `implementors`()

class `matminer.featurizers.site.` `ChemEnvSiteFingerprint`(cetypes, strategy, geom_finder, max_csm=8, max_dist_fac=1.41)

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  Site fingerprint computed from pymatgen’s ChemEnv package that provides resemblance percentages of a given site to ideal environments. Args:

  > cetypes ([str]): chemical environments (CEs) to be
  >   considered.

  > strategy (ChemenvStrategy): ChemEnv neighbor-finding strategy. geom_finder (LocalGeometryFinder): ChemEnv local geometry finder. max_csm (float): maximum continuous symmetry measure (CSM;

  > > default of 8 taken from chemenv). Note that any CSM larger than max_csm will be set to max_csm in order to avoid negative values (i.e., all features are constrained to be between 0 and 1).

  > max_dist_fac (float): maximum distance factor (default: 1.41).

  `__init__`(cetypes, strategy, geom_finder, max_csm=8, max_dist_fac=1.41)
  `citations`()
  `feature_labels`()
  `featurize`(struct, idx)

    Get ChemEnv fingerprint of site with given index in input structure. Args:

    > struct (Structure): Pymatgen Structure object. idx (int): index of target site in structure struct.

    Returns:
      (numpy array): resemblance fraction of target site to ideal
        local environments.
  static `from_preset`(preset)

    Use a standard collection of CE types and choose your ChemEnv neighbor-finding strategy. Args:

    > preset (str): preset types (“simple” or
    >   “multi_weights”).

    Returns:
      ChemEnvSiteFingerprint object from a preset.
  `implementors`()

class `matminer.featurizers.site.` `ChemicalSRO`(nn)

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  Chemical short-range ordering (SRO) features to evaluate the deviation of local chemistry with the nominal composition of the structure. f_el = N_el/(sum of N_el) - c_el, where N_el is the number of each element type in the neighbors around the target site, sum of N_el is the sum of all possible element types (coordination number), and c_el is the composition of the specific element in the entire structure. Here the calculation is run for each element present in the structure. A positive f_el indicates the “bonding” with the specific element is favored, at least in the target site; A negative f_el indicates the “bonding” is not favored, at least in the target site. Args:

  > nn (NearestNeighbor): instance of one of pymatgen’s Nearest Neighbor
  >   classes.

  `__init__`(nn)
  static `cal_el_amt`(structs)

    Identify and “store” the element types and composition of structures, avoiding repeated calculation of composition when featurizing many sites in one structure. Args:

    > structs (pandas series): series of pymatgen Structures

    Returns:
      (list of str): elements present in the structures (dict): composition dicts of the structures
  `citations`()
  `feature_labels`()
  `featurize`(struct, idx)

    Get CSRO features of site with given index in input structure. Args:

    > struct (Structure): Pymatgen Structure object. idx (int): index of target site in structure.

    Returns:
      (list of floats): Chemical SRO features for each element.
  `featurize_dataframe`(df, col_id, ignore_errors=True, inplace=True, n_jobs=1)

    Featurize the dataframe with ChemicalSRO features. Args:

    > df (pandas dataframe): Dataframe containing input data col_id (str or [str]): The dataframe key corresponding to structures

    Returns:
      (pandas dataframe) ChemicalSRO-featurized dataframe
  static `from_preset`(preset)

    Use one of the standard instances of a given NearNeighbor class. Args:

    > preset (str): preset type (“VoronoiNN”, “JMolNN”,
    >   “MiniumDistanceNN”, “MinimumOKeeffeNN”, or “MinimumVIRENN”).

    Returns:
      ChemicalSRO from a preset.
  `implementors`()

class `matminer.featurizers.site.` `CoordinationNumber`(nn, use_weights=False)

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  Coordination number (CN) computed using one of pymatgen’s NearNeighbor classes for determination of near neighbors contributing to the CN. Args:

  > nn (NearNeighbor): instance of one of pymatgen’s NearNeighbor
  >   classes.

  `__init__`(nn, use_weights=False)
  `citations`()
  `feature_labels`()
  `featurize`(struct, idx)

    Get coordintion number of site with given index in input structure. Args:

    > struct (Structure): Pymatgen Structure object. idx (int): index of target site in structure struct.

    Returns:
      (float): coordination number.
  static `from_preset`(preset)

    Use one of the standard instances of a given NearNeighbor class. Args:

    > preset (str): preset type (“VoronoiNN”, “JMolNN”,
    >   “MiniumDistanceNN”, “MinimumOKeeffeNN”, or “MinimumVIRENN”).

    Returns:
      CoordinationNumber from a preset.
  `implementors`()

class `matminer.featurizers.site.` `CrystalSiteFingerprint`(optypes, override_cn1=True, cutoff_radius=8, tol=0.01, cation_anion=False)

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  A site fingerprint intended for periodic crystals. The fingerprint represents the value of various order parameters for the site; each value is the product two quantities: (i) the value of the order parameter itself and (ii) a factor that describes how consistent the number of neighbors is with that order parameter. Note that we can include only factor (ii) using the “wt” order parameter which is always set to 1.

  `__init__`(optypes, override_cn1=True, cutoff_radius=8, tol=0.01, cation_anion=False)

    Initialize the CrystalSiteFingerprint. Use the from_preset() function to use default params. Args:

    > optypes (dict): a dict of coordination number (int) to a list of str
    >   representing the order parameter types
    > override_cn1 (bool): whether to use a special function for the single
    >   neighbor case. Suggest to keep True.

    > cutoff_radius (int): radius in Angstroms for neighbor finding tol (float): numerical tolerance (in case your site distances are

    > > not perfect or to correct for float tolerances)

    > cation_anion (bool): whether to only consider cation<->anion bonds
    >   (bonds with zero charge are also allowed)

  `citations`()
  `feature_labels`()
  `featurize`(struct, idx)

    Get crystal fingerprint of site with given index in input structure. Args:

    > struct (Structure): Pymatgen Structure object. idx (int): index of target site in structure.

    Returns:
      list of weighted order parameters of target site.
  static `from_preset`(preset, cation_anion=False)

    Use preset parameters to get the fingerprint Args:

    > preset (str): name of preset (“cn” or “ops”) cation_anion (bool): whether to only consider cation<->anion bonds

    > > (bonds with zero charge are also allowed)

  `implementors`()

class `matminer.featurizers.site.` `EwaldSiteEnergy`(accuracy=None)

  Bases: `object`

  Compute site energy from Coulombic interactions User notes:

  > - This class uses that charges that are already-defined for the structure.
  > - Ewald summations can be expensive. If you evaluating every site in many large structures, run all of the sites for each structure at the same time. We cache the Ewald result for the structure that was run last, so looping over sites and then structures is faster than structures than sites.

  Features:
    ewald_site_energy - Energy for the site computed from Coulombic interactions
  `__init__`(accuracy=None)
    Args:
      accuracy (int): Accuracy of Ewald summation, number of decimal places
  `citations`()
  `feature_labels`()
  `featurize`(strc, idx)
    Args:
      struct (Structure): Pymatgen Structure object. idx (int): index of target site in structure.
    Returns:
      ([float]) - Electrostatic energy of the site
  `implementors`()

class `matminer.featurizers.site.` `OPSiteFingerprint`(target_motifs=None, dr=0.1, ddr=0.01, ndr=1, dop=0.001, dist_exp=2, zero_ops=True)

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  Local structure order parameters computed from the neighbor environment of a site. For each order parameter, we determine the neighbor shell that complies with the expected coordination number. For example, we find the 4 nearest neighbors for the tetrahedral OP, the 6 nearest for the octahedral OP, and the 8 nearest neighbors for the bcc OP. If we don’t find such a shell, the OP is either set to zero or evaluated with the shell of the next largest observed coordination number. Args:

  > target_motifs (dict): target op or motif type where keys
  >   are corresponding coordination numbers (e.g., {4: “tetrahedral”}).
  > dr (float): width for binning neighbors in unit of relative
  >   distances (= distance/nearest neighbor distance). The binning is necessary to make the neighbor-finding step robust against small numerical variations in neighbor distances (default: 0.1).

  > ddr (float): variation of width for finding stable OP values. ndr (int): number of width variations for each variation direction

  > > (e.g., ndr = 0 only uses the input dr, whereas ndr=1 tests dr = dr - ddr, dr, and dr + ddr.

  > dop (float): binning width to compute histogram for each OP
  >   if ndr > 0.
  > dist_exp (boolean): exponent for distance factor to multiply
  >   order parameters with that penalizes (large) variations in distances in a given motif. 0 will switch the option off (default: 2).
  > zero_ops (boolean): set an OP to zero if there is no neighbor
  >   shell that complies with the expected coordination number of a given OP (e.g., CN=4 for tetrahedron; default: True).

  `__init__`(target_motifs=None, dr=0.1, ddr=0.01, ndr=1, dop=0.001, dist_exp=2, zero_ops=True)
  `citations`()
  `feature_labels`()
  `featurize`(struct, idx)

    Get OP fingerprint of site with given index in input structure. Args:

    > struct (Structure): Pymatgen Structure object. idx (int): index of target site in structure.

    Returns:
      opvals (numpy array): order parameters of target site.
  `implementors`()

class `matminer.featurizers.site.` `VoronoiFingerprint`(cutoff=6.0, use_weights=False, stats_vol=None, stats_area=None, stats_dist=None)

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  Calculate the following sets of features based on Voronoi tessellation analysis around the target site: -Voronoi indices {n_i}

  > n_i denotes the number of i-edged facets, and i is in the range of 3-10. e.g. for bcc lattice, the Voronoi indices are [0,6,0,8,…];

  > > for fcc/hcp lattice, the Voronoi indices are [0,12,0,0,…]; for icosahedra, the Voronoi indices are [0,0,12,0,…];

  -i-fold symmetry indices

    computed as n_i/sum(n_i), and i is in the range of 3-10. reflect the strength of i-fold symmetry in local sites. e.g. for bcc lattice, the i-fold symmetry indices are [0,6/14,0,8/14,…]

    > > indicating both 4-fold and a stronger 6-fold symmetries are present;

    > for fcc/hcp lattice, the i-fold symmetry factors are [0,1,0,0,…],
    >   indicating only 4-fold symmetry is present;
    > for icosahedra, the Voronoi indices are [0,0,1,0,…],
    >   indicating only 5-fold symmetry is present;

  -weighted i-fold symmetry indices
    if use_weights = True
  -Voronoi volume
    total volume of the Voronoi polyhedron around the target site
  -Voronoi volume statistics of the sub_polyhedra formed by each facet
    and the center site e.g. stats_vol = [‘mean’, ‘std_dev’, ‘minimum’, ‘maximum’]
  -Voronoi area
    total area of the Voronoi polyhedron around the target site
  -Voronoi area statistics of the facets
    e.g. stats_area = [‘mean’, ‘std_dev’, ‘minimum’, ‘maximum’]
  -Voronoi nearest-neighboring distance statistics
    e.g. stats_dist = [‘mean’, ‘std_dev’, ‘minimum’, ‘maximum’]
  Args:
    cutoff (float): cutoff distance in determining the potential
      neighbors for Voronoi tessellation analysis.
    use_weights(bool): whether to use weights to derive weighted
      i-fold symmetry indices.

    stats_vol (list of str): volume statistics types. stats_area (list of str): area statistics types. stats_dist (list of str): neighboring distance statistics types.

  `__init__`(cutoff=6.0, use_weights=False, stats_vol=None, stats_area=None, stats_dist=None)
  `citations`()
  `feature_labels`()
  `featurize`(struct, idx)

    Get Voronoi fingerprints of site with given index in input structure. Args:

    > struct (Structure): Pymatgen Structure object. idx (int): index of target site in structure.

    Returns:
      (list of floats): Voronoi fingerprints
        -Voronoi indices -i-fold symmetry indices -weighted i-fold symmetry indices (if use_weights = True) -Voronoi volume -Voronoi volume statistics -Voronoi area -Voronoi area statistics -Voronoi area statistics
  `implementors`()
  static `vol_tetra`(vt1, vt2, vt3, vt4)

    Calculate the volume of a tetrahedron, given the four vertices of vt1, vt2, vt3 and vt4 Args:

    > vt1 (array-like): coordinates of vertex 1. vt2 (array-like): coordinates of vertex 2. vt3 (array-like): coordinates of vertex 3. vt4 (array-like): coordinates of vertex 4.

    Returns:
      (float): volume of the tetrahedron.

## matminer.featurizers.stats module

class `matminer.featurizers.stats.` `PropertyStats`

  Bases: `object`

  This class contains statistical operations that are commonly employed when computing features.

  The primary way for interacting with this class is to call the `calc_stat` function, which takes the name of the statistic you would like to compute and the weights/values of data to be assessed. For example, computing the mean of a list looks like:

      x = [1, 2, 3]
      PropertyStats.calc_stat(x, 'mean') # Result is 2
      PropertyStats.calc_stat(x, 'mean', weights=[0, 0, 1]) # Result is 3

  Some of the statistics functions take options (e.g., Holder means). You can pass them to the the statistics functions by adding them after the name and two colons. For example, the 0th Holder mean would be:

      PropertyStats.calc_stat(x, 'holder_mean::0')

  You can, of course, call the statistical functions directly. All take at least two arguments. The first is the data being assessed and the second, optional, argument is the weights.

  static `avg_dev`(data_lst, weights=None)

    Mean absolute deviation of list of element data.

    This is computed by first calculating the mean of the list, and then computing the average absolute difference between each value and the mean.

    Args:
      data_lst (list of floats): List of values to be assessed weights (list of floats): Weights for each value
    Returns:
      mean absolute deviation
  static `calc_stat`(data_lst, stat, weights=None)

    Compute a property statistic

    Args:

      data_lst (list of floats): list of values stat (str) - Name of property to be compute. If there are arguments to the statistics function, these

      > should be added after the name and separated by two colons. For example, the 2nd Holder mean would be “holder_mean::2”

      weights (list of floats): (Optional) weights for each element in data_lst

    Returns:
      float - Desired statistic
  static `eigenvalues`(data_lst, symm=False, sort=False)

    Return the eigenvalues of a matrix as a numpy array Args:

    > data_lst: (matrix-like) of values symm: whether to assume the matrix is symmetric sort: wheter to sort the eigenvalues

    Returns: eigenvalues

  static `flatten`(data_lst)

    Returns a flattened copy of data_lst-as a numpy array

  static `geom_std_dev`(data_lst, weights=None)

    Geometric standard deviation

    Args:
      data_lst (list of floats): List of values to be assessed weights (list of floats): Weights for each value
    Returns:
      geometric standard deviation
  static `holder_mean`(data_lst, weights=None, power=1)

    Get Holder mean Args:

    > data_lst: (list/array) of values weights: (list/array) of weights power: (int/float/str) which holder mean to compute

    Returns: Holder mean

  static `inverse_mean`(data_lst, weights=None)

    Mean of the inverse of each entry

    Args:
      data_lst (list of floats): List of values to be assessed weights (list of floats): Weights for each value
    Returns:
      inverse mean
  static `maximum`(data_lst, weights=None)

    Maximum value in a list

    Args:
      data_lst (list of floats): List of values to be assessed weights: (ignored)
    Returns:
      maximum value
  static `mean`(data_lst, weights=None)

    Arithmetic mean of list

    Args:
      data_lst (list of floats): List of values to be assessed weights (list of floats): Weights for each value
    Returns:
      mean value
  static `minimum`(data_lst, weights=None)

    Minimum value in a list

    Args:
      data_lst (list of floats): List of values to be assessed weights: (ignored)
    Returns:
      minimum value
  static `mode`(data_lst, weights=None)

    Mode of a list of data.

    If multiple elements occur equally-frequently (or same weight, if weights are provided), this function will return the minimum of those values.

    Args:
      data_lst (list of floats): List of values to be assessed weights (list of floats): Weights for each value
    Returns:
      mode
  static `range`(data_lst, weights=None)

    Range of a list

    Args:
      data_lst (list of floats): List of values to be assessed weights: (ignored)
    Returns:
      range
  static `sorted`(data_lst)

    Returns the sorted data_lst

  static `std_dev`(data_lst, weights=None)

    Standard deviation of a list of element data

    Args:
      data_lst (list of floats): List of values to be assessed weights (list of floats): Weights for each value
    Returns:
      standard deviation

## matminer.featurizers.structure module

class `matminer.featurizers.structure.` `BagofBonds`(nn, bbv=0.0, allowed_bonds=None, approx_bonds=False)

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  Compute the number of each kind of bond in a structure, as a fraction of the total number of bonds, based on NearestNeighbors.

  For example, in a structure with 2 Li-O bonds and 3 Li-P bonds:

  Li-0: 0.4 Li-P: 0.6

  For dataframes containing structures with various compositions, a unified dataframe is returned which has the collection of bond types gathered from all structures as columns. Use allowed_bonds and approx_bonds to intelligently limit the possible bonds in the dataframe.

  Args:
    nn (NearestNeighbors): A Pymatgen nearest neighbors derived object. For
      example, pymatgen.analysis.local_env.VoronoiNN().
    bbv (float): The ‘bad bond values’, values substituted for
      structure-bond combinations which can not physically exist, but exist in the unified dataframe. For example, if a dataframe contains structures of BaLiP and BaTiO3, determines the value to place in the Li-P column for the BaTiO3 row; by default, is 0.
    allowed_bonds ([str]): A list of allowed bond types; limits the possible
      columns in the output dataframe. If a structure has a bond type not in allowed_bonds, the bond is skipped and all allowed bonds are returned as normal (including bad bond values). Behavior can be changed with approx_bonds. The output of .feature_labels() will return a list of allowed_bonds for that BagofBonds object.
    approx_bonds (bool): If True, approximates the fractions of bonds not
      in allowed_bonds (forbidden bonds) with similar allowed bonds. Chemical rules are used to determine which bonds are most ‘similar’; particularly, the Euclidean distance between the 2-tuples of the bonds in Mendeleev no. space is minimized for the approximate bond chosen.
  `__init__`(nn, bbv=0.0, allowed_bonds=None, approx_bonds=False)
  `citations`()
  `enumerate_all_bonds`(structures)

    Identify all the unique, possible bonds types of all structures present, and create the ‘unified’ bonds list.

    Args:
      structures (list/ndarray): List of pymatgen Structures
    Returns:
      A tuple of unique, possible bond types for an entire list of structures. This tuple is used to form the unified feature labels.
  `enumerate_bonds`(s)

    Lists out all the bond possibilities in a single structure.

    Args:
      s (Structure): A pymatgen structure
    Returns:
      A list of bond types in ‘Li-O’ form, where the order of the elements in each bond type is alphabetic.
  `feature_labels`()

    If an entire dataframe is featurized, returns all unique possible bonds gathered across all structures.

    If only .featurize called, returns all bond labels for the last structure featurized.

  `featurize`(s)

    Quantify the fractions of each bond type in a structure.

    For collections of structures, bonds types which are not found in a particular structure (e.g., Li-P in BaTiO3) are represented as NaN.

    Args:
      s (Structure): A pymatgen structure object
    Returns:
      (list) The feature list of bond fractions, in the order of the
        alphabetized corresponding bond names.
  `featurize_dataframe`(df, col_id, *args, **kwargs)

    Compute features for all entries contained in input dataframe. Necessary for returning the correct unified dataframe.

    Args:
      df (Pandas dataframe): Dataframe containing input data col_id (str or [str]): The dataframe key corresponding to structures
    Returns:
      (DataFrame) BagofBonds-featurized dataframe
  static `from_preset`(preset)

    Use one of the standard instances of a given NearNeighbor class.

    Args:
      preset (str): preset type (“VoronoiNN”, “JMolNN”, “MiniumDistanceNN”, “MinimumOKeeffeNN”, or “MinimumVIRENN”).
    Returns:
      CoordinationNumber from a preset.
  `implementors`()

class `matminer.featurizers.structure.` `CoulombMatrix`(diag_elems=True)

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  Generate the Coulomb matrix, M, of the input structure (or molecule). The Coulomb matrix was put forward by Rupp et al. (Phys. Rev. Lett. 108, 058301, 2012) and is defined by off-diagonal elements M_ij = Z_i*Z_j/|R_i-R_j| and diagonal elements 0.5*Z_i^2.4, where Z_i and R_i denote the nuclear charge and the position of atom i, respectively.

  Args:
    diag_elems: (bool) flag indicating whether (True, default) to use
      the original definition of the diagonal elements; if set to False, the diagonal elements are set to zero.
  `__init__`(diag_elems=True)
  `citations`()
  `feature_labels`()
  `featurize`(s)

    Get Coulomb matrix of input structure.

    Args:
      s: input Structure (or Molecule) object.
    Returns:
      m: (Nsites x Nsites matrix) Coulomb matrix.
  `implementors`()

class `matminer.featurizers.structure.` `DensityFeatures`(desired_features=None)

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  `__init__`(desired_features=None)
  `citations`()
  `feature_labels`()
  `featurize`(s)
  `implementors`()

class `matminer.featurizers.structure.` `ElectronicRadialDistributionFunction`(cutoff=None, dr=0.05)

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  Calculate the crystal structure-inherent electronic radial distribution function (ReDF) according to Willighagen et al., Acta Cryst., 2005, B61, 29-36. The ReDF is a structure-integral RDF (i.e., summed over all sites) in which the positions of neighboring sites are weighted by electrostatic interactions inferred from atomic partial charges. Atomic charges are obtained from the ValenceIonicRadiusEvaluator class. Args:

  > cutoff: (float) distance up to which the ReDF is to be
  >   calculated (default: longest diagaonal in primitive cell).

  > dr: (float) width of bins (“x”-axis) of ReDF (default: 0.05 A).

  `__init__`(cutoff=None, dr=0.05)
  `citations`()
  `feature_labels`()
  `featurize`(s)

    Get ReDF of input structure.

    Args:
      s: input Structure object.
    Returns: (dict) a copy of the electronic radial distribution
      functions (ReDF) as a dictionary. The distance list (“x”-axis values of ReDF) can be accessed via key ‘distances’; the ReDF itself is accessible via key ‘redf’.
  `implementors`()

class `matminer.featurizers.structure.` `EwaldEnergy`(accuracy=None)

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  Compute the energy from Coulombic interactions

  Note: The energy is computed using _charges already defined for the structure_.

  Features:
    ewald_energy - Coulomb interaction energy of the structure
  `__init__`(accuracy=None)
    Args:
      accuracy (int): Accuracy of Ewald summation, number of decimal places
  `citations`()
  `feature_labels`()
  `featurize`(strc)
    Args:
      (Structure) - Structure being analyzed
    Returns:
      ([float]) - Electrostatic energy of the structure
  `implementors`()

class `matminer.featurizers.structure.` `GlobalSymmetryFeatures`(desired_features=None)

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  `__init__`(desired_features=None)
  `citations`()
  `crystal_idx` = {'triclinic': 7, 'monoclinic': 6, 'orthorhombic': 5, 'tetragonal': 4, 'trigonal': 3, 'hexagonal': 2, 'cubic': 1}
  `feature_labels`()
  `featurize`(s)
  `implementors`()

class `matminer.featurizers.structure.` `MinimumRelativeDistances`(cutoff=10.0)

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  Determines the relative distance of each site to its closest neighbor. We use the relative distance, f_ij = r_ij / (r^atom_i + r^atom_j), as a measure rather than the absolute distances, r_ij, to account for the fact that different atoms/species have different sizes. The function uses the valence-ionic radius estimator implemented in Pymatgen. Args:

  > cutoff: (float) (absolute) distance up to which tentative
  >   closest neighbors (on the basis of relative distances) are to be determined.

  `__init__`(cutoff=10.0)
  `citations`()
  `feature_labels`()
  `featurize`(s, cutoff=10.0)

    Get minimum relative distances of all sites of the input structure.

    Args:
      s: Pymatgen Structure object.
    Returns:
      min_rel_dists: (list of floats) list of all minimum relative
        distances (i.e., for all sites).
  `implementors`()

class `matminer.featurizers.structure.` `OrbitalFieldMatrix`(period_tag=False)

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  This function generates an orbital field matrix (OFM) as developed by Pham et al (arXiv, May 2017). Each atom is described by a 32-element vector (or 39-element vector, see period tag for details) uniquely representing the valence subshell. A 32x32 (39x39) matrix is formed by multiplying two atomic vectors. An OFM for an atomic environment is the sum of these matrices for each atom the center atom coordinates with multiplied by a distance function (In this case, 1/r times the weight of the coordinating atom in the Voronoi Polyhedra method). The OFM of a structure or molecule is the average of the OFMs for all the sites in the structure.

  Args:
    period_tag (bool): In the original OFM, an element is represented
      by a vector of length 32, where each element is 1 or 0, which represents the valence subshell of the element. With period_tag=True, the vector size is increased to 39, where the 7 extra elements represent the period of the element. Note lanthanides are treated as period 6, actinides as period 7. Default False as in the original paper.
  …attribute:: size
    Either 32 or 39, the size of the vectors used to describe elements.
  `__init__`(period_tag=False)
  `citations`()
  `feature_labels`()
  `featurize`(s)

    Makes a supercell for structure s (to protect sites from coordinating with themselves), and then finds the mean of the orbital field matrices of each site to characterize a structure

    Args:
      s (Structure): structure to characterize
    Returns:
      mean_ofm (size X size matrix): orbital field matrix
        characterizing s
  `get_atom_ofms`(struct, symm=False)

    Calls get_single_ofm for every site in struct. If symm=True, get_single_ofm is called for symmetrically distinct sites, and counts is constructed such that ofms[i] occurs counts[i] times in the structure

    Args:

      struct (Structure): structure for find ofms for symm (bool): whether to calculate ofm for only symmetrically

      > distinct sites

    Returns:

      ofms ([size X size matrix] X len(struct)): ofms for struct if symm:

      > ofms ([size X size matrix] X number of symmetrically distinct sites):
      >   ofms for struct

      > counts: number of identical sites for each ofm

  `get_mean_ofm`(ofms, counts)

    Averages a list of ofms, weights by counts

  `get_ohv`(sp, period_tag)

    Get the “one-hot-vector” for pymatgen Element sp. This 32 or 39-length vector represents the valence shell of the given element. Args:

    > sp (Element): element whose ohv should be returned period_tag (bool): If true, the vector contains items

    > > corresponding to the period of the element

    Returns:
      my_ohv (numpy array length 39 if period_tag, else 32): ohv for sp
  `get_single_ofm`(site, site_dict)

    Gets the orbital field matrix for a single chemical environment, where site is the center atom whose environment is characterized and site_dict is a dictionary of site : weight, where the weights are the Voronoi Polyhedra weights of the corresponding coordinating sites.

    Args:
      site (Site): center atom site_dict (dict of Site:float): chemical environment
    Returns:
      atom_ofm (size X size numpy matrix): ofm for site
  `get_structure_ofm`(struct)

    Calls get_mean_ofm on the results of get_atom_ofms to give a size X size matrix characterizing a structure

  `implementors`()

class `matminer.featurizers.structure.` `PartialRadialDistributionFunction`(cutoff=20.0, bin_size=0.1)

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  Compute the partial radial distribution function (PRDF) of a crystal structure, which is the radial distibution function broken down for each pair of atom types. The PRDF was proposed as a structural descriptor by [Schutt et al.] (https://journals.aps.org/prb/abstract/10.1103/PhysRevB.89.205118) Args:

  > cutoff: (float) distance up to which to calculate the RDF. bin_size: (float) size of each bin of the (discrete) RDF.

  `__init__`(cutoff=20.0, bin_size=0.1)
  `citations`()
  `feature_labels`()
  `featurize`(s)

    Get PRDF of the input structure. Args:

    > s: Pymatgen Structure object.

    Returns:
      prdf, dist: (tuple of arrays) the first element is a
        dictionary where keys are tuples of element names and values are PRDFs.
  `implementors`()

class `matminer.featurizers.structure.` `RadialDistributionFunction`(cutoff=20.0, bin_size=0.1)

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  Calculate the radial distribution function (RDF) of a crystal structure. Args:

  > cutoff: (float) distance up to which to calculate the RDF. bin_size: (float) size of each bin of the (discrete) RDF.

  `__init__`(cutoff=20.0, bin_size=0.1)
  `citations`()
  `feature_labels`()
  `featurize`(s)

    Get RDF of the input structure. Args:

    > s: Pymatgen Structure object.

    Returns:
      rdf, dist: (tuple of arrays) the first element is the
        normalized RDF, whereas the second element is the inner radius of the RDF bin.
  `implementors`()

class `matminer.featurizers.structure.` `RadialDistributionFunctionPeaks`(n_peaks=2)

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  Determine the location of the highest peaks in the radial distribution function (RDF) of a structure. Args:

  > n_peaks: (int) number of the top peaks to return .

  `__init__`(n_peaks=2)
  `citations`()
  `feature_labels`()
  `featurize`(rdf)

    Get location of highest peaks in RDF.

    Args:
      rdf: (ndarray) RDF as obtained from the
        RadialDistributionFunction class.
    Returns: (ndarray) distances of highest peaks in descending order
      of the peak height
  `implementors`()

class `matminer.featurizers.structure.` `SineCoulombMatrix`(diag_elems=True)

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  This function generates a variant of the Coulomb matrix developed for periodic crystals by Faber et al. (Inter. J. Quantum Chem. 115, 16, 2015). It is identical to the Coulomb matrix, except that the inverse distance function is replaced by the inverse of a sin**2 function of the vector between the sites which is periodic in the dimensions of the structure lattice. See paper for details.

  Args:
    diag_elems (bool): flag indication whether (True, default) to use
      the original definition of the diagonal elements; if set to False, the diagonal elements are set to 0
  `__init__`(diag_elems=True)
  `citations`()
  `feature_labels`()
  `featurize`(s)
    Args:
      s (Structure or Molecule): input structure (or molecule)
    Returns:
      (Nsites x Nsites matrix) Sine matrix.
  `implementors`()

class `matminer.featurizers.structure.` `SiteStatsFingerprint`(site_featurizer, stats=('mean', 'std_dev', 'minimum', 'maximum'), min_oxi=None, max_oxi=None)

  Bases: `matminer.featurizers.base.BaseFeaturizer`

  Calculates all order parameters (OPs) for all sites in a crystal structure. Args:

  > site_featurizer (BaseFeaturizer): a site-based featurizer stats ([str]): list of weighted statistics to compute for each feature.

  > > If stats is None, for each order parameter, a list is returned that contains the calculated parameter for each site in the structure. *Note for nth mode, stat must be ‘n*_mode’; e.g. stat=‘2nd_mode’

  > min_oxi (int): minimum site oxidation state for inclusion (e.g.,
  >   zero means metals/cations only)

  > max_oxi (int): maximum site oxidation state for inclusion

  `__init__`(site_featurizer, stats=('mean', 'std_dev', 'minimum', 'maximum'), min_oxi=None, max_oxi=None)
  `citations`()
  `feature_labels`()
  `featurize`(s)

    Calculate all sites’ local structure order parameters (LSOPs).

    Args:

      s: Pymatgen Structure object.

      Returns:
        vals: (2D array of floats) LSOP values of all sites’ (1st dimension) order parameters (2nd dimension). 46 order parameters are computed per site: q_cn (coordination number), q_lin, 35 x q_bent (starting with a target angle of 5 degrees and, increasing by 5 degrees, until 175 degrees), q_tet, q_oct, q_bcc, q_2, q_4, q_6, q_reg_tri, q_sq, q_sq_pyr.
  static `from_preset`(preset, **kwargs)
  `implementors`()
  static `n_numerical_modes`(data_lst, n=2, dl=0.1)
    Returns the n first modes of a data set that are obtained with
      a finite bin size for the underlying frequency distribution.
    Args:
      data_lst ([float]): data values. n (integer): number of most frequent elements to be determined. dl (float): bin size of underlying (coarsened) distribution.
    Returns:
      ([float]): first n most frequent entries (or nan if not found).

`matminer.featurizers.structure.` `get_op_stats_vector_diff`(s1, s2, max_dr=0.2, ddr=0.01, ddist=0.01)

  Determine the difference vector between two order parameter-statistics feature vector resulting from two input structures.

  Args:
    s1 (Structure): first input structure. s2 (Structure): second input structure. max_dr (float): maximum neighbor-finding parameter to be tested. ddr (float): step size for increasing neighbor-finding parameter. ddist (float): bin size for histogramming distances of varying dr.
  Returns: (float, [float]) optimal neighbor-finding parameter
    and difference vector between order parameter-statistics feature vectors obtained from the two input structures (s1 - s2).

## Module contents