WO2021077226A1 - Method and system for individual demand forecasting - Google Patents

Method and system for individual demand forecasting Download PDF

Info

Publication number
WO2021077226A1
WO2021077226A1 PCT/CA2020/051422 CA2020051422W WO2021077226A1 WO 2021077226 A1 WO2021077226 A1 WO 2021077226A1 CA 2020051422 W CA2020051422 W CA 2020051422W WO 2021077226 A1 WO2021077226 A1 WO 2021077226A1
Authority
WO
WIPO (PCT)
Prior art keywords
log
function
time
computer
historical
Prior art date
Application number
PCT/CA2020/051422
Other languages
French (fr)
Inventor
Brian Keng
Tianle CHEN
Original Assignee
Kinaxis Inc.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from US16/662,336 external-priority patent/US20210125073A1/en
Priority claimed from CA3059932A external-priority patent/CA3059932A1/en
Application filed by Kinaxis Inc. filed Critical Kinaxis Inc.
Publication of WO2021077226A1 publication Critical patent/WO2021077226A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0201Market modelling; Market analysis; Collecting market data
    • G06Q30/0202Market predictions or forecasting for commercial activities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0201Market modelling; Market analysis; Collecting market data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0635Risk analysis of enterprise or organisation activities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/06Energy or water supply

Definitions

  • the following relates generally to data processing, and more specifically, to a method and system for individual demand forecasting.
  • a computer-implemented method for individual forecasting of a future event for a subject using historical data the historical data comprising a plurality of historical events associated with the subject
  • the computer-implemented method executed on at least one processing unit, the computer-implemented method comprising: receiving the historical data associated with the subject; determining a random variable representing a remaining time until the future event; predicting a time to the future event using a distribution function that is determined using a recurrent neural network, the distribution function comprising a learned density with peaks that approximate the times of the historical events in the historical data; determining a log-likelihood function based on a probability that the random variable exceeds an amount of time remaining until a next historical event in the historical data and parameterized by the distribution function; and outputting a forecast of a time to the future event as the log-likelihood function.
  • a loss function for the recurrent neural network comprises a negative of the log-likelihood function.
  • the random variable is conditioned based on inter-arrival times of the historical events in the historical data.
  • the random variable is conditioned based on excess times since arrival of preceding historical events in the historical data.
  • the log-likelihood function at each time is the log of the probability that the random variable is in the set of time until the next historical event when the next historical event has been observed, and the log of the survival function otherwise.
  • the distribution function follows a Weibull distribution.
  • the distribution function is determined as where k is the shape of the Weibull distribution, A is the scale of the Weibull distribution, t is the time-step, and Sw(t) is the survival function.
  • outputting the forecast of the time to the future event as the log-likelihood function comprises determining a sum of log-likelihoods at each time-step.
  • the computer- implemented method further comprising transforming the sum of log-likelihoods as a function of recurrent neural network parameters and historical data, and determining a minimizer of an overall observed loss of the recurrent neural network using such function.
  • the computer- implemented method further comprising outputting derivative values of the log-likelihood function.
  • a system for individual forecasting of a future event for a subject using historical data comprising a plurality of historical events associated with the subject
  • the system comprising one or more processors in communication with a data storage, the one or more processors configurable to execute: a data acquisition module to receive the historical data associated with the subject; a conditional excess module to determine a random variable representing a remaining time until the future event; a machine learning module 120 to predict a time to the future event using a distribution function that is determined using a recurrent neural network, the distribution function comprising a learned density with peaks that approximate the times of the historical events in the historical data; and a forecasting module to determine a log- likelihood function based on a probability that the random variable exceeds an amount of time remaining until a next historical event in the historical data and parameterized by the distribution function, and to output a forecast of a time to the future event as the log- likelihood function.
  • a loss function for the recurrent neural network comprises a negative of the log-likelihood function.
  • the random variable is conditioned based on interarrival times of the historical events in the historical data.
  • the random variable is conditioned based on excess times since arrival of preceding historical events in the historical data.
  • the log-likelihood function at each time is the log of the probability that the random variable is in the set of time until the next historical event when the next historical event has been observed, and the log of the survival function otherwise.
  • the distribution function follows a Weibull distribution.
  • the distribution function is determined as where k is the shape of the Weibull distribution, A is the scale of the Weibull distribution, t is the time-step, and S w (t) is the survival function.
  • outputting the forecast of the time to the future event as the log-likelihood function comprises determining a sum of log-likelihoods at each time-step.
  • the forecasting module further transforms the sum of log-likelihoods as a function of recurrent neural network parameters and historical data, and determining a minimizer of an overall observed loss of the recurrent neural network using such function.
  • the forecasting module further outputs derivative values of the log-likelihood function.
  • a non-transitory computer-readable storage medium including instructions that when executed by a computer, cause the computer to: receive the historical data associated with the subject; determine a random variable representing a remaining time until the future event; predict a time to the future event using a distribution function that is determined using a recurrent neural network, the distribution function comprising a learned density with peaks that approximate the times of the historical events in the historical data; determine a log- likelihood function based on a probability that the random variable exceeds an amount of time remaining until a next historical event in the historical data and parameterized by the distribution function; and output a forecast of a time to the future event as the log-likelihood function.
  • a loss function for the recurrent neural network comprises a negative of the log-likelihood function.
  • the random variable is conditioned based on inter-arrival times of the historical events in the historical data.
  • the random variable is conditioned based on excess times since arrival of preceding historical events in the historical data.
  • the log- likelihood function at each time is the log of the probability that the random variable is in the set of time until the next historical event when the next historical event has been observed, and the log of the survival function otherwise.
  • the distribution function follows a Weibull distribution.
  • the distribution function is determined as where k is the shape of the Weibull distribution, A is the scale of the Weibull distribution, t is the time-step, and Sw(t) is the survival function.
  • outputting the forecast of the time to the future event as the log-likelihood function comprises determining a sum of log-likelihoods at each time-step.
  • the instructions further configure the computer to transform the sum of log-likelihoods as a function of recurrent neural network parameters and historical data, and determine a minimizer of an overall observed loss of the recurrent neural network using such function.
  • the instructions further configure the computer to output derivative values of the log-likelihood function.
  • FIG. 1 is a schematic diagram of a system for individual forecasting of a future event for a subject using historical data, in accordance with an embodiment
  • FIG. 2 is a flowchart of a method for individual forecasting of a future event for a subject using historical data, in accordance with an embodiment
  • FIG. 3 is a plot of an example of time-since-event (tse(t)) and time-to-event (tte(t)) until an end of a training period, in accordance with the system of FIG. 1 ;
  • FIG. 4A is an example of a distributional estimate for an uncensored case with time equals 3, in accordance with the system of FIG. 1 ;
  • FIG. 4B is an example of a distributional estimate for a censored case with time equals 7, in accordance with the system of FIG. 1 ;
  • FIG. 5 is a diagram of an example recurrent neural network (RNN) computational flow, in accordance with the system of FIG. 1 ;
  • RNN recurrent neural network
  • FIG. 6 is a diagram of an example Bayesian Network, in accordance with the system of FIG. 1 ;
  • FIG. 7 is a chart of a receiver operating characteristic (ROC) curve for example experiments of the system of FIG. 1 ;
  • FIG. 8A illustrates a chart of predicted densities for remaining useful life (RUL) for the example experiments of FIG. 7;
  • FIG. 8B illustrates a chart of predicted modes for RUL for the example experiments of FIG. 7;
  • FIG. 9A illustrates a histogram of errors for a comparison approach in the example experiments of FIG. 7;
  • FIG. 9B illustrates a histogram of errors for the system of FIG. 1 in the example experiments of FIG. 7.
  • Any module, unit, component, server, computer, terminal, engine or device exemplified herein that executes instructions may include or otherwise have access to computer readable media such as storage media, computer storage media, or data storage devices (removable and/or non-removable) such as, for example, magnetic disks, optical disks, or tape.
  • Computer storage media may include volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information, such as computer readable instructions, data structures, program modules, or other data.
  • Examples of computer storage media include RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by an application, module, or both. Any such computer storage media may be part of the device or accessible or connectable thereto.
  • any processor or controller set out herein may be implemented as a singular processor or as a plurality of processors. The plurality of processors may be arrayed or distributed, and any processing function referred to herein may be carried out by one or by a plurality of processors, even though a single processor may be exemplified. Any method, application or module herein described may be implemented using computer readable/executable instructions that may be stored or otherwise held by such computer readable media and executed by the one or more processors.
  • the following relates generally to data processing, and more specifically, to a method and system for individual demand forecasting.
  • the embodiments described herein can be used for any suitable application of individual event forecasting.
  • the embodiments described herein could be used to predict the time until a future occurrence of a natural event; such as an earthquake as the subject to be forecasted.
  • the embodiments described herein could be used to predict the time until a utility spike occurs; such as a spike in electricity consumption or a spike in internet bandwidth as the subjects.
  • the embodiments described herein could be used to predict component failure times for factory machinery; such as using workload history as input.
  • the embodiments described herein could be used to predict various other consumer behavior patterns; such as predicting when a client will go on vacation.
  • retailers can have access to massive amounts of consumer behavior data through, for example, customer loyalty programs, purchase histories, and responses to direct marketing campaigns. These data sources can allow retailers to customize their marketing communications at the individual level through personalized content, promotions, and recommendations via channels such as email, mobile and direct mail. Accurately predicting every individual customer behavior for each product is useful in direct marketing efforts which can lead to significant advantages for a retailer driving increased sales, margin, and return on investment. Especially for replenishable products such as regularly consumed food products (e.g. milk) and regularly replenished personal care products (e.g. soap). These products frequently drive store traffic, basket size, and customer loyalty, which are of strategic importance in a highly competitive retail environment.
  • regularly consumed food products e.g. milk
  • personal care products e.g. soap
  • Purchase histories for any single product is generally sparse. For any single product in this basket, the average customer buys only between 0.12 to 0.67 items over a 1.5-year period but aggregating over all the products in the basket indicates that these customers purchase on average 3.58 items during the same period. This is not surprising since people tend to prefer variety in their meals even though their choice of whether to purchase a deli product can in some cases be predicted.
  • Some approaches for accurately forecasting individual demand for single products adapt methods from survival analysis, where a customer is defined to be “alive” if purchases were made. In a scenario with sparse purchase data, this can be useful since non- purchases can reveal information about whether a customer is likely to make a purchase in the future. In addition to modeling whether customers are “alive”, the number of purchases a customer makes in a given time period can also be accounted for. Solving this maximum likelihood problem can yield optimal distributional estimates that model such behaviors. However, these models impose strict assumptions that limit their effectiveness; such as independence and stationarity. In addition, covariates are often modeled in a regression context, further restricting the hypothesis space.
  • a survival model is a Pareto/NBD model.
  • heterogeneity of customer purchase rates and customer dropout times are assumed to follow parametric distributions. While this may be suited for predicting a time-to-event, incorporating covariates in this context generally requires imposing a linearity assumption on one of the model parameters in order to fit a model; which is an unrealistic assumption for models with a large number of data features. While copulas may be used to model customer repurchase patterns, they cannot be sufficiently extended to predict multiple products jointly and under changing environmental conditions.
  • RNNs Recurrent Neural Networks
  • RNNs Recurrent Neural Networks
  • Random Forest models and other ensemble models have been used with binary predictions due to their scalability to wide datasets, ease of training and regularization strategies.
  • tree-based supervised learning models are not well suited to sequentially dependent problems.
  • Recurrent Neural Nets (RNN) are better suited to model data with complex sequential dependencies.
  • LSTM Long-Short-Term-Memory
  • LSTM Long-Short-Term-Memory
  • LSTM can be trained to make point estimates for time-to-event by minimizing a distance-based metric.
  • unobserved arrival times cannot be explicitly accounted for in these models. Non-arrivals can be important as they can reveal a significant amount of information for the prediction.
  • Embodiments of the present disclosure advantageously integrate probabilistic approaches of survival analysis with Recurrent Neural Networks to model inter-purchase times for multiple products jointly for each individual customer.
  • the output of the RNN models the distribution parameters of a “time to next purchase” random variable instead of a point estimate.
  • partial information such as time since the previous arrival, can induce a distribution on the partially observed version of the “time to next purchase” random variable.
  • the structure of such embodiments can impose additional constraints which transform the complex censoring problem into a likelihood-maximization problem.
  • the use of RNNs can remove the need for strict assumptions of past survival analysis models while still having the flexibility to take into account the censored and sequential nature of the problem.
  • such Multivariate Arrival Times Recurrent Neural Network models may be referred to as “MAT- RNN”.
  • the present inventors determined the efficacy of the present embodiments in example experiments.
  • the example experiments were performed on data from a large European health and beauty retailer, several benchmark datasets as well as a synthetic dataset.
  • the present embodiments were determined to out-perform other approaches in predicting whether a customer made purchases in the next time period.
  • the results of the example experiments illustrate that the present embodiments perform better than other approaches in 4 out of the 5 categories of products considered. Additionally, results on the benchmark and synthetic datasets show comparable performance increases when compared to other survival model techniques and RNNs trained on the usual squared-loss metric.
  • FIG. 1 a system 100 for individual forecasting of a future event for a subject, in accordance with an embodiment, is shown.
  • the system 100 is run on a server.
  • the system 100 can be run on any other computing device; for example, a desktop computer, a laptop computer, a smartphone, a tablet computer, a point-of-sale (“PoS”) device, a smartwatch, or the like.
  • a desktop computer for example, a desktop computer, a laptop computer, a smartphone, a tablet computer, a point-of-sale (“PoS”) device, a smartwatch, or the like.
  • PoS point-of-sale
  • the components of the system 100 are stored by and executed on a single computer system. In other embodiments, the components of the system 100 are distributed among two or more computer systems that may be locally or globally distributed.
  • FIG. 1 shows various physical and logical components of an embodiment of the system 100.
  • the system 100 has a number of physical and logical components, including a central processing unit (“CPU”) 102 (comprising one or more processors), random access memory (“RAM”) 104, an input interface 106, an output interface 108, a network interface 110, non-volatile storage 112, and a local bus 114 enabling CPU 102 to communicate with the other components.
  • CPU 102 executes an operating system, and various modules, as described below in greater detail.
  • RAM 104 provides relatively responsive volatile storage to CPU 102.
  • the input interface106 enables an administrator or user to provide input via an input device, for example a keyboard and mouse.
  • the output interface 108 outputs information to output devices, such as a display and/or speakers.
  • the network interface 110 permits communication with other systems, such as other computing devices and servers remotely located from the system 100, such as for a typical cloud-based access model.
  • Non-volatile storage 112 stores the operating system and programs, including computer-executable instructions for implementing the operating system and modules, as well as any data used by these services. Additional stored data, as described below, can be stored in a database 116. During operation of the system 100, the operating system, the modules, and the related data may be retrieved from the non-volatile storage 112 and placed in RAM 104 to facilitate execution.
  • the system 100 further includes a data acquisition module 117, a conditional excess module 118, a machine learning module 120, and a forecasting module 122.
  • the modules 117, 118, 120, 122 can be executed on the CPU 110.
  • some of the functions of the modules 117, 118, 120, 122 can be executed on a server, on cloud computing resources, or other devices.
  • some or all of the functions of any of the modules 117, 118, 120, 122 can be run on other modules.
  • Forecasting is the process of obtaining a future value for a subject using historical data.
  • Machine learning techniques as described herein, can use the historical data in order to train their models and thus produce reasonably accurate forecasts when queried.
  • the machine learning module 120 uses a Recurrent Neural Net (RNN) to output distributional parameters which represent predictions for the remaining time to arrival.
  • RNN Recurrent Neural Net
  • the RNN can output sequential distributional estimates for the remaining time until the next purchase arrival, giving an individual demand forecast.
  • the output as a distribution can allow for better decision-making ability because it can allow for the performance of a cost analysis.
  • each product's inter-purchase time can be assumed to be a realization of a random variable that is distinct for each customer and each product.
  • each product’s inter-purchase time can also be dependent on other product purchase times.
  • the conditional excess module 118 can use a conditional excess random variable, which represents a remaining time till next arrival conditioned on observed information to date. This random variable can have a distribution that is induced by an actual interpurchase time as well as a censoring state.
  • the forecasting module 122 can determine a log-likelihood function based on the conditional excess random variable and the outputs of the RNN. In some cases, it is assumed that the approach of these embodiments follows a conditional independence structure where these conditional excess random variables are assumed to be independent given the internal state of the RNN. In such embodiments, the loss function can be defined to be the negative log-likelihood.
  • the optimal RNN parameters in such embodiments can generate distributional parameters that can be advantageously used to model the observed data. Hence, the RNN outputs at the end of training period can be used by the forecasting module 122 as best distributional estimates for a remaining time to next purchase.
  • a random variable representing the remaining time till next arrival conditioned on the current information is denoted as Z t .
  • this random variable is not the true inter-arrival time, but is instead a version of it, conditioned on observing partial information.
  • N (t) max ⁇ n ⁇ W n ⁇ t ⁇ (1)
  • the number of arrivals observed is N(t).
  • the system 100 predicts the subsequent (i.e. the ⁇ N(t) + 1 ⁇ -th arrival) and its inter-arrival time Y N(t)+1 ⁇
  • tse(t) time-since-event
  • tte(t) time-to-event
  • T time-to-event
  • N(t) is a piecewise constant function which is 0 for t ⁇ 16, 1 for t ⁇ [16, 28), 2 for t ⁇ [28, 32), and 3 for t ⁇ 32.
  • the remaining time till next arrival can be a conditional random variable that depends only on Y N(t)+1 , which is the inter-arrival time of the subsequent arrival.
  • the random variable Z t given the observed information, can thus be defined; which is referred to as a conditional excess random variable.
  • Z t has a distribution induced by Y N(t)+1 since tse(t) is fixed.
  • Z t Y N(t)+1 - tse(t) I Y N(t)+1 > tse(t).
  • the log-likelihood function there are two cases to define the log-likelihood function.
  • the likelihood evaluation is P (Z t ⁇ [tte(t), tte(t) + 1]), since inter-arrival times are only discretely observed.
  • the likelihood evaluation is instead P (Z t > tte(t)), namely the survival function. Therefore, at each time t, the random variable Y N(t)+1 which has distribution parametrized by ⁇ t , induces a distribution on Z t .
  • the log-likelihood at each time t can be written as follows:
  • FIGS. 4A and 4B illustrate log-likelihood visualizations for different censoring statuses.
  • f3 is a density function of Z 3 , which is the predictive distribution for the remaining time till next arrival. Since the next arrival is observed to have occurred at time 6, f3 is evaluated at the value 3, which is the true time to next arrival to compute the log-likelihood.
  • the next arrival was not observed and hence the right tail of Z 7 (i.e. > 3) was used to compute the log- likelihood.
  • Y n follows distributions with differentiable density and survival functions to exploit the back-propagation approach used to fit the RNN.
  • An example is a Weibull distribution parametrized by scale ( ⁇ ) and shape ( k ), whose survival function is made up of exp() and power() functions.
  • conditional probability in terms of some continuous random variable X 1 , X 2 for any measurable set A 1 , A 2 , given P ( X 2 ⁇ A 2 ) > 0:
  • a Long Short Term Memory (LSTM) model can be used by the machine learning module 120 as a type of RNN structure for modeling sequential data.
  • other types of RNN models can be used by the machine learning module 120.
  • the outputs of the LSTM which is parametrized by ⁇ , are passed through an activation function so that they are valid parameters of a distribution function ( ⁇ t ).
  • the log-likelihood is determined for each time step ( l t ) by the forecasting module 122, as described herein.
  • FIG. 5 illustrates an example RNN computational flow with outputs ( ⁇ t ) generated by the LSTM.
  • Log-likelihoods at each time are determined as log of densities parametrized by ⁇ t , evaluated at zt. Where h t is the internal state of the LSTM and X t are the covariates at each time t. In this way, the machine learning module 120 can output a single prediction of expected value for each time (t).
  • the machine learning module 120 can determine loss as a negative of the log-likelihood.
  • Optimal parameters for the LSTM ( ⁇ ) can be determined as outputs of a series of distributional estimates ⁇ t that best “explain” the sequence of data observed.
  • the distribution can be a normal distribution.
  • the weights ⁇ t can be determined as those that generate a density that has a peak close to the actual arrival time. In this way, at each time step, a range of values and their relatively likelihood are provided; with the output denoted by 6 t .
  • additional operations can be performed.
  • the machine learning module 120 can assume a Bayesian Network, for example similar to a Hidden-Markov model, where random variables at each time t are emitted from a hidden state h t . As described, h t represents an internal state of the RNN at each time t and Z t is an observed time series.
  • FIG. 6 illustrates an example of a Bayesian Network where observations are independent conditioned on hidden states.
  • the machine learning module 120 can transform the outputs of the RNN such that they are parameters of a distribution.
  • the machine learning module 120 can use a Weibull distribution, which is parametrized by shape and scale parameters, both of which are positive values.
  • the RNN output can be initialized for scale at the maximum-likelihood estimate (MLE) for a scale parameter of a Weibull distribution whose shape parameter is 1 ; as this was determined by the present inventors to be useful in preventing likelihood-evaluation errors.
  • MLE maximum-likelihood estimate
  • an exponential function is used, which is rescaled such that it maps 0 to the average inter-arrival-time.
  • the system 100 can model multivariate arrivals by assuming there are p different arrival processes of interest. For the i-th waiting time of interest, W i,n is defined to be the time of the n-th arrival of this type and N i (t), and Y i,n is likewise defined. Additionally, tse(i, t) and tte(i, t) are defined for the i-th type.
  • the Bayesian Network of FIG. 6 generally requires minimal modifications as it merely requires that the emissions are conditionally independent given h t .
  • K j,t is some other variable of interest for process j at time t.
  • K j,t can be other factors affecting the customer; for example, a promotion.
  • K j,t can be other variables that affect output; for example, ambient temperature
  • each time step can have a component in the loss function (for each output) and masking can be used to remove those time steps from the loss function so that they are not used in the optimization. This can ensure that RNN parameters are not updated due to losses incurred during these times.
  • the forecasting module 122 can determine predictions using the fact that at each time t, the estimated parameter ⁇ t can be used to determine the expectation of any function of Z t , assuming that Z t is distributed according to ⁇ t . Since the system 100 takes into account the next arrival time after the end of training period (time T), it can compute many different values of interest. As described herein, the values of interest can be derivative values of the output distribution; for example, expected value, median, 90% credible range, some other cost function (using a different under/overweighting of forecasts), and the like.
  • the forecasting module 122 can determine a predicted probability that the next arrival will occur within ⁇ time after end of training, and thus determine P ( Z T ⁇ ⁇ ).
  • the forecasting module 122 can also determine a deferred arrival probability, which is the probability that the next arrival will occur within an interval of between ⁇ 1 and ⁇ 1 + ⁇ 2 time after end of training; given that the forecasting module 122 knows it will not occur within ⁇ 1 time after the end of training. This can be determined by computing P ( Z T ⁇ [ ⁇ 1, ⁇ 1 + ⁇ 2] ⁇ Z T > ⁇ 1).
  • the quantities of interest may not necessarily be limited to probabilities (for example, mean and quantiles of the predictive distribution) and can be extended to generate other analytics; for example, in the case of predicting product purchases, to aid in revenue analysis or forecasting that depends on the subsequent purchase time.
  • FIG. 2 a flowchart for a method 200 for individual forecasting of a future event for a subject, according to an embodiment, is shown.
  • the forecast is based on historical data, for example, as stored in the database 116 or as otherwise received.
  • the historical data comprising a plurality of historical events associated with the subject.
  • the data acquisition module 117 receives the historical data associated with the subject from the input interface 106, the network interface 110, or the non-volatile storage 112.
  • the conditional excess module 118 determines a random variable representing a remaining time until the future event. The random variable conditioned based on excess times since arrival of the historical events in the historical data.
  • the machine learning module 120 determines a distribution function that predicts the time of the future event using a recurrent neural network.
  • the distribution function comprising a learned density with peaks that approximate the times of the historical events in the historical data.
  • the forecasting module 122 determines a log-likelihood function based on a probability that the random variable exceeds an amount of time remaining until a next historical event in the historical data and parameterized by the distribution function.
  • a loss function for the recurrent neural network comprising a negative of the log-likelihood function.
  • the forecasting module 122 forecasts and outputs a time to the future event for a given subject using the log-likelihood function.
  • Example experiments were conducted to check model assumptions and verify that parameters for Weibull inter-arrival times can be recovered by the present embodiments (using MAT-RNN) on a synthetic dataset.
  • example experiments were performed to compare the performance of MAT-RNN on two open datasets to benchmark models.
  • example experiments were conducted to apply MAT-RNN to predict customer purchases for a large retailer and compare its performance to other approaches in the art.
  • a structure used for the RNN had three stacked layers, with two LSTM layers of size W followed by a densely connected layer of size 2p, where p is the number of arrival processes.
  • the densely connected layer transforms the LSTM outputs to a vector of length 2p.
  • the densely connected layer outputs are passed through an activation layer.
  • the activation can be passed through a softplus layer since time to arrivals are non-negative.
  • a masking layer was applied prior to the other layers so that the RNN does not train on time indices prior to the initialization of the time series.
  • This structure is the same for other neural network based models used for benchmark comparison.
  • the RNN was trained with a learning rate of 0.001 and trained for 100 steps unless otherwise stated. Gradients were component-wise clipped at 5 to prevent numerical issues.
  • the example experiments used a generated synthetic dataset, where inter-arrival times followed Weibull distributions.
  • TABLE 1 a set of Weibull parameters was generated for each of eight product types, from which inter-arrival times are sampled.
  • the individual product identification is referred to as SKU (stock keeping unit).
  • the first example dataset is the CDNOW dataset.
  • the example experiments considered a binary classification problem where the system 100 predicts if purchases are made during a testing period. Predictions by the system 100 were determined as the probability that the inter-arrival time occurs before end of testing period.
  • the input data was the transaction history where only purchase records are available without other covariate data. The example experiments show that present embodiments out-perform other approaches on this dataset, even with no covariates.
  • the second example dataset is based on the CMAPSS dataset.
  • the system 100 predicted the remaining useful lifetime, or the time to failure. Predictions were determined as the mode, mean, or some other function of the inter-arrival time distribution.
  • the training data was an uncensored time series where sensor readings and operational settings were collected up until the engine fails. A customized loss function was used to evaluate models.
  • the CDNOW dataset includes purchase transactions, where number of customer purchases are recorded. Transaction dates, purchase counts, and transaction values were available as covariates.
  • W 1 trained on a weekly level
  • the performance of the present embodiments, where W 1 trained on a weekly level, was compared to another approach, the Pareto/NBD model, which is a classical demand forecasting model using the lifetimes package.
  • the CDNOW dataset is often used as an example where Pareto/NBD type models do well since there's limited covariate data available and there is only a single event type.
  • the CMAPSS dataset is a high dimensional dataset on engine performance with 26 sensor measurements and operational settings.
  • the engines were run until failure.
  • data was recorded until a time prior to failure. The goal was to predict the remaining useful life (RUL) for these engines.
  • RUL remaining useful life
  • Time series for each engine was segmented into sliding windows of window length 78, resulting in 323 windowed time series each of length 78.
  • the RNN model was run on a time series 78 cycles before end of observation.
  • MCL mean custom loss metric
  • FIGS. 8A and 8B illustrate the performance of MAT-RNN was substantial, with modes that correspond roughly to the true RUL.
  • FIG. 8A illustrates a chart of predicted densities for RUL on C-MAPSS and True RUL.
  • FIG. 8B illustrates a chart of predicted modes for RUL on C-MAPSS and True RUL.
  • FIG. 9A illustrates a histogram of errors for SQ-LOSS
  • FIG. 9B illustrates a histogram of errors for MAT- RNN.
  • the present inventors determined the predictive performance on a real-life application for predicting purchases of a few baskets of goods sold by a large European retailer. The time resolution of the dataset was on a weekly level. Training data was available over roughly 1.5 years, which gave 78 weeks of training data from 2014 01-01 to 2015 06 30 Performance of the MAT-RNN model of the present embodiments was measured on a binary classification problem of predicting whether a customer purchases the product within 4 weeks after the end of training period from 2015 06-30 to 2015 07 31
  • the MAT-RNN model of the present embodiments can be used to predict various different quantities of interest; however, for the purposes of the example experiments, comparison was of the predictive performance of the MAT-RNN model to a few benchmark models. Such comparison was with respect to whether an event will arrive within y time after the end of the training period.
  • the benchmark models were a Squared-Loss RNN (SQ-RNN) and a Random Forest Predictor (RNG-F). Models were trained on all customers who bought an item in the basket during the training period and performance was evaluated on this group of customers during the testing period.
  • RNG-F was trained by splitting the training period into two periods. Covariates at the end of the first period were fed into the model, which was trained to predict whether subjects purchase in the second period, which was also y long. A different RNG-F model was trained for each product, but was fed covariate datasets for all products.
  • SQ-LOSS was trained by setting the loss function as the squared difference between the predicted time-to-arrival and the actual time-to-arrival. An activation function of softplus was applied. Predictions of SQ-LOSS were then compared to the testing period length of y.
  • Recency, Frequency and Monetary (RFM) metrics were determined, which are commonly used in demand modeling, at 3 different levels; namely for all products, in-basket products and each individual product.
  • Recency is the time since last purchase
  • Frequency is the number of repeat purchases
  • Monetary is the amount of money spent on all purchases to date. Included in the covariates are time-since-event (tse(t)) and indicators for whether a first purchase has occurred (pch(t)).
  • the time-to-event (tse(t)) and the censoring status of the next arrival (unc(t)) were also determined.
  • pads had the highest proportion of trial customers along with the smallest proportion of customers who bought another item in the basket.
  • ⁇ per-sku was roughly median in the baskets considered. This is similar for floss as well. For these categories, it would be reasonable to expect product purchases are strongly dependent.
  • a good joint-prediction model should separate trial purchasers from repeat purchasers who decided to stick to one product after trying another.
  • Performance was measured based on the ROC-AUC metric where each of the models predicted whether customers who made in-basket purchases would make another in-basket purchase in a 4 week period after the end of a training period of 78 weeks.
  • the RNG-F model was trained with 100 trees with covariates at week 74 and purchases between week 74 and 78 but predicts purchases for only one product at a time. As such, a separate RNG-F model is trained for each product.
  • the example experiments determined how each model does for every product in the basket, and as such, there are multiple ROC-AUC metrics.
  • TABLE 4 shows the results of the example experiments in terms of summary statistics for ROC- AUCs for each item in the basket. The results illustrate that the MAT-RNN model of the present embodiments almost always dominates in the ROC-AUC metric for every category other than bars and deli, which has the smallest number of customers. Even so, MAT-RNN still performs the best in terms of average ROC-AUC among products in each category other than bars.
  • the performance difference of the MAT-RNN model of the present embodiments over SQ-LOSS and RNG-F is greatest for the pads category. This is likely due to the large amount of missing data since customers are least likely to buy other products. It was also determined that SQ-LOSS performs poorly compared to MAT-RNN, even though these models have a similar recurrent structure and are fed the same sequential data.
  • One possible explanation is that the lack of ground truth data has a significant impact on the ability of SQ-LOSS to learn. In cases where event arrivals are sparse or where inter- purchase periods are long, the censored nature of the data gives no ground truth to train SQ-LOSS on.
  • joint predictions enjoy some advantages over individual predictions as product purchases can be modeled better through joint modeling.
  • the amount of time required to train a separate model for each product scales linearly with the number of products.
  • the number of parameters in a collection of individual models is also significantly larger than that of a joint model.
  • the present embodiments can use a survival analysis approach with recurrent neural nets (RNN) to forecast joint arrival times until a next event for each individual over multiple items.
  • RNN recurrent neural nets
  • the present inventors advantageously recognized the technical advantages of transforming an arrival time problem into a likelihood-maximization problem with loose distributional assumptions regarding inter-arrival times.
  • the example experiments demonstrated that not only can known parameters be recovered during fitting, but also that there are substantial improvements over other approaches.

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Development Economics (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • General Physics & Mathematics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Data Mining & Analysis (AREA)
  • Economics (AREA)
  • General Business, Economics & Management (AREA)
  • Marketing (AREA)
  • Game Theory and Decision Science (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Computational Linguistics (AREA)
  • Biophysics (AREA)
  • Mathematical Physics (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Resources & Organizations (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Computing Systems (AREA)
  • Tourism & Hospitality (AREA)
  • Quality & Reliability (AREA)
  • Operations Research (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

Provided is a system and method for individual forecasting of a future event for a subject using historical data. The historical data including a plurality of historical events associated with the subject. The computer-implemented method including: receiving the historical data associated with the subject; determining a random variable representing a remaining time until the future event; predicting a time to the future event using a distribution function that is determined using a recurrent neural network, the distribution function including a learned density with peaks that approximate the times of the historical events in the historical data; determining a log-likelihood function based on a probability that the random variable exceeds an amount of time remaining until a next historical event in the historical data and parameterized by the distribution function; and outputting a forecast of a time to the future event as the log-likelihood function.

Description

METHOD AND SYSTEM FOR INDIVIDUAL DEMAND FORECASTING
TECHNICAL FIELD
[0001] The following relates generally to data processing, and more specifically, to a method and system for individual demand forecasting.
BACKGROUND
[0002] Accurately forecasting individual demand for acquisition of single items is a complex technical problem with many facets. It necessitates predicting not only the next most likely time of acquisition, but also having an accompanying measure of uncertainty is desirable due there likely being inherent randomness of in the acquisition, especially if it is based on an individual's behavior. Such forecasts often also coincide with sparse observations and partial information. Generally, sequential dependence is considered because future demand patterns can be heavily influenced by past behavior. Additionally, there may be strong correlation between demand patterns across substitutable acquisitions, generally requiring that acquisition behavior should be jointly predicted.
SUMMARY
[0003] In an aspect, there is provided a computer-implemented method for individual forecasting of a future event for a subject using historical data, the historical data comprising a plurality of historical events associated with the subject, the computer-implemented method executed on at least one processing unit, the computer-implemented method comprising: receiving the historical data associated with the subject; determining a random variable representing a remaining time until the future event; predicting a time to the future event using a distribution function that is determined using a recurrent neural network, the distribution function comprising a learned density with peaks that approximate the times of the historical events in the historical data; determining a log-likelihood function based on a probability that the random variable exceeds an amount of time remaining until a next historical event in the historical data and parameterized by the distribution function; and outputting a forecast of a time to the future event as the log-likelihood function.
[0004] In a particular case of the computer-implemented method, a loss function for the recurrent neural network comprises a negative of the log-likelihood function.
[0005] In another case of the computer-implemented method, the random variable is conditioned based on inter-arrival times of the historical events in the historical data. [0006] In yet another case of the computer-implemented method, the random variable is conditioned based on excess times since arrival of preceding historical events in the historical data.
[0007] In yet another case of the computer-implemented method, the log-likelihood function at each time is the log of the probability that the random variable is in the set of time until the next historical event when the next historical event has been observed, and the log of the survival function otherwise.
[0008] In yet another case of the computer-implemented method, the distribution function follows a Weibull distribution.
[0009] In yet another case of the computer-implemented method, the distribution function is determined as
Figure imgf000004_0001
where k is the shape of the Weibull distribution, A is the scale of the Weibull distribution, t is the time-step, and Sw(t) is the survival function.
[0010] In yet another case of the computer-implemented method, outputting the forecast of the time to the future event as the log-likelihood function comprises determining a sum of log-likelihoods at each time-step.
[0011] In yet another case of the computer-implemented method, the computer- implemented method further comprising transforming the sum of log-likelihoods as a function of recurrent neural network parameters and historical data, and determining a minimizer of an overall observed loss of the recurrent neural network using such function.
[0012] In yet another case of the computer-implemented method, the computer- implemented method further comprising outputting derivative values of the log-likelihood function.
[0013] In another aspect, there is provided a system for individual forecasting of a future event for a subject using historical data, the historical data comprising a plurality of historical events associated with the subject, the system comprising one or more processors in communication with a data storage, the one or more processors configurable to execute: a data acquisition module to receive the historical data associated with the subject; a conditional excess module to determine a random variable representing a remaining time until the future event; a machine learning module 120 to predict a time to the future event using a distribution function that is determined using a recurrent neural network, the distribution function comprising a learned density with peaks that approximate the times of the historical events in the historical data; and a forecasting module to determine a log- likelihood function based on a probability that the random variable exceeds an amount of time remaining until a next historical event in the historical data and parameterized by the distribution function, and to output a forecast of a time to the future event as the log- likelihood function.
[0014] In a particular case of the system, a loss function for the recurrent neural network comprises a negative of the log-likelihood function.
[0015] In another case of the system, the random variable is conditioned based on interarrival times of the historical events in the historical data.
[0016] In yet another case of the system, the random variable is conditioned based on excess times since arrival of preceding historical events in the historical data.
[0017] In yet another case of the system, the log-likelihood function at each time is the log of the probability that the random variable is in the set of time until the next historical event when the next historical event has been observed, and the log of the survival function otherwise.
[0018] In yet another case of the system, the distribution function follows a Weibull distribution.
[0019] In yet another case of the system, the distribution function is determined as where k is the shape of the Weibull distribution, A is the scale of the
Figure imgf000005_0001
Weibull distribution, t is the time-step, and Sw(t) is the survival function.
[0020] In yet another case of the system, outputting the forecast of the time to the future event as the log-likelihood function comprises determining a sum of log-likelihoods at each time-step.
[0021] In yet another case of the system, the forecasting module further transforms the sum of log-likelihoods as a function of recurrent neural network parameters and historical data, and determining a minimizer of an overall observed loss of the recurrent neural network using such function.
[0022] In yet another case of the system, the forecasting module further outputs derivative values of the log-likelihood function.
[0023] In yet another aspect, there is provided a non-transitory computer-readable storage medium, the computer-readable storage medium including instructions that when executed by a computer, cause the computer to: receive the historical data associated with the subject; determine a random variable representing a remaining time until the future event; predict a time to the future event using a distribution function that is determined using a recurrent neural network, the distribution function comprising a learned density with peaks that approximate the times of the historical events in the historical data; determine a log- likelihood function based on a probability that the random variable exceeds an amount of time remaining until a next historical event in the historical data and parameterized by the distribution function; and output a forecast of a time to the future event as the log-likelihood function.
[0024] In a particular case of the non-transitory computer-readable storage medium, a loss function for the recurrent neural network comprises a negative of the log-likelihood function.
[0025] In another case of the non-transitory computer-readable storage medium, the random variable is conditioned based on inter-arrival times of the historical events in the historical data.
[0026] In yet another case of the non-transitory computer-readable storage medium, the random variable is conditioned based on excess times since arrival of preceding historical events in the historical data.
[0027] In yet another case of the non-transitory computer-readable storage medium, the log- likelihood function at each time is the log of the probability that the random variable is in the set of time until the next historical event when the next historical event has been observed, and the log of the survival function otherwise.
[0028] In yet another case of the non-transitory computer-readable storage medium, the distribution function follows a Weibull distribution.
[0029] In yet another case of the non-transitory computer-readable storage medium, the distribution function is determined as
Figure imgf000006_0001
where k is the shape of the Weibull distribution, A is the scale of the Weibull distribution, t is the time-step, and Sw(t) is the survival function.
[0030] In yet another case of the non-transitory computer-readable storage medium, outputting the forecast of the time to the future event as the log-likelihood function comprises determining a sum of log-likelihoods at each time-step.
[0031] In yet another case of the non-transitory computer-readable storage medium, the instructions further configure the computer to transform the sum of log-likelihoods as a function of recurrent neural network parameters and historical data, and determine a minimizer of an overall observed loss of the recurrent neural network using such function.
[0032] In yet another case of the non-transitory computer-readable storage medium, the instructions further configure the computer to output derivative values of the log-likelihood function.
[0033] These and other embodiments are contemplated and described herein. It will be appreciated that the foregoing summary sets out representative aspects of systems and methods to assist skilled readers in understanding the following detailed description.
BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The features of the invention will become more apparent in the following detailed description in which reference is made to the appended drawings wherein:
[0035] FIG. 1 is a schematic diagram of a system for individual forecasting of a future event for a subject using historical data, in accordance with an embodiment;
[0036] FIG. 2 is a flowchart of a method for individual forecasting of a future event for a subject using historical data, in accordance with an embodiment;
[0037] FIG. 3 is a plot of an example of time-since-event (tse(t)) and time-to-event (tte(t)) until an end of a training period, in accordance with the system of FIG. 1 ;
[0038] FIG. 4A is an example of a distributional estimate for an uncensored case with time equals 3, in accordance with the system of FIG. 1 ;
[0039] FIG. 4B is an example of a distributional estimate for a censored case with time equals 7, in accordance with the system of FIG. 1 ;
[0040] FIG. 5 is a diagram of an example recurrent neural network (RNN) computational flow, in accordance with the system of FIG. 1 ;
[0041] FIG. 6 is a diagram of an example Bayesian Network, in accordance with the system of FIG. 1 ;
[0042] FIG. 7 is a chart of a receiver operating characteristic (ROC) curve for example experiments of the system of FIG. 1 ;
[0043] FIG. 8A illustrates a chart of predicted densities for remaining useful life (RUL) for the example experiments of FIG. 7;
[0044] FIG. 8B illustrates a chart of predicted modes for RUL for the example experiments of FIG. 7; [0045] FIG. 9A illustrates a histogram of errors for a comparison approach in the example experiments of FIG. 7; and
[0046] FIG. 9B illustrates a histogram of errors for the system of FIG. 1 in the example experiments of FIG. 7.
DETAILED DESCRIPTION
[0047] Embodiments will now be described with reference to the figures. For simplicity and clarity of illustration, where considered appropriate, reference numerals may be repeated among the Figures to indicate corresponding or analogous elements. In addition, numerous specific details are set forth in order to provide a thorough understanding of the embodiments described herein. However, it will be understood by those of ordinary skill in the art that the embodiments described herein may be practiced without these specific details. In other instances, well-known methods, procedures and components have not been described in detail so as not to obscure the embodiments described herein. Also, the description is not to be considered as limiting the scope of the embodiments described herein.
[0048] Various terms used throughout the present description may be read and understood as follows, unless the context indicates otherwise: “or” as used throughout is inclusive, as though written “and/or”; singular articles and pronouns as used throughout include their plural forms, and vice versa; similarly, gendered pronouns include their counterpart pronouns so that pronouns should not be understood as limiting anything described herein to use, implementation, performance, etc. by a single gender; “exemplary” should be understood as “illustrative” or “exemplifying” and not necessarily as “preferred” over other embodiments. Further definitions for terms may be set out herein; these may apply to prior and subsequent instances of those terms, as will be understood from a reading of the present description.
[0049] Any module, unit, component, server, computer, terminal, engine or device exemplified herein that executes instructions may include or otherwise have access to computer readable media such as storage media, computer storage media, or data storage devices (removable and/or non-removable) such as, for example, magnetic disks, optical disks, or tape. Computer storage media may include volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information, such as computer readable instructions, data structures, program modules, or other data. Examples of computer storage media include RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by an application, module, or both. Any such computer storage media may be part of the device or accessible or connectable thereto. Further, unless the context clearly indicates otherwise, any processor or controller set out herein may be implemented as a singular processor or as a plurality of processors. The plurality of processors may be arrayed or distributed, and any processing function referred to herein may be carried out by one or by a plurality of processors, even though a single processor may be exemplified. Any method, application or module herein described may be implemented using computer readable/executable instructions that may be stored or otherwise held by such computer readable media and executed by the one or more processors.
[0050] The following relates generally to data processing, and more specifically, to a method and system for individual demand forecasting.
[0051] For the sake of clarity of illustration, the following disclosure generally refers to the implementation of the present embodiments for product demand forecasting; however, it is appreciated that the embodiments described herein can be used for any suitable application of individual event forecasting. For example, the embodiments described herein could be used to predict the time until a future occurrence of a natural event; such as an earthquake as the subject to be forecasted. In another example, the embodiments described herein could be used to predict the time until a utility spike occurs; such as a spike in electricity consumption or a spike in internet bandwidth as the subjects. In another example, the embodiments described herein could be used to predict component failure times for factory machinery; such as using workload history as input. In another example, the embodiments described herein could be used to predict various other consumer behavior patterns; such as predicting when a client will go on vacation.
[0052] In an illustrative example, retailers can have access to massive amounts of consumer behavior data through, for example, customer loyalty programs, purchase histories, and responses to direct marketing campaigns. These data sources can allow retailers to customize their marketing communications at the individual level through personalized content, promotions, and recommendations via channels such as email, mobile and direct mail. Accurately predicting every individual customer behavior for each product is useful in direct marketing efforts which can lead to significant advantages for a retailer driving increased sales, margin, and return on investment. Especially for replenishable products such as regularly consumed food products (e.g. milk) and regularly replenished personal care products (e.g. soap). These products frequently drive store traffic, basket size, and customer loyalty, which are of strategic importance in a highly competitive retail environment.
[0053] In the above illustrative example, accurately forecasting individual demand for single products is a challenging and complex technical problem. This problem generally requires predicting not only the next most likely time of purchase of the product but also having an accompanying measure of uncertainty due to the inherent randomness of an individual’s purchasing behavior. Additionally, this problem usually has sparse observations (for example, few observations for individual customers) and partial information (for example, purchases of related products and time since last purchase). Additionally, this problem usually has sequential dependence because future purchase patterns are generally heavily influenced by past behavior. Additionally, this problem usually has strong correlation between purchase patterns across substitutable products that indicates that customer behavior should be jointly predicted. For example, among purchasers of items in a basket of 12 deli products that were recorded, there were 79,980 unique purchasers. Purchase histories for any single product is generally sparse. For any single product in this basket, the average customer buys only between 0.12 to 0.67 items over a 1.5-year period but aggregating over all the products in the basket indicates that these customers purchase on average 3.58 items during the same period. This is not surprising since people tend to prefer variety in their meals even though their choice of whether to purchase a deli product can in some cases be predicted.
[0054] Some approaches for accurately forecasting individual demand for single products adapt methods from survival analysis, where a customer is defined to be “alive” if purchases were made. In a scenario with sparse purchase data, this can be useful since non- purchases can reveal information about whether a customer is likely to make a purchase in the future. In addition to modeling whether customers are “alive”, the number of purchases a customer makes in a given time period can also be accounted for. Solving this maximum likelihood problem can yield optimal distributional estimates that model such behaviors. However, these models impose strict assumptions that limit their effectiveness; such as independence and stationarity. In addition, covariates are often modeled in a regression context, further restricting the hypothesis space. While these assumptions may be essential for tractability purposes, in some cases, they can be easily violated when there is a desire to model highly-correlated, high-dimensional and heterogeneous processes. One example of a survival model is a Pareto/NBD model. In this model, heterogeneity of customer purchase rates and customer dropout times are assumed to follow parametric distributions. While this may be suited for predicting a time-to-event, incorporating covariates in this context generally requires imposing a linearity assumption on one of the model parameters in order to fit a model; which is an unrealistic assumption for models with a large number of data features. While copulas may be used to model customer repurchase patterns, they cannot be sufficiently extended to predict multiple products jointly and under changing environmental conditions.
[0055] Some approaches for accurately forecasting individual demand for single products attempt to use machine learning approaches to predict arrival times; for example, Recurrent Neural Networks (RNNs). These approaches leverage the capacity of RNNs to model sequential data with complex temporal correlations as well as non-linear associations. However, these models generally do not deal explicitly with the uncertainty of random arrival times and are not able to properly exploit censored data. Other machine learning approaches have been used; for example, Random Forest models and other ensemble models have been used with binary predictions due to their scalability to wide datasets, ease of training and regularization strategies. However, such tree-based supervised learning models are not well suited to sequentially dependent problems. Recurrent Neural Nets (RNN) are better suited to model data with complex sequential dependencies. For example, using a Long-Short-Term-Memory (LSTM) structure that incorporates gates to recursively update an internal state in order to make sequential path-dependent predictions. In an example LSTM can be trained to make point estimates for time-to-event by minimizing a distance-based metric. However, unobserved arrival times cannot be explicitly accounted for in these models. Non-arrivals can be important as they can reveal a significant amount of information for the prediction.
[0056] Embodiments of the present disclosure advantageously integrate probabilistic approaches of survival analysis with Recurrent Neural Networks to model inter-purchase times for multiple products jointly for each individual customer. In some embodiments, the output of the RNN models the distribution parameters of a “time to next purchase” random variable instead of a point estimate. In a survival analysis framework, partial information, such as time since the previous arrival, can induce a distribution on the partially observed version of the “time to next purchase” random variable. The structure of such embodiments can impose additional constraints which transform the complex censoring problem into a likelihood-maximization problem. Advantageously, the use of RNNs can remove the need for strict assumptions of past survival analysis models while still having the flexibility to take into account the censored and sequential nature of the problem. In the present disclosure, such Multivariate Arrival Times Recurrent Neural Network models may be referred to as “MAT- RNN”.
[0057] The present inventors determined the efficacy of the present embodiments in example experiments. The example experiments were performed on data from a large European health and beauty retailer, several benchmark datasets as well as a synthetic dataset. The present embodiments were determined to out-perform other approaches in predicting whether a customer made purchases in the next time period. The results of the example experiments illustrate that the present embodiments perform better than other approaches in 4 out of the 5 categories of products considered. Additionally, results on the benchmark and synthetic datasets show comparable performance increases when compared to other survival model techniques and RNNs trained on the usual squared-loss metric.
[0058] Referring now to FIG. 1 , a system 100 for individual forecasting of a future event for a subject, in accordance with an embodiment, is shown. In this embodiment, the system 100 is run on a server. In further embodiments, the system 100 can be run on any other computing device; for example, a desktop computer, a laptop computer, a smartphone, a tablet computer, a point-of-sale (“PoS”) device, a smartwatch, or the like.
[0059] In some embodiments, the components of the system 100 are stored by and executed on a single computer system. In other embodiments, the components of the system 100 are distributed among two or more computer systems that may be locally or globally distributed.
[0060] FIG. 1 shows various physical and logical components of an embodiment of the system 100. As shown, the system 100 has a number of physical and logical components, including a central processing unit (“CPU”) 102 (comprising one or more processors), random access memory (“RAM”) 104, an input interface 106, an output interface 108, a network interface 110, non-volatile storage 112, and a local bus 114 enabling CPU 102 to communicate with the other components. CPU 102 executes an operating system, and various modules, as described below in greater detail. RAM 104 provides relatively responsive volatile storage to CPU 102. The input interface106 enables an administrator or user to provide input via an input device, for example a keyboard and mouse. The output interface 108 outputs information to output devices, such as a display and/or speakers. The network interface 110 permits communication with other systems, such as other computing devices and servers remotely located from the system 100, such as for a typical cloud-based access model. Non-volatile storage 112 stores the operating system and programs, including computer-executable instructions for implementing the operating system and modules, as well as any data used by these services. Additional stored data, as described below, can be stored in a database 116. During operation of the system 100, the operating system, the modules, and the related data may be retrieved from the non-volatile storage 112 and placed in RAM 104 to facilitate execution. [0061] In an embodiment, the system 100 further includes a data acquisition module 117, a conditional excess module 118, a machine learning module 120, and a forecasting module 122. In some cases, the modules 117, 118, 120, 122 can be executed on the CPU 110. In further cases, some of the functions of the modules 117, 118, 120, 122 can be executed on a server, on cloud computing resources, or other devices. In some cases, some or all of the functions of any of the modules 117, 118, 120, 122 can be run on other modules.
[0062] Forecasting is the process of obtaining a future value for a subject using historical data. Machine learning techniques, as described herein, can use the historical data in order to train their models and thus produce reasonably accurate forecasts when queried.
[0063] In some embodiments, the machine learning module 120 uses a Recurrent Neural Net (RNN) to output distributional parameters which represent predictions for the remaining time to arrival. By iterating through time tor each customer, the RNN can output sequential distributional estimates for the remaining time until the next purchase arrival, giving an individual demand forecast. Advantageously, the output as a distribution can allow for better decision-making ability because it can allow for the performance of a cost analysis.
[0064] In some cases, each product's inter-purchase time can be assumed to be a realization of a random variable that is distinct for each customer and each product. In some cases, each product’s inter-purchase time can also be dependent on other product purchase times. The conditional excess module 118 can use a conditional excess random variable, which represents a remaining time till next arrival conditioned on observed information to date. This random variable can have a distribution that is induced by an actual interpurchase time as well as a censoring state.
[0065] In some embodiments, the forecasting module 122 can determine a log-likelihood function based on the conditional excess random variable and the outputs of the RNN. In some cases, it is assumed that the approach of these embodiments follows a conditional independence structure where these conditional excess random variables are assumed to be independent given the internal state of the RNN. In such embodiments, the loss function can be defined to be the negative log-likelihood. The optimal RNN parameters in such embodiments can generate distributional parameters that can be advantageously used to model the observed data. Hence, the RNN outputs at the end of training period can be used by the forecasting module 122 as best distributional estimates for a remaining time to next purchase.
[0066] In the present disclosure, a random variable representing the remaining time till next arrival conditioned on the current information is denoted as Zt. In most cases, this random variable is not the true inter-arrival time, but is instead a version of it, conditioned on observing partial information. Consider an arrival process, where Wn is the time of the n-th arrival. Let W0 = 0 at the start of a training period. Additionally, let N(t) be the number of arrivals by time t and let Yn be the inter-arrival time of the n-th arrival, which is the difference between consecutive arrival times.
N (t) = max {n \ Wn ≤ t} (1)
Yn = Wn - Wn-1
[0067] At a particular timet, the number of arrivals observed is N(t). The system 100 predicts the subsequent (i.e. the {N(t) + 1 }-th arrival) and its inter-arrival time YN(t)+1· Let tse(t) (time-since-event) be the amount of time that has elapsed since the last arrival or start of training period, whichever is smaller. This represents the censoring information that is available to the RNN at each time t. Let tte(t) (time-to-event) be the amount of time remaining until the next arrival or the end of testing period (T), whichever is smaller. tse(t) = t - WN(t) (2) tte(t) = min { WN(t)+1 - t, T - t }
[0068] For the purposes of illustration, consider an example of the above with 3 arrivals; where W1, = 16, W2 = 28, and W3 = 32, such that Y1 = 16, Y2 = 12, and Y3 = 4. Also, N(t) is a piecewise constant function which is 0 for t < 16, 1 for t ∈ [16, 28), 2 for t ∈ [28, 32), and 3 for t ≥ 32. FIG. 3 illustrates an example plot of tse(t), tte(t) for t until T = 40, which is the end of the training period.
[0069] In some embodiments, the remaining time till next arrival (Zt) can be a conditional random variable that depends only on YN(t)+1, which is the inter-arrival time of the subsequent arrival. The random variable Zt, given the observed information, can thus be defined; which is referred to as a conditional excess random variable. In these embodiments, Zt has a distribution induced by YN(t)+1 since tse(t) is fixed. Zt = YN(t)+1 - tse(t) I YN(t)+1 > tse(t). (3)
[0070] For example, consider Z = Y - t \ Y > t. This random variable Z is conditioned on the fact that Y has been observed to exceed t and the system 100 is interested in the excess value; i.e., Y - t. The distribution of Y induces a distribution on Z.
Figure imgf000014_0001
[0071] In an embodiment, there are two cases to define the log-likelihood function. When the next arrival time is observed, the likelihood evaluation is P (Zt ∈ [tte(t), tte(t) + 1]), since inter-arrival times are only discretely observed. However, where the time to next arrival is not observed (i.e. no more subsequent arrivals are observed by end of training), the likelihood evaluation is instead P (Zt > tte(t)), namely the survival function. Therefore, at each time t, the random variable YN(t)+1 which has distribution parametrized by θt, induces a distribution on Zt. Thus, the log-likelihood at each time t can be written as follows:
(log P (Zt ∈ [tte(t), tte(t) + 1]) if uncensored lt θt [log P (Zt > tte(t) ) otherwise
Figure imgf000015_0001
[0072] FIGS. 4A and 4B illustrate examples of distributional estimates at two respective times (t=3 for FIG. 4A and t= 7 for FIG. 4B) to illustrate the above two cases. FIGS. 4A and 4B illustrate log-likelihood visualizations for different censoring statuses. In the uncensored log-likelihood computation, f3 is a density function of Z3, which is the predictive distribution for the remaining time till next arrival. Since the next arrival is observed to have occurred at time 6, f3 is evaluated at the value 3, which is the true time to next arrival to compute the log-likelihood. In the censored case, for the predictive distribution at time 7, the next arrival was not observed and hence the right tail of Z7 (i.e. > 3) was used to compute the log- likelihood.
[0073] It can be generally assumed that Yn follows distributions with differentiable density and survival functions to exploit the back-propagation approach used to fit the RNN. An example is a Weibull distribution parametrized by scale ( λ ) and shape ( k ), whose survival function is made up of exp() and power() functions.
Figure imgf000015_0002
[0074] To determine Weibull likelihoods, a random variable Y~ Weibull (scale = l, shape = k) can be determined that has simple densities and cumulative distribution functions. Since the survival function ( S(x)) has the form:
S(y) = P (Y> y)
= e-(yλ)k
Figure imgf000015_0003
= (k/λ) (y/λ)k-1 S(y)
[0075] The conditional excess random variable, given that it exceeds s, is W= Y - s \ Y > s. The definition of conditional probability in terms of some continuous random variable X1, X2, for any measurable set A1, A2, given P ( X2 ∈ A2) > 0:
Figure imgf000015_0004
[0076] The conditional excess survival function can thus be derived as: Sw ( t) = P (W> t )
= P (Y > s + t \Y > s)
= S (s + t)/S(s)
= exp {- (( s + t) /λ)k+ (s/λ)k }
[0077] The conditional excess density function can be determined as: fw (t) = f (s + t) / S(s)
= (k / λ) ((s + t) / λ)k-1 S(s + t) / S(s)
= (k / λ) ((s + t) / λ)k-1 Sw(t)
[0078] In an example, a Long Short Term Memory (LSTM) model can be used by the machine learning module 120 as a type of RNN structure for modeling sequential data. In further cases, other types of RNN models can be used by the machine learning module 120. At each time ( t ), the outputs of the LSTM, which is parametrized by θ, are passed through an activation function so that they are valid parameters of a distribution function (θt). Then, the log-likelihood is determined for each time step ( lt ) by the forecasting module 122, as described herein. FIG. 5 illustrates an example RNN computational flow with outputs (θt) generated by the LSTM. Log-likelihoods at each time are determined as log of densities parametrized by θt, evaluated at zt. Where ht is the internal state of the LSTM and Xt are the covariates at each time t. In this way, the machine learning module 120 can output a single prediction of expected value for each time (t).
[0079] In some embodiments, the machine learning module 120 can determine loss as a negative of the log-likelihood. Optimal parameters for the LSTM (θ) can be determined as outputs of a series of distributional estimates θt that best “explain” the sequence of data observed. In a particular case, the distribution can be a normal distribution. In the event of an uncensored arrival time at time t, the weights θt can be determined as those that generate a density that has a peak close to the actual arrival time. In this way, at each time step, a range of values and their relatively likelihood are provided; with the output denoted by 6t. Advantageously, with an output as a distribution, additional operations can be performed.
For example, determining a “best guess” expected value of the distribution. For example, certain quantities of the distribution can also be optimized; for example, it might be more costly to under-predicted to over-predict, producing a different “best guess.” For example, a credibility interval can be used (for example, a 90% credible interval) to determine where an output value is most likely to be; which can allow for better planning and better decision making. [0080] In an embodiment, the machine learning module 120 can assume a Bayesian Network, for example similar to a Hidden-Markov model, where random variables at each time t are emitted from a hidden state ht. As described, ht represents an internal state of the RNN at each time t and Zt is an observed time series. FIG. 6 illustrates an example of a Bayesian Network where observations are independent conditioned on hidden states.
[0081] The forecasting module 122 can factor the joint distribution of {Zt}, giving the log- likelihood for an entire time series as a sum of log-likelihoods at each time; such that the forecasting module 122 obtains a sum described below, for arbitrary events Et. Since Et is determined by the censoring status, where Et = {[tte(t), tte(t)+ 1]} if uncensored and Et = {> tte(t)} otherwise, the forecasting module 122 can decompose the overall log-likelihood as a sum:
Figure imgf000017_0001
l({θt}) = ∑t ltt) (7)
[0082] Assuming that the RNN model is parametrized by θ, there exists a function g that recursively maps Xt to (θt, ht) that depends only on θ. By substituting ht-1, ltt) = lt(gt(θ)) where gt depends only on θ, g, {Xl}}l≤t . Then since the overall log-likelihood is a sum of ltt), it can be written as a function of only the RNN parameters (θ) and observed data. The structure of the RNN and the back-propagation algorithm allows the determination of gradients of any order efficiently and therefore allows for the determination of θ, the minimizer of the overall observed loss.
Figure imgf000017_0002
[0083] In some embodiments, the machine learning module 120 can transform the outputs of the RNN such that they are parameters of a distribution. In a particular case, the machine learning module 120 can use a Weibull distribution, which is parametrized by shape and scale parameters, both of which are positive values. In example cases, the RNN output can be initialized for scale at the maximum-likelihood estimate (MLE) for a scale parameter of a Weibull distribution whose shape parameter is 1 ; as this was determined by the present inventors to be useful in preventing likelihood-evaluation errors. In example cases, a maximum shape parameter (set at 10) can be used and the RNN output can be passed for shape through a sigmoid function, which is rescaled and shifted such that cr : R → (0, 10) and σ*(0) = 1. In some cases, for the scale parameter, an exponential function is used, which is rescaled such that it maps 0 to the average inter-arrival-time. [0084] In some embodiments, the system 100 can model multivariate arrivals by assuming there are p different arrival processes of interest. For the i-th waiting time of interest, Wi,n is defined to be the time of the n-th arrival of this type and Ni(t), and Yi,n is likewise defined. Additionally, tse(i, t) and tte(i, t) are defined for the i-th type.
Zi,t = Yi,Ni(t))+1 - tse(i, t) I Yi,Ni(t))+1 > tse(i, t) (9)
[0085] Using the example of the Bayesian Network of FIG. 6, Zt = [Z1,t, . . . , Zp,t] and the RNN output θt = [θ1, t, . . . , θp,t]. The log-likelihoods for each event type can be determined where li,ti,t) = log P ( Zi,t = tte(i, t)) or li,ti,t), = log P ( Zi,t > tte(i, t)), recalling that the former is for the case where the next arrival is observed while the latter is for the case where the no arrivals are observed until the end of training.
[0086] Advantageously, the Bayesian Network of FIG. 6 generally requires minimal modifications as it merely requires that the emissions are conditionally independent given ht. The forecasting module 122 can then determine the log-likelihood at each time as a sum, ltt) = Σi li,ti,t). Since the LSTM model is still parameterized by 0, the remaining operations are the same as described above. In this way, temporal dependence as well as dependence between the p arrival processes can be modeled by the RNN, whose weights 0 can then be optimized by training data. This allows the forecasting module 122 to also model other outputs by appending [K1, t, . . . , Kp,t] to Zt where Kj,t is some other variable of interest for process j at time t. In the retail product forecasting example, Kj,t can be other factors affecting the customer; for example, a promotion. In a factory machinery example, Kj,t can be other variables that affect output; for example, ambient temperature
[0087] In some cases, for multi-variate purchase arrival times, masking sequences observed before the first arrival of each product can be useful in preventing numerical errors encountered in stochastic gradient descent. In these cases, log-likelihoods determined for time steps before the earliest arrival can be masked. In the case of RNNs, each time step can have a component in the loss function (for each output) and masking can be used to remove those time steps from the loss function so that they are not used in the optimization. This can ensure that RNN parameters are not updated due to losses incurred during these times.
[0088] The forecasting module 122 can determine predictions using the fact that at each time t, the estimated parameter θt can be used to determine the expectation of any function of Zt, assuming that Zt is distributed according to θt. Since the system 100 takes into account the next arrival time after the end of training period (time T), it can compute many different values of interest. As described herein, the values of interest can be derivative values of the output distribution; for example, expected value, median, 90% credible range, some other cost function (using a different under/overweighting of forecasts), and the like.
[0089] For example, the forecasting module 122 can determine a predicted probability that the next arrival will occur within γ time after end of training, and thus determine P ( ZT < γ).
The forecasting module 122 can also determine a deferred arrival probability, which is the probability that the next arrival will occur within an interval of between γ1 and γ1 + γ2 time after end of training; given that the forecasting module 122 knows it will not occur within γ1 time after the end of training. This can be determined by computing P ( ZT ∈ [ γ1, γ1 + γ2] \ ZT > γ1). The quantities of interest may not necessarily be limited to probabilities (for example, mean and quantiles of the predictive distribution) and can be extended to generate other analytics; for example, in the case of predicting product purchases, to aid in revenue analysis or forecasting that depends on the subsequent purchase time.
[0090] Turning to FIG. 2, a flowchart for a method 200 for individual forecasting of a future event for a subject, according to an embodiment, is shown. The forecast is based on historical data, for example, as stored in the database 116 or as otherwise received. The historical data comprising a plurality of historical events associated with the subject.
[0091] At block 202, the data acquisition module 117 receives the historical data associated with the subject from the input interface 106, the network interface 110, or the non-volatile storage 112. At block 204, the conditional excess module 118 determines a random variable representing a remaining time until the future event. The random variable conditioned based on excess times since arrival of the historical events in the historical data.
[0092] At block 206, the machine learning module 120 determines a distribution function that predicts the time of the future event using a recurrent neural network. The distribution function comprising a learned density with peaks that approximate the times of the historical events in the historical data.
[0093] At block 208, the forecasting module 122 determines a log-likelihood function based on a probability that the random variable exceeds an amount of time remaining until a next historical event in the historical data and parameterized by the distribution function. A loss function for the recurrent neural network comprising a negative of the log-likelihood function.
[0094] At block 210, the forecasting module 122 forecasts and outputs a time to the future event for a given subject using the log-likelihood function.
[0095] Described below are three sets of example experiments conducted by the present inventors to verify the functionality, efficacy, and advantages of the present embodiments. First, example experiments were conducted to check model assumptions and verify that parameters for Weibull inter-arrival times can be recovered by the present embodiments (using MAT-RNN) on a synthetic dataset. Second, example experiments were performed to compare the performance of MAT-RNN on two open datasets to benchmark models. Third, example experiments were conducted to apply MAT-RNN to predict customer purchases for a large retailer and compare its performance to other approaches in the art.
[0096] For the example experiments, a structure used for the RNN had three stacked layers, with two LSTM layers of size W followed by a densely connected layer of size 2p, where p is the number of arrival processes. The densely connected layer transforms the LSTM outputs to a vector of length 2p. In MAT-RNN, the densely connected layer outputs are passed through an activation layer. For squared-loss RNNs, the activation can be passed through a softplus layer since time to arrivals are non-negative.
[0097] In the example experiments, a masking layer was applied prior to the other layers so that the RNN does not train on time indices prior to the initialization of the time series. This structure is the same for other neural network based models used for benchmark comparison. The RNN was trained with a learning rate of 0.001 and trained for 100 steps unless otherwise stated. Gradients were component-wise clipped at 5 to prevent numerical issues.
[0098] The example experiments used a generated synthetic dataset, where inter-arrival times followed Weibull distributions. In the synthetic dataset, as shown in TABLE 1 , a set of Weibull parameters was generated for each of eight product types, from which inter-arrival times are sampled. The individual product identification is referred to as SKU (stock keeping unit).
TABLE 1
Figure imgf000020_0001
[0099] Purchase times were recorded and used to train the MAT-RNN model. In the example experiments, there were 11 ,000 subjects. Event arrivals were observed over a period of 156 time steps. It was then verified that the trained model (W = 6) recovers these parameters by taking the RNN predictions at the last time step. The results indicated that relative error (i.e. θ - θ, where θ is the estimated parameter and θ is the true parameter) is low for both scales as well as shapes. TABLE 2 shows errors for estimated parameters for Weibull inter-arrival. TABLE 2
Figure imgf000021_0001
[0100] The example experiments show the flexibility of the present embodiments with two open dataset benchmarks. Generally, these two problems are often tackled with different models since the prediction problem is different. The model of the present embodiments can, however, be adapted to solve these problems since they can be modeled by a distributional approach to inter-arrival times.
[0101] The first example dataset is the CDNOW dataset. For this dataset, the example experiments considered a binary classification problem where the system 100 predicts if purchases are made during a testing period. Predictions by the system 100 were determined as the probability that the inter-arrival time occurs before end of testing period. The input data was the transaction history where only purchase records are available without other covariate data. The example experiments show that present embodiments out-perform other approaches on this dataset, even with no covariates.
[0102] The second example dataset is based on the CMAPSS dataset. For this dataset, the system 100 predicted the remaining useful lifetime, or the time to failure. Predictions were determined as the mode, mean, or some other function of the inter-arrival time distribution. The training data was an uncensored time series where sensor readings and operational settings were collected up until the engine fails. A customized loss function was used to evaluate models.
[0103] The CDNOW dataset includes purchase transactions, where number of customer purchases are recorded. Transaction dates, purchase counts, and transaction values were available as covariates. The performance of the present embodiments, where W = 1 trained on a weekly level, was compared to another approach, the Pareto/NBD model, which is a classical demand forecasting model using the lifetimes package. The CDNOW dataset is often used as an example where Pareto/NBD type models do well since there's limited covariate data available and there is only a single event type.
[0104] In the example experiments, with W = 1 , there were 32 trainable parameters in the MAT-RNN model of the present embodiments. The training period was set at 1.5 years, from 1997-01-01 to 1998-05-31. Predictions were made for customer purchases within a month of the end of training; i.e. , before 1998-06-30. As illustrated in the chart of FIG. 7, the MAT- RNN model of the present embodiments achieved an ROC-AUC (area under the receiver operating characteristic curve) of 0.84 on the CDNOW dataset; which is substantially better when compared to 0.80 that is obtained using the Pareto/NBD estimate for the "alive" probability. It can be seen that the approach of the present embodiments of integrating a survival-based maximum log-likelihood approach with an RNN yielded substantially improved prediction accuracy, even with a small number of weights and on a small dataset.
[0105] The CMAPSS dataset is a high dimensional dataset on engine performance with 26 sensor measurements and operational settings. In training of the model for the example experiments, the engines were run until failure. In testing of the model, data was recorded until a time prior to failure. The goal was to predict the remaining useful life (RUL) for these engines. A first set of engine simulations in the dataset, which has 100 uncensored time series of engines, were run until failure. The maximum cycles run before failure was found to be 363. Time series for each engine was segmented into sliding windows of window length 78, resulting in 323 windowed time series each of length 78. For the testing dataset, the RNN model was run on a time series 78 cycles before end of observation. A custom loss function was used, where over-estimation was more heavily penalized. The mean custom loss metric (MCL) is defined as follows, where d is the predicted RUL subtracted by the true RUL: loss d < 0 (10)
Figure imgf000022_0001
d > 0
[0106] The performance of the MAT-RNN model of the present embodiments was compared to the SQ-LOSS, which has a softplus activation and is trained on squared loss.
Performance was evaluated based on the mean squared loss metric (MSE) as well as the MCL. The RNN models were trained with W = 64. As illustrated in FIGS. 8A and 8B, the performance of MAT-RNN was substantial, with modes that correspond roughly to the true RUL. FIG. 8A illustrates a chart of predicted densities for RUL on C-MAPSS and True RUL. FIG. 8B illustrates a chart of predicted modes for RUL on C-MAPSS and True RUL.
[0107] The example experiments determined that the MAT-RNN model of the present embodiments performed better than SQ-LOSS in the metrics considered, with MAT-RNN having a mean loss of 40.09 compared to SQ-LOSS of 193.36. In the RMSE metric (root- mean-squared-error), MAT-RNN had an error of 35.65 compared to SQ-LOSS which as 36.48. It was advantageously determined by the present inventors that MAT-RNN is more biased towards under-estimating RUL which makes it perform much better in the custom loss metric. Also, we find that from the histogram of errors illustrated in FIGS. 9A and 9B that MAT-RNN predictions are unimodal and clustered tightly around its mode. FIG. 9A illustrates a histogram of errors for SQ-LOSS and FIG. 9B illustrates a histogram of errors for MAT- RNN. [0108] In the example experiments, the present inventors determined the predictive performance on a real-life application for predicting purchases of a few baskets of goods sold by a large European retailer. The time resolution of the dataset was on a weekly level. Training data was available over roughly 1.5 years, which gave 78 weeks of training data from 2014 01-01 to 2015 06 30 Performance of the MAT-RNN model of the present embodiments was measured on a binary classification problem of predicting whether a customer purchases the product within 4 weeks after the end of training period from 2015 06-30 to 2015 07 31
[0109] The MAT-RNN model of the present embodiments can be used to predict various different quantities of interest; however, for the purposes of the example experiments, comparison was of the predictive performance of the MAT-RNN model to a few benchmark models. Such comparison was with respect to whether an event will arrive within y time after the end of the training period. The benchmark models were a Squared-Loss RNN (SQ-RNN) and a Random Forest Predictor (RNG-F). Models were trained on all customers who bought an item in the basket during the training period and performance was evaluated on this group of customers during the testing period.
[0110] RNG-F was trained by splitting the training period into two periods. Covariates at the end of the first period were fed into the model, which was trained to predict whether subjects purchase in the second period, which was also y long. A different RNG-F model was trained for each product, but was fed covariate datasets for all products.
[0111] SQ-LOSS was trained by setting the loss function as the squared difference between the predicted time-to-arrival and the actual time-to-arrival. An activation function of softplus was applied. Predictions of SQ-LOSS were then compared to the testing period length of y.
If by the end of the training period, SQ-LOSS predicts the next time- to-arrival as s, then the prediction metric is γ-s. For time periods where no actual time-to-arrival was observed (i.e. no further purchases were observed by end of training), loss was set to 0.
[0112] For each customer, at each time period, the Recency, Frequency and Monetary (RFM) metrics were determined, which are commonly used in demand modeling, at 3 different levels; namely for all products, in-basket products and each individual product. Recency is the time since last purchase, Frequency is the number of repeat purchases and Monetary is the amount of money spent on all purchases to date. Included in the covariates are time-since-event (tse(t)) and indicators for whether a first purchase has occurred (pch(t)). The time-to-event (tse(t)) and the censoring status of the next arrival (unc(t)) were also determined. [0113] On a per-product level, the types of covariates were limited to only RFM metrics (3 covariates) and transformations of purchase history (2 series). RFM metrics on the category and overall purchase history levels were available as well, but these account for an additional 6 covariates that were shared across the various purchase arrival processes. The total number of covariates for each product is thus 11 , 6 of which are shared with other products.
[0114] Five baskets of popular replenishable products were selected for the example experiments. These were selected from products ranked by a score, where Nunique is the number of unique customers and X is the average purchases per customer: score = X * log Nunique (11)
[0115] The five selected baskets were bars, deli, floss, pads, soda. Their data summaries are presented in TABLE 3, where μoverall is the average in-basket purchase counts, μper-sku is the mean over the per-product average purchase counts, and pothers is the mean over the per-product proportion of buyers who bought another product in-basket. Also note that ptriai is the mean over the per-product proportion of trial customers (i.e. those who have made only a single purchase).
TABLE 3
Figure imgf000024_0001
[0116] As shown, pads had the highest proportion of trial customers along with the smallest proportion of customers who bought another item in the basket. On the other hand, μper-sku was roughly median in the baskets considered. This is similar for floss as well. For these categories, it would be reasonable to expect product purchases are strongly dependent. A good joint-prediction model should separate trial purchasers from repeat purchasers who decided to stick to one product after trying another. [0117] Performance was measured based on the ROC-AUC metric where each of the models predicted whether customers who made in-basket purchases would make another in-basket purchase in a 4 week period after the end of a training period of 78 weeks. The RNN-based models had W = 36 and predict arrival times jointly over different products for each customer. The RNG-F model was trained with 100 trees with covariates at week 74 and purchases between week 74 and 78 but predicts purchases for only one product at a time. As such, a separate RNG-F model is trained for each product.
[0118] The example experiments determined how each model does for every product in the basket, and as such, there are multiple ROC-AUC metrics. TABLE 4 shows the results of the example experiments in terms of summary statistics for ROC- AUCs for each item in the basket. The results illustrate that the MAT-RNN model of the present embodiments almost always dominates in the ROC-AUC metric for every category other than bars and deli, which has the smallest number of customers. Even so, MAT-RNN still performs the best in terms of average ROC-AUC among products in each category other than bars.
[0119] The number of products for which ROC-AUC has improved over RNG-F is substantial for the MAT-RNN model. Excluding bars where only 2 out of 6 products saw improved performance, other categories saw ROC-AUC improvements in more than 60% of the products in-category, with soda and pads showing improvements in all products. Advantageously, the ability to model sequential data and sequential dependence separates MAT-RNN model from RNG-F. Even though RNG-F is trained on the evaluation metric, it was determined that MAT-RNN almost always performed better in this binary classification task.
[0120] Notably, the performance difference of the MAT-RNN model of the present embodiments over SQ-LOSS and RNG-F is greatest for the pads category. This is likely due to the large amount of missing data since customers are least likely to buy other products. It was also determined that SQ-LOSS performs poorly compared to MAT-RNN, even though these models have a similar recurrent structure and are fed the same sequential data. One possible explanation is that the lack of ground truth data has a significant impact on the ability of SQ-LOSS to learn. In cases where event arrivals are sparse or where inter- purchase periods are long, the censored nature of the data gives no ground truth to train SQ-LOSS on. Therefore, even though the recurrent structure makes it possible to model sequential dependence, the structure that the MAT-RNN model imposes on the problem makes it much easier to make predictions with censored observations. Additionally, from the results, it was determined that the MAT-RNN model performs even better for larger customers with larger sample sizes. TABLE 4
Figure imgf000026_0001
[0121] From the example experiments, joint predictions enjoy some advantages over individual predictions as product purchases can be modeled better through joint modeling. Generally, if network structure is the same, then the amount of time required to train a separate model for each product scales linearly with the number of products. The number of parameters in a collection of individual models is also significantly larger than that of a joint model.
[0122] The advantages of training a joint MAT-RNN model over a collection of individual ones can be illustrated by comparing ROC-AUC performance in the soda basket, as shown in TABLE 5. The per-product individual models were given the same covariates but trained only on the purchase arrivals of that particular product. The network structure is the same with W = 36, but the final densely connected layer outputs only a vector of size 2, since distributional parameters for one product is required. However, since the collection of single models have different weights for their RNNs, they have approximately 8 times the number of parameters found in the joint model. As shown in TABLE 5, there is a consistent advantage of a joint model over the individually trained single models, with improvements ranging from 0.0029 to 0.1098. Potential improvements in model performance can be observed by modeling purchase arrivals jointly, even with much fewer number parameters in the joint model.
TABLE 5
Figure imgf000026_0002
Figure imgf000027_0001
[0123] Advantageously, the present embodiments can use a survival analysis approach with recurrent neural nets (RNN) to forecast joint arrival times until a next event for each individual over multiple items. The present inventors advantageously recognized the technical advantages of transforming an arrival time problem into a likelihood-maximization problem with loose distributional assumptions regarding inter-arrival times. The example experiments demonstrated that not only can known parameters be recovered during fitting, but also that there are substantial improvements over other approaches.
[0124] Although the invention has been described with reference to certain specific embodiments, various modifications thereof will be apparent to those skilled in the art without departing from the spirit and scope of the invention as outlined in the claims appended hereto. The entire disclosures of all references recited above are incorporated herein by reference.

Claims

1. A computer-implemented method for individual forecasting of a future event for a subject using historical data, the historical data comprising a plurality of historical events associated with the subject, the computer-implemented method executed on at least one processing unit, the computer-implemented method comprising: receiving the historical data associated with the subject; determining a random variable representing a remaining time until the future event; predicting a time to the future event using a distribution function that is determined using a recurrent neural network, the distribution function comprising a learned density with peaks that approximate the times of the historical events in the historical data; determining a log-likelihood function based on a probability that the random variable exceeds an amount of time remaining until a next historical event in the historical data and parameterized by the distribution function; and outputting a forecast of a time to the future event as the log-likelihood function.
2. The computer-implemented method of claim 1 , wherein a loss function for the recurrent neural network comprises a negative of the log-likelihood function.
3. The computer-implemented method of claim 1 , wherein the random variable is conditioned based on inter-arrival times of the historical events in the historical data.
4. The computer-implemented method of claim 1 , wherein the random variable is conditioned based on excess times since arrival of preceding historical events in the historical data.
5. The computer-implemented method of claim 1 , wherein the log-likelihood function at each time is the log of the probability that the random variable is in the set of time until the next historical event when the next historical event has been observed, and the log of the survival function otherwise.
6. The computer-implemented method of claim 5, wherein the distribution function follows a Weibull distribution.
7. The computer-implemented method of claim 6, wherein the distribution function is determined as (k/A)((s+t)/A)k^ Sw{t), where k is the shape of the Weibull distribution, A is the scale of the Weibull distribution, t is the time-step, and Sw(t) is the survival function.
8. The computer-implemented method of claim 1 , wherein outputting the forecast of the time to the future event as the log-likelihood function comprises determining a sum of log-likelihoods at each time-step.
9. The computer-implemented method of claim 8, further comprising transforming the sum of log-likelihoods as a function of recurrent neural network parameters and historical data, and determining a minimizer of an overall observed loss of the recurrent neural network using such function.
10. The computer-implemented method of claim 1 , further comprising outputting derivative values of the log-likelihood function.
11. A system for individual forecasting of a future event for a subject using historical data, the historical data comprising a plurality of historical events associated with the subject, the system comprising one or more processors in communication with a data storage, the one or more processors configurable to execute: a data acquisition module to receive the historical data associated with the subject; a conditional excess module to determine a random variable representing a remaining time until the future event; a machine learning module 120 to predict a time to the future event using a distribution function that is determined using a recurrent neural network, the distribution function comprising a learned density with peaks that approximate the times of the historical events in the historical data; and a forecasting module to determine a log-likelihood function based on a probability that the random variable exceeds an amount of time remaining until a next historical event in the historical data and parameterized by the distribution function, and to output a forecast of a time to the future event as the log- likelihood function.
12. The system of claim 11 , wherein a loss function for the recurrent neural network comprises a negative of the log-likelihood function.
13. The system of claim 11 , wherein the random variable is conditioned based on interarrival times of the historical events in the historical data.
14. The system of claim 11 , wherein the random variable is conditioned based on excess times since arrival of preceding historical events in the historical data.
15. The system of claim 11 , wherein the log-likelihood function at each time is the log of the probability that the random variable is in the set of time until the next historical event when the next historical event has been observed, and the log of the survival function otherwise.
16. The system of claim 15, wherein the distribution function follows a Weibull distribution.
17. The system of claim 16, wherein the distribution function is determined as (k/λ)((s+t)/λ)k-1 Sw(t), where k is the shape of the Weibull distribution, A is the scale of the Weibull distribution, t is the time-step, and Sw(t) is the survival function.
18. The system of claim 11 , wherein outputting the forecast of the time to the future event as the log-likelihood function comprises determining a sum of log-likelihoods at each time-step.
19. The system of claim 18, wherein the forecasting module further transforms the sum of log-likelihoods as a function of recurrent neural network parameters and historical data, and determining a minimizer of an overall observed loss of the recurrent neural network using such function.
20. The system of claim 11 , wherein the forecasting module further outputs derivative values of the log-likelihood function.
21. A non-transitory computer-readable storage medium, the computer-readable storage medium including instructions that when executed by a computer, cause the computer to: receive the historical data associated with the subject; determine a random variable representing a remaining time until the future event; predict a time to the future event using a distribution function that is determined using a recurrent neural network, the distribution function comprising a learned density with peaks that approximate the times of the historical events in the historical data; determine a log-likelihood function based on a probability that the random variable exceeds an amount of time remaining until a next historical event in the historical data and parameterized by the distribution function; and output a forecast of a time to the future event as the log-likelihood function.
22. The computer-readable storage medium of claim 21 , wherein a loss function for the recurrent neural network comprises a negative of the log-likelihood function.
23. The computer-readable storage medium of claim 21 , wherein the random variable is conditioned based on inter-arrival times of the historical events in the historical data.
24. The computer-readable storage medium of claim 21 , wherein the random variable is conditioned based on excess times since arrival of preceding historical events in the historical data.
25. The computer-readable storage medium of claim 21 , wherein the log-likelihood function at each time is the log of the probability that the random variable is in the set of time until the next historical event when the next historical event has been observed, and the log of the survival function otherwise.
26. The computer-readable storage medium of claim 25, wherein the distribution function follows a Weibull distribution.
27. The computer-readable storage medium of claim 26, wherein the distribution function is determined as (k/A)((s+t)/A)k-1SW(t), where k is the shape of the Weibull distribution, A is the scale of the Weibull distribution, t is the time-step, and SW(t) is the survival function.
28. The computer-readable storage medium of claim 21 , wherein outputting the forecast of the time to the future event as the log-likelihood function comprises determine a sum of log-likelihoods at each time-step.
29. The computer-readable storage medium of claim 28, wherein the instructions further configure the computer to transform the sum of log-likelihoods as a function of recurrent neural network parameters and historical data, and determining a minimizer of an overall observed loss of the recurrent neural network using such function.
30. The computer-readable storage medium of claim 21 , wherein the instructions further configure the computer to output derivative values of the log-likelihood function.
PCT/CA2020/051422 2019-10-24 2020-10-23 Method and system for individual demand forecasting WO2021077226A1 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CA3,059,932 2019-10-24
US16/662,336 US20210125073A1 (en) 2019-10-24 2019-10-24 Method and system for individual demand forecasting
CA3059932A CA3059932A1 (en) 2019-10-24 2019-10-24 Method and system for individual demand forecasting
US16/662,336 2019-10-24

Publications (1)

Publication Number Publication Date
WO2021077226A1 true WO2021077226A1 (en) 2021-04-29

Family

ID=75619509

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CA2020/051422 WO2021077226A1 (en) 2019-10-24 2020-10-23 Method and system for individual demand forecasting

Country Status (1)

Country Link
WO (1) WO2021077226A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113255231A (en) * 2021-06-18 2021-08-13 腾讯科技(深圳)有限公司 Data processing method, device, equipment and storage medium
US11430040B2 (en) * 2020-01-29 2022-08-30 Walmart Apollo, Llc Smart basket recommendations for online selections
CN116894684A (en) * 2023-09-11 2023-10-17 山东商业职业技术学院 Big data-based computer data processing method and system

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200012921A1 (en) * 2018-07-09 2020-01-09 Tata Consultancy Services Limited Failed and censored instances based remaining useful life (rul) estimation of entities

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200012921A1 (en) * 2018-07-09 2020-01-09 Tata Consultancy Services Limited Failed and censored instances based remaining useful life (rul) estimation of entities

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
CHEN ET AL.: "Multivariate Arrival Times with Recurrent Neural Networks for Personalized Demand Forecasting", 2018 IEEE INTERNATIONAL CONFERENCE ON DATA MINING WORKSHOPS (ICDMW), 17 November 2018 (2018-11-17), pages 810 - 819, XP033516147, Retrieved from the Internet <URL:https://ieeexplore.ieee.org/abstract/document/8637442> [retrieved on 20201126], DOI: 10.1109/ICDMW.2018.00121 *
MARTINSSON, EGIL: "WTTE-RNN: Weibull Time To Event Recurrent Neural Network A model for sequential prediction of time-to-event in the case of discrete or continuous censored data, recurrent events or time-varying covariates", MASTER’S THESIS IN ENGINEERING MATHEMATICS & COMPUTATIONAL SCIENCE, 2017, Chalmers University of Technology, XP055814001, Retrieved from the Internet <URL:https://www.semanticscholar.org/paper/WTTE-RNN-%3A-Weibull-Time-To-Event-Recurrent-Neural-A-Martinsson/8d6471d7ea6729b09e93029a3b7dcc5374796479> [retrieved on 20201126] *
REN KAN, QIN JIARUI, ZHENG LEI, YANG ZHENGYU, ZHANG WEINAN, QIU LIN, YU YONG: "Deep Recurrent Survival Analysis", THE THIRTY-THIRD AAAI CONFERENCE ON ARTIFICIAL INTELLIGENCE (AAAI-19), 17 July 2019 (2019-07-17), pages 4798 - 4805, XP055814006, Retrieved from the Internet <URL:https://ojs.aaai.org//index.php/AAAI/article/view/4407> [retrieved on 20201126] *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11430040B2 (en) * 2020-01-29 2022-08-30 Walmart Apollo, Llc Smart basket recommendations for online selections
CN113255231A (en) * 2021-06-18 2021-08-13 腾讯科技(深圳)有限公司 Data processing method, device, equipment and storage medium
CN113255231B (en) * 2021-06-18 2023-03-10 腾讯科技(深圳)有限公司 Data processing method, device, equipment and storage medium
CN116894684A (en) * 2023-09-11 2023-10-17 山东商业职业技术学院 Big data-based computer data processing method and system
CN116894684B (en) * 2023-09-11 2023-11-24 山东商业职业技术学院 Big data-based computer data processing method and system

Similar Documents

Publication Publication Date Title
US20210125073A1 (en) Method and system for individual demand forecasting
Nguyen et al. Forecasting and Anomaly Detection approaches using LSTM and LSTM Autoencoder techniques with the applications in supply chain management
Kumar et al. Predictive analytics: a review of trends and techniques
McMahan et al. Ad click prediction: a view from the trenches
CN111160968A (en) SKU-level commodity sales prediction method and device
WO2021077226A1 (en) Method and system for individual demand forecasting
Sun et al. Dynamic matrix factorization: A state space approach
US20180349790A1 (en) Time-Based Features and Moving Windows Sampling For Machine Learning
Chen et al. Distributed customer behavior prediction using multiplex data: A collaborative MK-SVM approach
US11379726B2 (en) Finite rank deep kernel learning for robust time series forecasting and regression
CN112380449B (en) Information recommendation method, model training method and related device
Subramanian et al. Demand modeling in the presence of unobserved lost sales
US20230306505A1 (en) Extending finite rank deep kernel learning to forecasting over long time horizons
Chen et al. Multivariate arrival times with recurrent neural networks for personalized demand forecasting
US20210224351A1 (en) Method and system for optimizing an objective having discrete constraints
CN115099842A (en) Commodity sales prediction model, construction method and application thereof
Clausen et al. Big data driven order-up-to level model: Application of machine learning
Yang et al. Examining multi-category cross purchases models with increasing dataset scale–An artificial neural network approach
CA3059932A1 (en) Method and system for individual demand forecasting
CA3059904A1 (en) Method and system for generating aspects associated with a future event for a subject
Berardi et al. A principled approach for building and evaluating neural network classification models
WO2021077227A1 (en) Method and system for generating aspects associated with a future event for a subject
CN111177657B (en) Demand determining method, system, electronic device and storage medium
CN114429367A (en) Anomaly detection method, device, computer equipment and storage medium
US20210125031A1 (en) Method and system for generating aspects associated with a future event for a subject

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20880268

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20880268

Country of ref document: EP

Kind code of ref document: A1