How to use the matminer.datasets.load_dataset function in matminer

To help you get started, we’ve selected a few matminer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hackingmaterials / automatminer / mslearn / data / load.py View on Github external
Returns:
        mpid (input): material id via MP
        formula (input):
        structure (input): dict form of Pymatgen structure
        nsites (input): The number of sites in the structure

        gap pbe (target): Band gap in eV
        refractive index (target): Estimated refractive index
        ep_e poly (target): Polycrystalline electronic contribution to
            dielectric constant (estimate/avg)
        ep poly (target): Polycrystalline dielectric constant (estimate/avg)
        pot. ferroelectric (target): If imaginary optical phonon modes present at
            the Gamma point, the material is potentially ferroelectric
    """
    df = load_dataset("dielectric_constant")
    dropcols = ['volume', 'space_group', 'e_electronic', 'e_total']
    df = df.drop(dropcols, axis=1)
    df['structure'] = [s.as_dict() for s in df['structure']]
    colmap = {'material_id': 'mpid',
              'band_gap': 'gap pbe',
              'n': 'refractive index',
              'poly_electronic': 'ep_e poly',
              'poly_total': 'ep poly',
              'pot_ferroelectric': 'pot. ferroelectric'
              }
    df = df.rename(columns=colmap)
    return df
github hackingmaterials / automatminer / mslearn / data / load.py View on Github external
References:
        1) https://www.nature.com/articles/sdata201553
        2) https://www.sciencedirect.com/science/article/pii/S0927025618303252

    Returns:
        mpid (input): material id via MP
        formula (input): string formula
        structure (input): dict form of Pymatgen structure
        nsites (input): The number of sites in the structure

        eij_max (target): Maximum attainable absolute value of the longitudinal
            piezoelectric modulus
        vmax_x/y/z (target): vmax = [vmax_x, vmax_y, vmax_z]. vmax is the
            direction of eij_max (or family of directions, e.g., <111>)
    """
    df = load_dataset("piezoelectric_tensor")
    df['v_max'] = [np.fromstring(str(x)[1:-1], sep=',') for x in df['v_max']]
    df['vmax_x'] = [v[0] for v in df['v_max']]
    df['vmax_y'] = [v[1] for v in df['v_max']]
    df['vmax_z'] = [v[2] for v in df['v_max']]

    dropcols = ['point_group', 'piezoelectric_tensor', 'volume', 'space_group',
                'v_max']
    df['structure'] = [s.as_dict() for s in df['structure']]
    df = df.drop(columns=dropcols, axis=1)
    colmap = {'material_id': 'mpid'}
    df = df.rename(columns=colmap)
    return df
github hackingmaterials / automatminer / mslearn / data / load.py View on Github external
mpid (input): material id via MP
        formula (input):
        structure (input): dict form of Pymatgen structure
        nsites (input): The number of sites in the structure

        elastic anisotropy (target): ratio of anisotropy of elastic properties
        shear modulus (target): in GPa
        bulk modulus (target): in GPa
        poisson ratio (target):

    Notes:
        This function may return a subset of information which is present in
        load_mp. However, this dataframe is 'clean' with regard to elastic
        properties.
    """
    df = load_dataset("elastic_tensor_2015")
    dropcols = ['volume', 'space_group', 'G_Reuss', 'G_Voigt', 'K_Reuss',
                'K_Voigt', 'compliance_tensor', 'elastic_tensor',
                'elastic_tensor_original']
    df = df.drop(dropcols, axis=1)
    df['structure'] = [s.as_dict() for s in df['structure']]
    colmap = {'material_id': 'mpid',
              'elastic_anisotropy': 'elastic anisotropy',
              'G_VRH': 'shear modulus',
              'K_VRH': 'bulk modulus',
              'poisson_ratio': 'poisson ratio',
              }
    df = df.rename(columns=colmap)
    return df
github hackingmaterials / automatminer / automatminer_dev / workflows / single.py View on Github external
ssh.load_system_host_keys()
        ssh.connect(host, username=user, password=password, look_for_keys=False)

        with SCPClient(ssh.get_transport()) as scp:
            scp.put(filepath, recursive=True,
                    remote_path="/global/home/users/ardunn")
    else:
        pass


if __name__ == "__main__":
    import pandas as pd
    from matminer.datasets import load_dataset
    from automatminer_dev.workflows.util import get_time_str

    df = load_dataset("matbench_jdft2d")
    transfer_data(df, "lrc", get_time_str())
github hackingmaterials / automatminer / mslearn / data / load.py View on Github external
3938 structures and formation energies from "Crystal Structure
    Representations for Machine Learning Models of Formation Energies."

    References:
        1) https://arxiv.org/abs/1503.07406
        2) https://aip.scitation.org/doi/full/10.1063/1.4812323

    Returns:
        mpid (input): material id via MP
        formula (input): string formula
        structure (input): dict form of Pymatgen structure

        e_form (target): Formation energy in eV/atom
        e_hull (target): Energy above hull, in form
    """
    df = load_dataset("flla")
    df = df.drop(["formula", "formation_energy", "nsites"], axis=1)
    df["formula"] = [s.composition.reduced_formula for s in df['structure']]
    df["structure"] = [s.as_dict() for s in df['structure']]
    df = df.rename(
        {"formation_energy_per_atom": "e_form", "e_above_hull": "e_hull",
         "material_id": "mpid"}, axis=1)
    return df