SOAP featurizer - 'str' object has no attribute 'composition'

37 views
Skip to first unread message

lc...@liverpool.ac.uk

unread,
May 5, 2019, 5:28:22 AM5/5/19
to matminer
Hi there,

I am trying to use the SOAP featurizer you have implemented recently (thanks guys!), but I am getting error messages complaining there is no 'composition' attribute in the Structure object. However, I haven't been able to figure out how to include 'composition' in a pymatgen Structure object - or perhaps I am misunderstanding something here. 

I am attaching here a screen grab.

Many thanks,
Linjiang



Screenshot from 2019-05-05 10-26-34.png


Chen, Linjiang

unread,
May 6, 2019, 10:59:26 AM5/6/19
to Logan Ward, matminer

Hi Logan,


Thanks a lot for your quick reply - greatly appreciated.


I have changed it as advised, but I am seeing a different error as shown below, which is all I use to set a SOAP featurize (I must have missed something here)...


Many thanks,

Linjiang







________________________________________
From: Logan Ward <ward.l...@gmail.com>
Sent: 06 May 2019 14:26
To: Chen, Linjiang; matminer
Subject: RE: SOAP featurizer - 'str' object has no attribute 'composition'

Hello Linjiang,

The “fit” operations in matminer require the data as input, which is different than the “featurize_dataframe” operation that takes the name of the column.

Try changing:

“soap_fit.fit(strucs_dataset, ‘Structure_obj’)”

to

“soap_fit.fit(strucs_dataset[‘Structure_obj’])”

Best,
Logan



From: lc...@liverpool.ac.uk<mailto:lc...@liverpool.ac.uk>
Sent: Sunday, May 5, 2019 4:28 AM
To: matminer<mailto:matm...@googlegroups.com>
Subject: SOAP featurizer - 'str' object has no attribute 'composition'

Hi there,

I am trying to use the SOAP featurizer you have implemented recently (thanks guys!), but I am getting error messages complaining there is no 'composition' attribute in the Structure object. However, I haven't been able to figure out how to include 'composition' in a pymatgen Structure object - or perhaps I am misunderstanding something here.

I am attaching here a screen grab.

Many thanks,
Linjiang




[Screenshot from 2019-05-05 10-26-34.png]

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

ard...@lbl.gov

unread,
May 6, 2019, 12:59:15 PM5/6/19
to matminer
Hi Linjiang,

What version of dscribe are you using?

If you look in the requirements-optional.txt file in matminer we specify the version we use: dscribe==0.1.8

If you are using a newer version of dscribe which does not have the "normalize" argument for SOAP, this will be the source of the error. If this is the case, we would appreciate a pull request on the matminer repo to reflect changes in newer versions of dscribe!

Thanks,
Alex

Logan Ward

unread,
May 7, 2019, 12:05:40 PM5/7/19
to lc...@liverpool.ac.uk, matminer

Hello Linjiang,

 

The “fit” operations in matminer require the data as input, which is different than the “featurize_dataframe” operation that takes the name of the column.

 

Try changing:

 

“soap_fit.fit(strucs_dataset, ‘Structure_obj’)”

 

to

 

“soap_fit.fit(strucs_dataset[‘Structure_obj’])”

 

Best,

Logan

 

 

From: lc...@liverpool.ac.uk
Sent: Sunday, May 5, 2019 4:28 AM
To: matminer
Subject: SOAP featurizer - 'str' object has no attribute 'composition'

 

Hi there,

--

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.

Screenshot from 2019-05-05 10-26-34.png

Anubhav Jain

unread,
May 10, 2019, 2:28:11 PM5/10/19
to matminer
Hi Linjiang

I also just want to clarify that SOAP was implemented by the dscribe team (https://arxiv.org/abs/1904.08875 , https://github.com/SINGROUP/dscribe/) and matminer just adds a wrapper around dscribe for this descriptor. If you do use this code, please make sure to credit and cite the dscribe team's effort.

I've also updated the implementors list and citations() function for the SOAP descriptor to better convey this.

Hope it all works now!

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

Reply all
Reply to author
Forward
0 new messages