Regarding Features in Matminer

Hello all,

I want to know that for a particular dataset that I have, which featurizers would be helpful to generate? How to know which module would be relevant depending on the properties that I have in my dataset?
For example, i have the compositions in my dataset. But when i use CompositionToStructureFromMP () to convert it into structures, i get only NaN. I dont get the new feature. Kindly help.

Thank you.

Hey there,

It can be difficult to determine a priori what features will be informative for your model.

You might try out automatminer (GitHub - hackingmaterials/automatminer: An automatic engine for predicting materials properties.) which can work if your dataset only has compositions (i.e., if structures are not available).

For your second question, do you have some example code we can try to reproduce the issue with? It might be the case that the materials project does not have structures matching the compositions you are looking for.


Note that CompositionToStructureFromMP() should only work if your compositions are ones that in the MP database, usually simple inorganic compounds like SiO2. If you are not seeing results but are confident the compositions are present in the Materials Project database please let us know the composition(s) that are failing.

Thank you for your replies.

Yes, the compositions that I am using are from Materials Project database itself. I am using binary nitrides.

@Anubhav_Jain Just a follow up regarding the compositions I am using.

I have created my own dataset (of binary nitrides) with the compositions taken from the Materials Project database. That should be fine right? I believe we can load our own datasets and work, and it need not always be imported from matminer? But I still get NaN for simple compounds like SiO2 and Al2O3. Please find attached a snapshot of the same.

I see, what is the error message you get if you turn ignore_errors=False?

I get this error:

"MPRestError: REST query returned with error status code 403. Content: b’{“valid_response”: false, “error”: “API_KEY is not supplied.”, “version”: {“db”: “2021_02_08”, “pymatgen”: “2021.2.8.1”, “rest”: “2.0”}, “created_at”: “2021-03-02T17:58:24.373420”}’
TO SKIP THESE ERRORS when featurizing specific compounds, set ‘ignore_errors=True’ when running the batch featurize() operation (e.g., featurize_many(), featurize_dataframe(), etc.). "

you need to set the mapi_key parameter of the featurizer to your Materials Project API key

I have the API key. How do I set the mapi_key parameter to it?
Thank you.

@Anubhav_Jain I have the API key. Could you tell how do I set the mapi_key parameter to it?
Thank you.

cts = CompositionToStructureFromMP(mapi_key=“YOUR_API_KEY”)

Sorry, but if you are unable to figure it out from here, I doubt I can provide further assistance.

Got it, thanks alot!