I was following the "How to train chemical formula only datasets" tutorial from the document. I noticed that the tutorial had an incorrect function name of get_chem_only_descriptor instead of get_chem_only_descriptors. The following code block worked for me.
import numpy as np
from jarvis.ai.descriptors.cfid import get_chem_only_descriptors
# Load a dataset, you can use pandas read_csv also to generte my_data
# Here is a sample dataset
my_data = [
["CoAl", 1],
["CoNi", 2],
["CoNb2Ni5", 3],
["Co1.2Al2.3NiRe2", 4],
["Co", 5],
["CoAlTi", 1],
["CoNiTi", 2],
["CoNb2Ni5Ti", 3],
["Co1.2Al2.3NiRe2Ti", 4],
["CoTi", 5],
["CoAlFe", 1],
["CoNiFe", 2],
["CoNb2Ni5Fe", 3],
["Co1.2Al2.3NiRe2Fe", 4],
["CoFe", 5],
]
# Convert my_data to numpy array
X = []
Y = []
IDs = []
for ii, i in enumerate(my_data):
X.append(get_chem_only_descriptors(i[0]))
Y.append(i[1])
IDs.append(ii)
X = np.array(X)
Y = np.array(Y).reshape(-1, 1)
IDs = np.array(IDs)
print(X, Y)
I was following the "How to train chemical formula only datasets" tutorial from the document. I noticed that the tutorial had an incorrect function name of
get_chem_only_descriptor
instead ofget_chem_only_descriptors
. The following code block worked for me.