I have regression problem, where there are around 20 features, the expected output is prices(in float). Can I use Convolutional neural network here to predict the prices. I used both 1D,2D convolution.
But I get below errors,
For 2D,error is
ValueError: Input 0 of layer sequential_4 is incompatible with the layer: : expected min_ndim=4, found ndim=2. Full shape received: (None, 18)
For 1D, error is
ValueError: Input 0 of layer sequential_4 is incompatible with the layer: : expected min_ndim=3, found ndim=2. Full shape received: (None, 18)
Can I use CNN for data other than images? What I am missing here. Please help here.
Below is the code,
model2 = tf.keras.Sequential()
model2.add(tf.keras.layers.Conv1D(32,kernel_size=(3),strides=1, activation='relu'))
model2.add(tf.keras.layers.BatchNormalization())
model2.add(tf.keras.layers.Conv1D(64, kernel_size=(3), strides=(2)))
model2.add(tf.keras.layers.ReLU())
model2.add(tf.keras.layers.BatchNormalization())
model2.add(tf.keras.layers.Dense(1, activation='linear'))
model2.compile(optimizer='adam',loss='mean_absolute_error',metrics['mean_absolute_error'])