I want to know is there any way to train the neural network in python with unequal length of Input and Target data.
Sample Files:
Thanks in advance
I want to know is there any way to train the neural network in python with unequal length of Input and Target data.
Sample Files:
Thanks in advance
Re: AttributeError: 'list' object has no attribute 'values'
:
You've defined transformed_input_data
and transformed_output_data
both as type list
.
transformed_input_data = [[x] for x in input_data]
transformed_output_data = [[x] for x in output_data]
A list
doesn't have a .values
property. Try removing .values
from the error-causing line. Here's a brief example:
from sklearn.neural_network import MLPClassifier
mlp = MLPClassifier()
input_data = [0,1,2]
output_data = [10,9,8]
transformed_input_data = [[x] for x in input_data]
transformed_output_data = [[x] for x in output_data]
mlp.fit(X=transformed_input_data, y=transformed_output_data)
Output:
MLPClassifier(activation='relu', alpha=0.0001, batch_size='auto', beta_1=0.9,
beta_2=0.999, early_stopping=False, epsilon=1e-08,
hidden_layer_sizes=(100,), learning_rate='constant',
learning_rate_init=0.001, max_iter=200, momentum=0.9,
nesterovs_momentum=True, power_t=0.5, random_state=None,
shuffle=True, solver='adam', tol=0.0001, validation_fraction=0.1,
verbose=False, warm_start=False)
FWIW, .values
is available as an attribute of Pandas Series
objects, which do share some properties with lists. For Series
objects, .values
turns them into a Numpy ndarray
.
Re: plotting output and error
What kind of plot do you want to make? It will help to be specific and provide some example data. That issue may be most appropriate as a separate question.