'How to test a ML model on a new dataset (not on the test split)?

I was working on a project which dealt with text classification, after training, I want to test it out on a new dataset which is not the test split of the original data. What is the exact procedure here?

Both the datasets have 3 columns, out of which 1 of them is the input and one other is the output class and the third is just serial number (not required)

The dataset looks like this: enter image description here

What I've tried so far:

df = pd.read_csv('data.csv', header=0,index_col=0)
x = df['In']
y = df['Out']
new_model = tf.keras.models.load_model('test_1.h5') #test_1.h5 is the saved model
y_p=new_model.predict(x)

Which gives me a weird error:

    ValueError: Negative dimension size caused by subtracting 5 from 1 for '{{node sequential_18/conv1d_2/conv1d}} = Conv2D[T=DT_FLOAT, data_format="NHWC", dilations=[1, 1, 1, 1], explicit_paddings=[], padding="VALID", strides=[1, 1, 1, 1], use_cudnn_on_gpu=true](sequential_18/conv1d_2/conv1d/ExpandDims, sequential_18/conv1d_2/conv1d/ExpandDims_1)' with input shapes: [?,1,1,50], [1,5,50,128].

I am new to this field and I am guessing it is because of the way I am inputting the test data. Am I doing it right?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source