How to use the matminer.featurizers.site.CrystalNNFingerprint.from_preset 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 / robocrystallographer / robocrys / condense / fingerprint.py View on Github external
for more details.
        stats: The stats to include in fingerprint. See
            :class:`matminer.featurizers.structure.SiteStatsFingerprint``
            for more details.
        prototype_match: Whether to use distance cutoffs and electron negativity
            differences when calculating the structure fingerprint.

    Returns:
        The structure fingerprint as a :class:`numpy.ndarray`.
    """
    # TODO: Add distance_cutoff option to matminer so we can user preset arg
    # currently don't use SiteStatsFingerprint.from_preset as we need to pass in
    # distance_cutoffs param
    if prototype_match:
        ssf = SiteStatsFingerprint(
            CrystalNNFingerprint.from_preset(
                "ops", cation_anion=False, distance_cutoffs=None,
                x_diff_weight=None
            ),
            stats=stats
        )
    else:
        ssf = SiteStatsFingerprint(
            CrystalNNFingerprint.from_preset("ops", cation_anion=False),
            stats=stats)
    return np.array(ssf.featurize(structure))
github hackingmaterials / robocrystallographer / robocrys / condense / fingerprint.py View on Github external
The structure fingerprint as a :class:`numpy.ndarray`.
    """
    # TODO: Add distance_cutoff option to matminer so we can user preset arg
    # currently don't use SiteStatsFingerprint.from_preset as we need to pass in
    # distance_cutoffs param
    if prototype_match:
        ssf = SiteStatsFingerprint(
            CrystalNNFingerprint.from_preset(
                "ops", cation_anion=False, distance_cutoffs=None,
                x_diff_weight=None
            ),
            stats=stats
        )
    else:
        ssf = SiteStatsFingerprint(
            CrystalNNFingerprint.from_preset("ops", cation_anion=False),
            stats=stats)
    return np.array(ssf.featurize(structure))