Code Documentation: Feature Generators

mastml.legos.feature_generators Module

This module contains a collection of classes for generating input features to fit machine learning models to.

Functions

clean_dataframe(df) Method to clean dataframes after feature generation has occurred, to remove columns that have a single missing or NaN value, or remove a row that is fully empty

Classes

BaseEstimator Base class for all estimators in scikit-learn.
ContainsElement(composition_feature, …[, …]) Class to generate new categorical features (i.e.
DataframeUtilities Class of basic utilities for dataframe manipulation, and exchanging between dataframes and numpy arrays
Magpie(composition_feature[, feature_types]) Class that wraps MagpieFeatureGeneration, giving it scikit-learn structure
MagpieFeatureGeneration(dataframe, …) Class to generate new features using Magpie data and dataframe containing material compositions
MaterialsProject(composition_feature, api_key) Class that wraps MaterialsProjectFeatureGeneration, giving it scikit-learn structure
MaterialsProjectFeatureGeneration(dataframe, …) Class to generate new features using Materials Project data and dataframe containing material compositions Datarame must have a column named “Material compositions”.
Matminer(structural_features, structure_col) Class to generate structural features from matminer structure module Args: structural_features: the structure feature(s) the user wants to instantiate and generate structure_col: the dataframe column that contains the pymatgen structure object.
NoGenerate() Class for having a “null” transform where the output is the same as the input.
PolynomialFeatures([features, degree, …]) Class to generate polynomial features using scikit-learn’s polynomial features method More info at: http://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.PolynomialFeatures.html
SklearnPolynomialFeatures alias of sklearn.preprocessing._data.PolynomialFeatures
TransformerMixin Mixin class for all transformers in scikit-learn.

Class Inheritance Diagram

Inheritance diagram of mastml.legos.feature_generators.ContainsElement, mastml.legos.feature_generators.DataframeUtilities, mastml.legos.feature_generators.Magpie, mastml.legos.feature_generators.MagpieFeatureGeneration, mastml.legos.feature_generators.MaterialsProject, mastml.legos.feature_generators.MaterialsProjectFeatureGeneration, mastml.legos.feature_generators.Matminer, mastml.legos.feature_generators.NoGenerate, mastml.legos.feature_generators.PolynomialFeatures