def predict_with_neuron(model_class, X_train, y_train, X_valid, 
                              lrate, epochs, on_epoch_end_callback=None):
    """
    Args:
        X_train (np.ndarray of shape (N, m): Features of the training set
        y_train (np.ndarray of shape (N,): Target values of the training set
        X_valid (np.ndarray of shape (V, m): Features of the validation set
        lrate (float): learning rate
        epochs (int): number of epochs
        on_epoch_end_callback (function): A function that accepts as an 
            argument an integer (the index of current iterator) and a 
            LinearNeuron object. This function can be used as a callback in 
            order to perform some action at the end of every epoch 

    Returns:
        The predictions of the trained neuron for X_valid and a np.ndarray 
        vector with the parameters of the trained neuron.
    """
    dims = X_train.shape[1]
    model = model_class(dims) 
    model.fit(X_train, y_train, lrate, epochs, on_epoch_end_callback)
    predictions = model.predict(X_valid)
    parameters = model.theta
    
    return predictions, parameters