featurize a specific POSCAR

H community,

I am looking for a way to read a given POSCAR file and then calculate all the possible feature from it. Is this possible with matminer? If yes, could you please give me an example on how to code this work? Thanks

Huan

Hi Huan

  1. convert the POSCAR to a pymatgen Structure object using Structure.from_file() method in pymatgen

  2. Apply any featurizer directly to that Structure object

For example the code below:

···

====

from matminer.featurizers.composition import ElementProperty

from matminer.featurizers.structure import DensityFeatures

from pymatgen import Structure

s = Structure.from_file("/Users/ajain/Desktop/POSCAR")

comp_features = ElementProperty.from_preset(“magpie”).featurize(s.composition)

print(comp_features)

s_features = DensityFeatures().featurize(s)

print(s_features)

====

If you have a lot of structures (many POSCARs), you could also first create a DataFrame with a “structure” column and then follow the other tutorials as needed

On Sunday, August 11, 2019 at 7:05:33 AM UTC-7, Huan Tran wrote:

H community,

I am looking for a way to read a given POSCAR file and then calculate all the possible feature from it. Is this possible with matminer? If yes, could you please give me an example on how to code this work? Thanks

Huan

Thank you, Anubhav. This is greatly helpful for us.
Regards

Huan

···

On Fri, Aug 16, 2019 at 2:50 PM Anubhav Jain [email protected] wrote:

Hi Huan

  1. convert the POSCAR to a pymatgen Structure object using Structure.from_file() method in pymatgen
  1. Apply any featurizer directly to that Structure object

For example the code below:

====

from matminer.featurizers.composition import ElementProperty

from matminer.featurizers.structure import DensityFeatures

from pymatgen import Structure

s = Structure.from_file("/Users/ajain/Desktop/POSCAR")

comp_features = ElementProperty.from_preset(“magpie”).featurize(s.composition)

print(comp_features)

s_features = DensityFeatures().featurize(s)

print(s_features)

====

If you have a lot of structures (many POSCARs), you could also first create a DataFrame with a “structure” column and then follow the other tutorials as needed

On Sunday, August 11, 2019 at 7:05:33 AM UTC-7, Huan Tran wrote:

H community,

I am looking for a way to read a given POSCAR file and then calculate all the possible feature from it. Is this possible with matminer? If yes, could you please give me an example on how to code this work? Thanks

Huan

You received this message because you are subscribed to the Google Groups “matminer” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To view this discussion on the web visit https://groups.google.com/d/msgid/matminer/5dde8038-2b17-4653-b81c-fc23813695cd%40googlegroups.com.