Hi,
I have not tested all composition features.
Three of the features, AtomicOribitals, ElectronAffinity and ElectronegativityDiff do not work. I believe all these features require X.featurize_dataframe(df,’‘composition_oxid’) unlike the other composition features which require composition, i.e. X.featurize_dataframe(df,’‘composition’)
Below is one example error that I got from running and extending the tutorial in the link:
from matminer.featurizers.composition import ElectronegativityDiff
ED_feat = ElectronegativityDiff()
df = ED_feat.featurize_dataframe(df, ‘composition_oxid’)
ElectronegativityDiff: 100%|█████████████████████████████████████████████████████████| 1181/1181 [00:00<00:00, 6325.20it/s]
multiprocessing.pool.RemoteTraceback:
“”"
Traceback (most recent call last):
File “/home/dxs/.local/lib/python3.6/site-packages/matminer/featurizers/base.py”, line 493, in featurize_wrapper
return self.featurize(x)
File “/home/dxs/.local/lib/python3.6/site-packages/matminer/featurizers/composition.py”, line 512, in featurize
anions, anion_fractions = zip([(s, x) for s, x in comp.items() if s.oxi_state < 0])
ValueError: not enough values to unpack (expected 2, got 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/lib64/python3.6/multiprocessing/pool.py”, line 119, in worker
result = (True, func(*args, **kwds))
File “/usr/lib64/python3.6/multiprocessing/pool.py”, line 44, in mapstar
return list(map(*args))
File “/home/dxs/.local/lib/python3.6/site-packages/matminer/featurizers/base.py”, line 508, in featurize_wrapper
reraise(type(e), type(e)(msg), sys.exc_info()[2])
File “/usr/local/lib/python3.6/site-packages/six.py”, line 692, in reraise
raise value.with_traceback(tb)
File “/home/dxs/.local/lib/python3.6/site-packages/matminer/featurizers/base.py”, line 493, in featurize_wrapper
return self.featurize(x)
File “/home/dxs/.local/lib/python3.6/site-packages/matminer/featurizers/composition.py”, line 512, in featurize
anions, anion_fractions = zip([(s, x) for s, x in comp.items() if s.oxi_state < 0])
ValueError: not enough values to unpack (expected 2, got 0)
To skip errors when featurizing specific compounds, consider running the batch featurize() operation (e.g., featurize_many(), featurize_dataframe(), etc.) with ignore_errors=True
“”"
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “”, line 1, in
File “/home/dxs/.local/lib/python3.6/site-packages/matminer/featurizers/base.py”, line 340, in featurize_dataframe
pbar=pbar)
File “/home/dxs/.local/lib/python3.6/site-packages/matminer/featurizers/base.py”, line 467, in featurize_many
return p.map(func, entries, chunksize=self.chunksize)
File “/usr/lib64/python3.6/multiprocessing/pool.py”, line 266, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File “/usr/lib64/python3.6/multiprocessing/pool.py”, line 644, in get
raise self._value
ValueError: not enough values to unpack (expected 2, got 0)
To skip errors when featurizing specific compounds, consider running the batch featurize() operation (e.g., featurize_many(), featurize_dataframe(), etc.) with ignore_errors=True