1. A computer-implemented method of assessing a mental state of a subject, the method comprising: a) receiving, as input, a heartbeat record of the subject, which comprises a sequence of heartbeat data samples obtained over a time span which includes a pre-sleep period, a sleep period having a sleep onset time and a sleep conclusion time, and a post-sleep period; b) identifying, within the heartbeat record, at least the sleep onset time and the sleep conclusion time; c) computing metrics of the subject from the heartbeat record, the metrics including: i) a mean awake heart rate calculated as an average heart rate during the pre-sleep and post-sleep periods; ii) a ratio of a mean awake heart rate and a mean asleep heart rate; iii) a first slope metric indicative of a change over time of the subject's heart rate during a first half of the sleep period; and, iv) a second slope metric indicative of a change over time of the subject's heart rate during a second half of the sleep period; d) accessing a knowledge base which comprises data obtained via expert evaluation of a training set of subjects and which embodies a computational model of a relationship between mental state and said metrics, the computational model comprising data structures representing classification trees obtained by applying a decision tree learning algorithm over said metrics computed by processing heartbeat records of a training set of subjects and the classification trees including: i) a first classification tree data structure that classifies metrics computed from the heartbeat record of the subject into ‘normal’ or ‘not normal’; and ii) a second classification tree data structure that classifies the metrics computed from the heartbeat record of the subject into ‘depressed’ and ‘not depressed; e) applying the metrics of the subject to the computational model to generate an indication of mental state by: i) classifying the subject as ‘normal’ or ‘not normal’ by executing the first classification tree; and ii) in the event that the subject is classified as ‘not normal’, classifying the subject as ‘depressed’ or ‘not depressed’ by executing the second classification tree; and f) providing, as output, the indication of mental state.