Trying to make a ML model to predict Formation energy from structure

I am beginner in this area any help is really appreciated ,thank you

Following are the codes that i have used

results=mpr.summary.search(formula=[“ABC3”],fields=[“structure”,“formation_energy_per_atom”],band_gap=(1,4))

mean_atomic_numbers=[]

max_atomic_numbers=[]

min_atomic_numbers=[]

std_atomic_numbers=[]

a_parameters=[]

b_parameter=[]

c_parameters=[]

alpha_parameters=[]

beta_parameters=[]

gamma_parameters=[]

mean_distance_matrix=[]

max_distance_numbers=[]

min_distance_numbers=[]

std_distance_numbers=[]

formation_energy_per_atom=[]

for r in results:

poscar=r[“poscar”]

FE= r[“formation_energy_per_atom”]

parser =CifParser.from_string(cif)

```
structure=parser.get_structure()
structure=structure[0]
mean_atomic_numbers +=[np.mean(structure.atomic_numbers)]
max_atomic_numbers +=[np.max(structure.atomic_numbers)]
min_atomic_numbers +=[np.min(structure.atomic_numbers)]
std_atomic_numbers +=[np.std(structure.atomic_numbers)]
a_parameters +=[structure.lattice.abc[0]]
b_parameters +=[structure.lattice.abc[1]]
c_parameters +=[structure.lattice.abc[2]]
alpha_parameters +=[structure.lattice.angles[0]]
beta_parameters +=[structure.lattice.angles[1]]
gamma_parameters +=[structure.lattice.angles[2]]
mean_distribution_matrix +=[np.mean(structure.distance_matrix)]
max_distribution_matrix +=[np.max(structure.distance_matrix)]
min_distribution_matrix +=[np.min(structure.distance_matrix)]
std_distribution_matrix +=[np.std(structure.distance_matrix)]
formation_energy_per_atom += [FE]
TypeError Traceback (most recent call last)
```

Cell In[13], line 2

1 for r in results:

----> 2 poscar=r[“poscar”]

3 FE= r[“formation_energy_per_atom”]

4 parser =CifParser.from_string(cif)

TypeError: ‘MPDataDoc’ object is not subscriptable