Normalize Date for MLP Node

Hi Guys,

I am a new user to Knime.

I am using the MLP node to predict a future value. I am using 10 years worth of data but the MLP node needs the date column of data to be normalized. Has anyone got any ideas on how to normalize date in Knime?

Hi @trijsdijk

Welcome to the KNIME community.

Although it sounds like you should approach this as a timeseries problem, you could change the date into a number of days compared to a fixed date (e.g. oldest date in your dataset). You could normalize this number of days like any other numerical feature.

3 Likes

Hi @trijsdijk and welcome to the KNIME community

As mentioned by @JanDuo, one way to achieve this is to convert your dates to the equivalent number of seconds with respect to a beginning date, and then to normalize these numbers using the Normalizing Node. This can be done using the following node for the date to number conversion:

as explained in the following thread:

followed by the Normalizer node:

Having said this, I’m curious to know why you need to normalize a date. What will you do with your normalized date ?

The problem with dates and normalization is that a date is a “drifting” information so with time, your new dates will be out of normalization. Will your dates always be within a known range of values so that normalization applied at “any time” will be always meaningful ? If not, other “solutions” rather than normalization should be applied or investigated depending on what you want eventually to achieve.

Hope this helps.

Best,

Ael

4 Likes

Hi,
would you like to point out why you want to use the date column at all?
I do not see a reason for this. Getting the weekday, Month number,… yes (there is a node to extract those things) but for the date I do not see any value to extract patterns from.
BR

Hi Daniel,

I am trying to forecast the future using 5 years of historic data. The most basic explanation would be date along the x-axis and sales on the y-axis, trying to forecast future sales.

1 Like

Thanks Ael, I have taken a look at the Normalizer node and it appears this will help greatly.

1 Like

Thanks Jan, the post below also mentions the normalizer node so i have rad up on it. It is jut what i was after.

Hi @trijsdijk

Looking at your response to Daniel I really think you are trying to solve a Timeseries problem with MLP. It might give the results you are looking for, but forecasting timeseries can make use of the special feature “time” which has a sequence in it unlike eany other feature.

Maybe you should have a look at some of the examples provided through the KNIME explorer too. You can find them under 04_Analytics > 07_Time_series

afbeelding

I personally like to use R with timeseries problems (check a great online book by Rob J Hyndham and George Athanasopoulos Forecasting: Principles and Practice (3rd ed)), which you can use within KNIME too. See detailed explanation on how to install R in KNIME on this forum topic
Install R alongside KNIME on Windows and MacOS

2 Likes

For Timeseries a LSTM or sth else would probably be a better Neural Net (if you need to use deep learning).
What I don’t get is what kind of pattern/information should the date itself have that you think is needed?
best regards

Thanks for the reply Daniel.

Do you have any more info on “sth else” I have not heard of this before and cant find any info on it.

In regards to your question on time, there are clear tends in the sales data that occur over time including:-

  1. A gradual decline in sale year on year
  2. Seasonal changes such as higher sales in winter each year.

I have lagged my data 90 days to try and predict 90 days into the future.

Thanks for your suggestion, i am new to Knime and this area in general.

Thanks Jan, i will take a look at the example workflows.

I will install R and test it out.

Sorry for the confusion,
with sth else I meant a different Neural Net structure or something like ARIMA model.
for a seasonal pattern I would rather extract something like the Month number and use this as feature but not the actual date.
br

Thanks Daniel, i will try out a few others. Month is a good variable to try.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.