import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.neural_network import MLPRegressor

#CSV of data
filepath = 'H:\\Data\\'
file = 'ScaledData'

#Read in data
features = pd.read_csv(filepath + file + '.csv')

#Features that we want to use are called the labels, we remove them from the features
labels = np.array([features['xVector'], features['yVector'], features['zVector'], features['length'], features['timeFromBeginning']])
features= features.drop('xVector', axis = 1)
features= features.drop('yVector', axis = 1)
features= features.drop('zVector', axis = 1)
features= features.drop('length', axis = 1)
features= features.drop('timeFromBeginning', axis = 1)
feature_list = list(features.columns)
features = np.array(features)

# Instantiate model with 1000 layers
rf = MLPRegressor(100)

# Train the model on training data
rf.fit(features, labels.transpose());

# Predict future events
futureEvents = np.array([521553,521554,521800])
predictions = rf.predict(futureEvents.reshape(-1, 1))

I am trying to predict values of future events. There are 521553 data points that I am trying to learn based on and I am trying to predict future behavior. The data is all scaled to be between -1 and 1. Changing the event number that I am predicting the location and length and time of, I barely get a change in the predicted values even though the input values have a range over all values (and are rapidly varying). I have read somewhere that I should have a final linear layer though I didn't understand why to do this. I have simplified the code to what I think is the bare minimum required to show the problem.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.