cannot apply featurize_dataframe with VoronoiFingerprint, AverageBondLength or AverageBondAngle

93 views
Skip to first unread message

Libin Wen

unread,
Dec 17, 2018, 3:23:00 AM12/17/18
to matminer
Hi, 

I am trying to use the VoronoiFingerprint (or AverageBondLength, or AverageBondAngle) to featurize my structures. The featurize() function works well if given a "structure" and a  proper "idx". 
It seems there is no way to pass the "idx" parameter to the featurize_dataframe() function and the featurization process always raises an error similar to the following: 


AverageBondLength: 100%|████████████████████████████████████████████████████████| 2322/2322 [00:00<00:00, 9241.78it/s]
---------------------------------------------------------------------------
RemoteTraceback                           Traceback (most recent call last)
RemoteTraceback:
"""
Traceback (most recent call last):
  File "
~/miniconda3/envs/py3/lib/python3.6/site-packages/matminer/featurizers/base.py", line 396, in featurize_wrapper
    return self.featurize(*x)
TypeError: featurize() missing 1 required positional argument: 'idx'


Except this question, I wonder whether there is a suggested way to featurize a general structure without the need to specify an "idx", since the number of "sites" are different in different structures. 


Other information: I am using matminer 0.4.6 and most of other featurizers work well.

Sincerely, 
Libin

Logan Ward

unread,
Dec 17, 2018, 10:08:04 AM12/17/18
to Libin Wen, matminer

Hello Libin,

 

Thanks for the question!

 

As you’ve noticed, the featurizers you mentioned (VoronoiFingerprint, etc) are designed to retrieve properties of a certain atomic site. If you want to describe a complete structure, you should use the “SiteStatsFingerprint” (see docs here), which will compute the features of each site in a structure and then create a composite feature for the structure by computing statistics of those site properties.

 

We have an example that uses this kind of functionality in our examples repository: https://github.com/hackingmaterials/matminer_examples/blob/master/notebooks/machine-learning/voronoi-ward-prb-2017.ipynb

 

Does this solve your problem?

 

Best,

Logan

--
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 matminer+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

Libin Wen

unread,
Dec 17, 2018, 10:56:37 AM12/17/18
to matminer
Thank you Logan, your answer clearly solved my problem. 


Sincerely, 

Libin Wen

Nahom Aymere

unread,
Jun 10, 2019, 9:59:24 AM6/10/19
to matminer
Hi Logan,
Is there still  an example on github using SiteStatsFingerprint? The link you gave is no longer valid.
Thank you
Nahom

To unsubscribe from this group and stop receiving emails from it, send an email to matm...@googlegroups.com.

Logan Ward

unread,
Jun 10, 2019, 10:21:20 AM6/10/19
to Nahom Aymere, matminer

To unsubscribe from this group and stop receiving emails from it, send an email to matminer+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/matminer/af353379-0a9d-458c-bb83-6cb24de768f8%40googlegroups.com.

Nahom Aymere

unread,
Jun 11, 2019, 10:19:18 AM6/11/19
to matminer
Hi Logan,
1)Is there a documentation about these SiteStatsFingerprint.from_preset arguments such as "LocalPropertyDifference_ward-prb-2017", is there a list of these possible preset arguments?
2) I was also wondering if you have examples for site.featurizers. I do not understand how I get index of target site in structure struct.
Thanks Nahom

To unsubscribe from this group and stop receiving emails from it, send an email to matm...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages