def model_fit(train, config):
    (n_input, n_filters, n_kernel, n_epochs, n_batch) = config
    data = series_to_supervised(train, n_input)
    (train_x, train_y) = (data[:, :(- 1)], data[:, (- 1)])
    train_x = train_x.reshape((train_x.shape[0], train_x.shape[1], 1))
    model = Sequential()
    model.add(Conv1D(n_filters, n_kernel, activation='relu', input_shape=(n_input, 1)))
    model.add(Conv1D(n_filters, n_kernel, activation='relu'))
    model.add(MaxPooling1D())
    model.add(Flatten())
    model.add(Dense(1))
    model.compile(loss='mse', optimizer='adam')
    model.fit(train_x, train_y, epochs=n_epochs, batch_size=n_batch, verbose=0)
    return model
def model_fit(train, config):
    (n_input, n_filters, n_kernel, n_epochs, n_batch) = config
    data = series_to_supervised(train, n_input)
    (train_x, train_y) = (data[:, :(- 1)], data[:, (- 1)])
    train_x = train_x.reshape((train_x.shape[0], train_x.shape[1], 1))
    model = Sequential()
    model.add(Conv1D(n_filters, n_kernel, activation='relu', input_shape=(n_input, 1)))
    model.add(Conv1D(n_filters, n_kernel, activation='relu'))
    model.add(MaxPooling1D())
    model.add(Flatten())
    model.add(Dense(1))
    model.compile(loss='mse', optimizer='adam')
    model.fit(train_x, train_y, epochs=n_epochs, batch_size=n_batch, verbose=0)
    return model