Deep Lifetime Clustering

1 INTRODUCTION . Survival analysis is widely used to model the relationship between subject covariates and the time until a particular terminal event of interest ( e.g. , death , or quitting of social media ) that marks the end of all activities ( or measurements ) of that subject ( known as the lifetime of the subject ) . For instance , a subject ’ s logins to a social network are her activities and the time until she quits the social network permanently is her lifetime . The lifetime of a subject can be unobserved for two possible reasons : ( a ) the terminal event was right-censored , i.e. , the subject did not have a terminal event within the finite data-collection period , or ( b ) the terminal events are inherently unobservable . Right-censoring happens for instance when a patient is still alive at the time of data-collection . Unobservability happens for instance , in social networks , when a subject simply stops using the service but does not provide a clear termination signal by deleting her account . In such a scenario , the terminal events remain unobserved for most if not all subjects , even if the subjects quit the service within the data-collection period . Numerous survival methods have been proposed ( Witten and Tibshirani , 2010a ; Hothorn et al. , 2006 ; Ishwaran et al. , 2008 ) to predict the lifetime of a subject given her covariates and her activities/measurements for a brief initial period of time , while also accounting for right-censoring . More recent deep learning models for lifetime prediction ( Lee et al. , 2018 ; Ren et al. , 2018 ; Chapfuwa et al. , 2018 ) have achieved much success due to their flexibility to model complex relationships , and by avoiding limiting assumptions like parametric lifetime distributions ( Ranganath et al. , 2016 ) and proportional hazards ( Katzman et al. , 2018 ) . In scenarios where terminal events are never observed ( unobservability ) , it is a standard practice to introduce artificial termination signals through a predefined “ timeout ” for the period of inactivity , i.e. , a social network user inactive for m months has her last observed activity declared a terminal event . Such a specification is typically arbitrary and can adversely affect the analysis depending on the “ timeout ” value used . Notwithstanding the fact that lifetimes are hard to predict without termination signals in the training data , we are generally interested in clustering subjects based on their underlying lifetime distribution to improve decision-making . Applications include identifying disease subtypes ( Gan et al. , 2018 ) , understanding the implications of distinct manufacturing processes on machine parts , and qualitatively analyzing different survival groups in a social network . Although accurately predicting time-toterminal-event for an individual is important in a variety of applications , lifetime clustering plays a complementary role and provides a more holistic picture . Lifetime clustering remains a relatively unexplored topic despite being an important tool . Although traditional unsupervised clustering methods such as k-means and hierarchical clustering are popular for this task ( Bhattacharjee et al. , 2001 ; Sørlie et al. , 2001 ; Bullinger et al. , 2004 ) , they may produce clusters that are entirely uncorrelated with lifetimes ( Gaynor and Bair , 2013 ) . Semi-supervised clustering ( Bair and Tibshirani , 2004 ) and supervised sparse clustering ( Witten and Tibshirani , 2010b ) employ a two-stage lifetime clustering process : ( i ) identify covariates associated with lifetime using Cox scores ( Cox , 1992 ) , and ( ii ) treat these covariates differently while performing k-means clustering . They assume proportional hazards ( i.e. , constant hazard ratios over time ) and require the presence of termination signals . Furthermore , a decoupled two-stage process such as the above is not guaranteed to obtain clusters with maximally distinct lifetime distributions ; rather , we require an end-to-end learning framework that prescribes a loss function specifically over the lifetime distributions of different clusters . In this work we tackle the important task of inductive lifetime clustering without assuming proportional hazards , while also smoothly handling the unobservability of termination signals . Contributions . ( i ) We introduce DeepCLife , an inductive neural-network based lifetime clustering model that finds cluster assignments by maximizing the divergence between empirical ( nonparametric ) lifetime distributions of different clusters . Whereas the subjects of different clusters have distinct lifetime distributions , within a cluster all subjects share the same lifetime distribution even if they have different lifetimes . Our model is robust to the modeling issues associated with the unobservability of termination signals and does not assume proportional hazards . ( ii ) We define a novel clustering loss function over empirical lifetime distributions ( of entire clusters ) based on the Kuiper two-sample test . We provide a tight upper bound of the Kuiper p-value with easy-to-compute gradients facilitating its use as a loss function , which until now was prohibitively expensive due to the test ’ s infinite sum . ( iii ) Finally , our results on real and synthetic datasets show that the proposed lifetime clustering approach produces significantly better clusters with distinct lifetime distributions ( as evaluated by Logrank score , C-index , Brier Score and Rand index ) as compared to competing approaches . 2 FORMAL FRAMEWORK . In this section , we formally define the statistical framework underlying the clustering approach introduced later in the paper . Notation remark : We use superscript ( u ) to refer to variables indexed by a subject u and use subscript k to refer to random variables indexed by a random subject of cluster k. See Table 1 for a complete list of all the variables and their meanings . We assume that there are distinct underlying clusters with different event processes describing the activity events of a random subject ( e.g. , logins to a social network , measurements of a patient ) in the respective clusters . To make these notions more formal , we introduce our event process . Definition 1 ( Abstract Event Process ) . Consider the k-th cluster . The Random Marked Point Process ( RMPP ) for the activity events is Φk = { Xk , { ( Ak , i , Mk , i , Yk , i ) } i∈N , Θk } over discrete times t = 0 , 1 , . . . , where Xk is the random variable representing the covariates of a random subject in cluster k , Θk is the time to the zeroth activity event ( joining ) , Mk , i represent covariates of event i , Yk , i is the inter-event time between the i-th and the ( i − 1 ) -st activity events ( e.g. , logins ) , and Ak , i = 1 indicates an event with a termination signal ( death ) , otherwiseAk , i = 0 . All these variables may be arbitrarily dependent . This definition is model-free , i.e. , we will not prescribe a model for Φk . We observe the RMPP over a time window [ 0 , tm ] . Using the above formalism , we define the true lifetime of a subject in cluster k as the sum of all inter-event times until termination signal Ak , i = 1 is observed . Definition 2 ( True lifetime ) . The random variable that defines the true lifetime until the terminal event of a subject in cluster k is Tk : = maxi ( ∑ i′≤i Yk , i′ ∏ i′′ < i ( 1−Ak , i′′ ) ) . The true lifetime Tk is unobserved if : ( a ) the terminal event Ak , i = 1 does not occur within the observation time period [ 0 , tm ] , or ( b ) the termination signals are inherently unobservable . Now , the true lifetime distribution of a subject in cluster k is defined as the probability that the subject has at least one more activity event after time t , and is given by Sk ( t ) : = P [ Tk > t ] = 1− Fk ( t ) , t ∈ N∪ { 0 } , where Fk ( t ) is the underlying cumulative distribution function ( CDF ) of Tk . Note again that all the subjects of a cluster share the same lifetime distribution . Training data . Our training data D consists of subjects from K underlying ( hidden ) clusters with distinct lifetime distributions Sk for k ∈ { 1 , . . . , K } . For a subject u ∈ D , we observe the following quantities { X ( u ) , { ( M ( u ) i , Y ( u ) i ) } Q ( u ) ( tm ) i=1 , Θ ( u ) } , where X ( u ) , Y ( u ) i , M ( u ) i and Θ ( u ) are analogously defined as in Definition 1 , but for a given subject u. Q ( u ) ( t ) is the number of observed activity events of u after her joining and before time t. The training data may or may not contain the termination signals , { A ( u ) i } Q ( u ) ( tm ) i=1 , where A ( u ) i = 1 indicates that event i was a terminal event for subject u ( e.g. , death ) . Termination signals are typically available in healthcare applications , whereas in the case of social networks , we usually do not observe the termination signal ( i.e. , account deletion ) for any subject . We define the observed lifetime of a subject u as H ( u ) : = ∑Q ( u ) ( tm ) i=1 Y ( u ) i , i.e. , the sum of all the inter-event times within the observation period [ 0 , tm ] . In the absence of termination signals , we additionally define inactive period as the time elapsed since the last observed event of subject u , given by χ ( u ) : = tm −Θ ( u ) −H ( u ) . We use H ( u ) and χ ( u ) only during training . Figure 1 shows the true lifetime , the observed lifetime , and the inactive period for four users of two different clusters in the training data . The events are observed ( denoted by solid circles ) only till the time of measurement tm , whereas the rest of the events are right-censored ( denoted by solid diamonds ) . The termination signal ( denoted by dotted diamonds ) may be unobserved even if it occurs before tm ( eg. , u3 ) . Test data . For a new test subject , we can only observe her covariates and her activity events for a brief initial period of time τ since her joining . Formally , we observe the following quantities { X ( u ) , { ( M ( u ) i , Y ( u ) i ) } Q ( u ) ( Θ ( u ) +τ ) i=1 , Θ ( u ) } . The goal of inductive lifetime clustering is to be able to assign a cluster for a new unseen subject within τ time of her joining . Note that since H ( u ) and χ ( u ) are tied to tm , they can not be computed for test subjects . Lastly , we formally define our clustering problem . Definition 3 ( Clustering problem ) . Consider a dataset D with N subjects . Our goal is to find a mapping κ : ( X ( u ) , { ( M ( u ) i , Y ( u ) i ) } Q ( u ) ( Θ ( u ) +τ ) i=1 ) → { 1 , . . . , K } , that inductively maps subject covariates and observed activity events for a brief initial period of time τ into clusters , such that the divergence ∆ between the empirical lifetime distributions of these clusters is maximized , i.e. , κ ? = arg max κ∈K min i , j∈ { 1 ... K } , i 6=j ∆ ( Ŝi ( κ ) , Ŝj ( κ ) ) , ( 1 ) where K is a set of all mappings , Ŝk ( κ ) is the empirical lifetime distribution of subjects in D mapped to cluster k through κ , and ∆ is an empirical distribution divergence measure . κ∗ optimized in this fashion guarantees that subjects in different clusters have different lifetime distributions 1 . 1See Appendix A.5 for why we wish to maximize the minimum divergence across all pairs instead of the sum of divergences across all pairs .

Summary: This paper proposes a deep learning method for clustering subjects (patients, users of social networks) into clusters of different lifetime (survival time) distributions. Inputs for a subject include covariates (age, gender, etc) and an event sequence. A key difficulty in the problem is that the lifetime of a subject is often unobserved. The proposed method is to learn a termination function that is non-decreasing with time, which essentially treats prolonged inactivity as termination in a probabilistic way. Clustering is done in a discriminative manner where the objective function considers cluster sizes besides between-cluster differences in lifetime distribution. (The inclusion of cluster size information in the objective function avoids degenerate clustering results.)