I\'m following this tutorial to make this ML prediction:
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import style
style.use(\"ggplot\
I faced the same issue except that the data type of the instance I wanted to predict was a panda.Series object.
Well I just needed to predict one input instance. I took it from a slice of my data.
df = pd.DataFrame(list(BiogasPlant.objects.all()))
test = df.iloc[-1:] # sliced it here
In this case, you'll need to convert it into a 1-D array and then reshape it.
test2d = test.values.reshape(1,-1)
From the docs, values will convert Series into a numpy array.