Hi, I cannot use ElementFraction on a pandas dataframe, but it works when it is used on just one variable. ElementFraction does not work even though I use the code provided by the materials project workshop (Machine Learning with MatMiner - The Materials Project Workshop).
When I run the code provided in the workshop, I get into an infinite loop which produces the text:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your child processes and you have forgotten to use the proper idiom in the main module: if __name__ == '__main__': freeze_support() ... The "freeze_support()" line can be omitted if the program is not going to be frozen to produce an executable.
This is the code from the workshop that I try to run:
from pymatgen.core import Composition
fe2o3 = Composition(“Fe2O3”)
from matminer.featurizers.composition.element import ElementFraction
ef = ElementFraction()
element_fractions = ef.featurize(fe2o3)
element_fraction_labels = ef.feature_labels()
from matminer.datasets.dataset_retrieval import load_dataset
df = load_dataset(“brgoch_superhard_training”)
df = ef.featurize_dataframe(df, “composition”)