Add vdw radius as a feature

Hi all,

I want to know if can use mat-miner to featurize vdw radius for each element using the composition. I looked through the documentation, but could not find any information related to this.


Have you already looked at ElementProperty? It lets you map compositions to features based on the property of the elements, and I’d be surprised if we don’t have vdw as an available feature

Hi Logan,

Thanks for the prompt reply. While looking at the features summary I could not find any info related to vdw radius.

May be I am not looking at the right place. If you could provide any pointers that will be very helpful.


Hey Alex,

What you’ll need to do is create an ElementProperty featurizer then define the vdw Radius as a elemental property it should use.

For vdw, you can use the one from the Magpie element property set ( that looks like:

feat = ElementProperty("magpie", ["vdwRadius"], ["mean"])  # Compute the mean vdw radius of the compositions using the Magpie feature set.

See here for more details on ElementProperty:

Thanks Logan. This certainty helped me to improve my understanding of matminer.

The issue related to adding ‘vdwRadius’ as a feature however, still remains. I tested your suggestion with the following:

from matminer.featurizers.composition import ElementProperty
import pandas as pd
from pymatgen.core import Composition

# Initialize the ElementProperty featurizer
ep_featurizer = ElementProperty("magpie", ["vdwRadius"], ["mean"])

# List of chemical formulas
chemical_formulas = ['H', 'He', 'Li', 'Be', 'B', 'C']

# Create Composition objects from formulas
compositions = [Composition(formula) for formula in chemical_formulas]
df = pd.DataFrame({'composition': compositions})

# Initialize the ElementProperty featurizer

# Compute elemental properties
features = ep_featurizer.featurize_dataframe(df, col_id="composition")

# Print the computed features

This give me following error.

Traceback (most recent call last):
  File "/usr/lib/python3.8/multiprocessing/", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/usr/lib/python3.8/multiprocessing/", line 48, in mapstar
    return list(map(*args))
  File "/home/alex/.local/lib/python3.8/site-packages/matminer/featurizers/", line 514, in featurize_wrapper
    raise type(e)(msg).with_traceback(sys.exc_info()[2])
  File "/home/alex/.local/lib/python3.8/site-packages/matminer/featurizers/", line 497, in featurize_wrapper
    return self.featurize(*x)
  File "/home/alex/.local/lib/python3.8/site-packages/matminer/featurizers/composition/", line 180, in featurize
    elem_data = [self.data_source.get_elemental_property(e, attr) for e in elements]
  File "/home/alex/.local/lib/python3.8/site-packages/matminer/featurizers/composition/", line 180, in <listcomp>
    elem_data = [self.data_source.get_elemental_property(e, attr) for e in elements]
  File "/home/alex/.local/lib/python3.8/site-packages/matminer/utils/", line 223, in get_elemental_property
    return self.all_elemental_props[property_name][elem.symbol]
KeyError: "'vdwRadius'\nTO SKIP THESE ERRORS when featurizing specific compounds, set 'ignore_errors=True' when running the batch featurize() operation (e.g., featurize_many(), featurize_dataframe(), etc.)."

Note that the I also tested the code above with “ignore_errors=True”, but it gives vdwRadius as NaN. However vdwRadius data is available in the VdWRadius.table for some of the elements in my dataframe.

If I change “vdwRadius” with other features listed at

tt works fine. Strangely vdwRadius is not there in the list of magpie features.

Thanks for you time.