0
$\begingroup$


I have three features {feature1, feature2, feature3} the middle have negative sign for some values and i am trying to predict the middle one using LSTM with window size of 10 but i get very high RMS and printing the expected vs predicted doesn't show good values, the difference is really high. The below is a histogram for the three features and boxplot.
enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here
note that i tried to normalize the data as below

scaler1 = MinMaxScaler(feature_range=(0, 1))
df['NormFeature1'] = scaler1.fit_transform(df[["Feature1"]])
scaler2 = MinMaxScaler(feature_range=(-1, 1))
df['NormFeature2'] = scaler2.fit_transform(df[["Feature2"]])
scaler3 = MinMaxScaler(feature_range=(0, 1))
df['NormFeature3'] = scaler3.fit_transform(df[["Feature3"]])


I also tried to remove the outliers using the below code, but didn't get better, also you can check the histogram for after removing the outliers.
The below code is repeated for the three features before the MinMaxScalar just replaced the index in line 2 with the index of the feature

data = np.asarray(df)
normalized_data = preprocessing.StandardScaler().fit_transform(data[:,[index]])
outliers_rows, outliers_columns = np.where(np.abs(normalized_data)>3)
df = df.drop(df.index[outliers_rows])

And here is another look for the Histograms
enter image description here enter image description here
Couldn't add new histogram here because of the max number of links


example of the predicted data

>Expected=-10.0, Predicted=-0.7
>Expected=6.0, Predicted=-0.2
>Expected=-6.0, Predicted=-1.1
>Expected=-10.0, Predicted=-0.1
>Expected=40.0, Predicted=0.4
>Expected=-5.0, Predicted=-3.2
>Expected=0.0, Predicted=-2.6
>Expected=15.0, Predicted=-1.7
>Expected=-13.0, Predicted=-3.0
>Expected=-3.0, Predicted=-2.2
>Expected=-5.0, Predicted=0.3
>Expected=-39.0, Predicted=-0.6
>Expected=3.0, Predicted=3.3
>Expected=13.0, Predicted=1.4
>Expected=-11.0, Predicted=-1.5
>Expected=20.0, Predicted=-0.9
>Expected=13.0, Predicted=-1.8
>Expected=4.0, Predicted=-3.7
>Expected=13.0, Predicted=-2.9
>Expected=9.0, Predicted=-3.0
>Expected=-8.0, Predicted=-3.7
>Expected=-8.0, Predicted=-1.9
>Expected=7.0, Predicted=-0.5
>Expected=-11.0, Predicted=-1.7
>Expected=17.0, Predicted=-0.5
>Expected=-21.0, Predicted=-2.2

So is there a missing point, should i have applied some more preprocessing on the data ? or does the data not good for LSTM, i don't think there is other way for sequence to sequence regression ?

$\endgroup$
0
$\begingroup$

Basically i made a scatter plot for every two features before and after normalization, and didn't look like something that an algorithm would be able to generate a function for it. for instance, after normalization it basically looked like dense square. what algorithm would guess a dense square, it means that x has value for every value in y's range. Gentlemen, that violate basic mathematics.
Here are the graphs for your knowledge:


before scaling
enter image description here enter image description here enter image description here

after scaling
enter image description here enter image description here enter image description here

$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.