My Original Dataset is of the shape (210,8) and I'm trying to give the 7 Independent Variables as Input to my Neural Network to see which Class/Category they belong to. The Class/Category is the Target Variable.
I have separated the independent variables and stored them in 'df_test' as an array
df = pd.read_csv('https://raw.githubusercontent.com/siiddd/WheatSeeds/master/Wheat.csv')
features = ['Area', 'Perimeter', 'Compactness', 'Length of Kernel','Width of Kernel', 'Asymmetric Coeff.', 'Length of Kernel Groove']
dftoArray = df[features].to_numpy()
df_test = dftoArray.reshape(7,210)
model = keras.Sequential()
model.add(keras.Input(shape = (7, )))
model.add(keras.layers.Dense(500, activation = 'relu'))
model.add(keras.layers.Dense(1, activation = 'sigmoid'))
model.compile(optimizer = 'adam', loss = 'sparse_categorical_crossentropy', metrics = ['accuracy'])
model.fit(df_test, df['Class'], epochs = 10, validation_split = 0.10)
This gives me the error:
Error when checking input: expected input_18 to have 3 dimensions, but got array with shape (7, 210)