Icon

KN-301 Simple Demand Forecasting Neural Networks v05

[KNIME Nodes] KN-301 Simple Demand Forecasting Neural Networks
Keras Layers: The targetvariable "Todays Sales" isincluded in the input training datacollection "Sales History". Keras Layers: The targetvariable "Tomorrow Sales" isNOT included in the inputtraining data collection "SalesHistory". Results:Model = Keras LayersTarget = TodayMean Absolute Error = 0.143 DL Python Network: Samesimple Input-Hidden-Outputnetwork expressed with Pythoncode. DL Python Network: Againcompare tuning:[Target = Today] vs[Target = Tomorrow] Training: Epochs = 10Batch Size = 200Loss = Mean Absolute ErrorOptimizer = AdamShuffle = True Results:Model = Keras LayersTarget = TomorrowMean Absolute Error = 32.065 Results:Model = DL Python NetworkTarget = TodayMean Absolute Error = 0.784 Results:Model = DL Python NetworkTarget = TomorrowMean Absolute Error = 34.426 KNIME Nodes (KN-301) - Simple Demand Forecasting Neural NetworksCompares the Keras Layer Nodes against the DL Python nodes. Builds fourmodels which attempt to predict future sales. Two models predict "Today'sSales" (which are already known to the model). The other two models predict"Tomorrow's Sales" which correlate to the sales from the same-day-last-week.Viewing the node weights show how the models identify the most useful inputs. KNIME Installation Requirements:- KNIME Extension: KNIME Deep Learning - Keras Integration (Labs)- Python with Keras: https://www.knime.com/deeplearning#kerasData Source:Kaggle: Store Item Demand Forecasting Challengehttps://www.kaggle.com/c/demand-forecasting-kernels-only Analysis:These models are based upon the early 3-layer Neural Networks:(1) Input Layer(2) Hidden Layer(3) Output LayerThere are 7 input nodes which receive network weights, plus a bias term (8 tuningparameters in total). The output is the sum of these weighted inputs.Today's sales data is included in the last seven days of input data, whereastomorrows sales data is not. Models that are trying to predict today's sales shouldtune their weights so as to heavily depend upon today's input data. On the otherhand, models that are trying to predict tomorrow's sales should, instead, putgreater weight on sales from the same-day-last-week. That is, last Monday's salesare a good predictor of next Monday's sales.Example weights from these two models are as follow:#1 Weights (Target = Today):Sales(-6): -0.00002Sales(-5): 0.00010Sales(-4): 0.00001Sales(-3): 0.00002Sales(-2): -0.00001Sales(-1): 0.00002Sales(0): 1.00004 = Today#2 Weights (Target = Tomorrow):Sales(-6): 0.5753 = same-day-last-weekSales(-5): 0.0664Sales(-4): 0.0282Sales(-3): -0.0135Sales(-2): -0.0414Sales(-1): 0.0977Sales(0): 0.2997 = sales are increasing so Tomorrow also depends upon TodayIn the first case, the output 'Today' is almost exactly matched to the input 'Today' (asexpected).In the second case, the output 'Tomorrow' heavily (but not entirely) depends uponthe sales from same-day-last-week. Hence the tuning on both of these modelsseems correct. Hint: The option "View StandardOutput" is available from the [DLPython Network Executor] nodes.The weights can be viewed here.InputDataTrainingDataSalesHistoryInput Layer7 Days of SalesOutput Layer1 Day ForecastTune ModelTargetToday's SalesTop 40 ItemsBottom 10 ItemsTune ModelTargetTomorrow's SalesExecute ModelTargetToday's SalesExecute ModelGet WeightsToday's SalesKeras PythonModelTune ModelTargetToday's SalesGet ModelWeightsGet ModelWeightsExecute ModelTargetTomorrow's SalesTune ModelTargetTomorrow's SalesBottom 10 ItemsExecute ModelGet WeightsTomorrow's SalesCalculateErrorCalculateErrorMeanAbsoluteErrorMeanAbsoluteErrorMeanAbsoluteErrorCalculateErrorMeanAbsoluteErrorCalculateErrorFile Reader (#1) Column Filter (#2) Create CollectionColumn (#3) Keras InputLayer (#4) Keras DenseLayer (#5) Keras NetworkLearner (#6) Row Splitter (#7) Keras NetworkLearner (#8) Keras NetworkExecutor (#9) DL Python NetworkExecutor (#11) DL Python NetworkCreator (#12) DL Python NetworkLearner (#13) DL Python NetworkExecutor (#14) DL Python NetworkExecutor (#15) Keras NetworkExecutor (#18) DL Python NetworkLearner (#19) Column Filter (#20) DL Python NetworkExecutor (#21) Math Formula (#22) Math Formula (#23) GroupBy (#24) GroupBy (#25) GroupBy (#26) Math Formula (#27) GroupBy (#28) Math Formula (#29) Keras Layers: The targetvariable "Todays Sales" isincluded in the input training datacollection "Sales History". Keras Layers: The targetvariable "Tomorrow Sales" isNOT included in the inputtraining data collection "SalesHistory". Results:Model = Keras LayersTarget = TodayMean Absolute Error = 0.143 DL Python Network: Samesimple Input-Hidden-Outputnetwork expressed with Pythoncode. DL Python Network: Againcompare tuning:[Target = Today] vs[Target = Tomorrow] Training: Epochs = 10Batch Size = 200Loss = Mean Absolute ErrorOptimizer = AdamShuffle = True Results:Model = Keras LayersTarget = TomorrowMean Absolute Error = 32.065 Results:Model = DL Python NetworkTarget = TodayMean Absolute Error = 0.784 Results:Model = DL Python NetworkTarget = TomorrowMean Absolute Error = 34.426 KNIME Nodes (KN-301) - Simple Demand Forecasting Neural NetworksCompares the Keras Layer Nodes against the DL Python nodes. Builds fourmodels which attempt to predict future sales. Two models predict "Today'sSales" (which are already known to the model). The other two models predict"Tomorrow's Sales" which correlate to the sales from the same-day-last-week.Viewing the node weights show how the models identify the most useful inputs. KNIME Installation Requirements:- KNIME Extension: KNIME Deep Learning - Keras Integration (Labs)- Python with Keras: https://www.knime.com/deeplearning#kerasData Source:Kaggle: Store Item Demand Forecasting Challengehttps://www.kaggle.com/c/demand-forecasting-kernels-only Analysis:These models are based upon the early 3-layer Neural Networks:(1) Input Layer(2) Hidden Layer(3) Output LayerThere are 7 input nodes which receive network weights, plus a bias term (8 tuningparameters in total). The output is the sum of these weighted inputs.Today's sales data is included in the last seven days of input data, whereastomorrows sales data is not. Models that are trying to predict today's sales shouldtune their weights so as to heavily depend upon today's input data. On the otherhand, models that are trying to predict tomorrow's sales should, instead, putgreater weight on sales from the same-day-last-week. That is, last Monday's salesare a good predictor of next Monday's sales.Example weights from these two models are as follow:#1 Weights (Target = Today):Sales(-6): -0.00002Sales(-5): 0.00010Sales(-4): 0.00001Sales(-3): 0.00002Sales(-2): -0.00001Sales(-1): 0.00002Sales(0): 1.00004 = Today#2 Weights (Target = Tomorrow):Sales(-6): 0.5753 = same-day-last-weekSales(-5): 0.0664Sales(-4): 0.0282Sales(-3): -0.0135Sales(-2): -0.0414Sales(-1): 0.0977Sales(0): 0.2997 = sales are increasing so Tomorrow also depends upon TodayIn the first case, the output 'Today' is almost exactly matched to the input 'Today' (asexpected).In the second case, the output 'Tomorrow' heavily (but not entirely) depends uponthe sales from same-day-last-week. Hence the tuning on both of these modelsseems correct. Hint: The option "View StandardOutput" is available from the [DLPython Network Executor] nodes.The weights can be viewed here.InputDataTrainingDataSalesHistoryInput Layer7 Days of SalesOutput Layer1 Day ForecastTune ModelTargetToday's SalesTop 40 ItemsBottom 10 ItemsTune ModelTargetTomorrow's SalesExecute ModelTargetToday's SalesExecute ModelGet WeightsToday's SalesKeras PythonModelTune ModelTargetToday's SalesGet ModelWeightsGet ModelWeightsExecute ModelTargetTomorrow's SalesTune ModelTargetTomorrow's SalesBottom 10 ItemsExecute ModelGet WeightsTomorrow's SalesCalculateErrorCalculateErrorMeanAbsoluteErrorMeanAbsoluteErrorMeanAbsoluteErrorCalculateErrorMeanAbsoluteErrorCalculateErrorFile Reader (#1) Column Filter (#2) Create CollectionColumn (#3) Keras InputLayer (#4) Keras DenseLayer (#5) Keras NetworkLearner (#6) Row Splitter (#7) Keras NetworkLearner (#8) Keras NetworkExecutor (#9) DL Python NetworkExecutor (#11) DL Python NetworkCreator (#12) DL Python NetworkLearner (#13) DL Python NetworkExecutor (#14) DL Python NetworkExecutor (#15) Keras NetworkExecutor (#18) DL Python NetworkLearner (#19) Column Filter (#20) DL Python NetworkExecutor (#21) Math Formula (#22) Math Formula (#23) GroupBy (#24) GroupBy (#25) GroupBy (#26) Math Formula (#27) GroupBy (#28) Math Formula (#29)

Nodes

Extensions

Links