A processor implemented method of providing a synthetic rare class dataset adapted to the classification of real-life noisy physiological time series signals comprising: providing a labeled abundant training dataset X + with Π as a cardinality, and labeled rare class training dataset X − with π as a cardinality, and Π>>π, wherein X + = x i + i = 1 π, X − = x i − i = 1 π, where x i +, x i − ∈ R d, wherein the abundant training dataset comprises labeled non-anomalous examples of the time series signals and the rare class training dataset comprises labeled anomalous examples of the time series signals; generating an extended synthetic rare class super dataset X − − − as X − − − = x i − − − i = 1 π + +, using an extended oversampling method that is based on a Markov chain model for stochastically modelling time varying signals, wherein the Markov chain is a stochastic process described by a sequence of states at different times, wherein the probability of each state only depends on the preceding state, wherein the states of the Markov chain are formed from noisy signal instances, including a random noise segment and a motion artifact segment, wherein the random noise segment and the motion artifact segment contribute most and the corresponding probabilities are higher than for other states, wherein the elements of the synthetic class super dataset, Xi − − − each correspond to a sequence of these states, and extracting a subset of the extended synthetic rare class super dataset X − − − to obtain a synthetic rare class dataset X − − by maximizing similarity and diversity in the synthetic rare class dataset X − −, wherein the synthetic rare class dataset X − − is a dataset of rare class time - series signals, wherein maximizing similarity ensures maximizing mutual information and maximizing diversity ensures minimum redundancy in the synthetic rare class dataset X − − such that morphological identity of the synthetic rare class dataset X − − is closely preserved with respect to the labeled rare class training dataset X − while maintaining diversity. providing a labeled abundant training dataset X + with Π as a cardinality, and labeled rare class training dataset X − with π as a cardinality, and Π>>π, wherein X + = x i + i = 1 π, X − = x i − i = 1 π, where x i +, x i − ∈ R d, wherein the abundant training dataset comprises labeled non-anomalous examples of the time series signals and the rare class training dataset comprises labeled anomalous examples of the time series signals; generating an extended synthetic rare class super dataset X − − − as X − − − = x i − − − i = 1 π + +, using an extended oversampling method that is based on a Markov chain model for stochastically modelling time varying signals, wherein the Markov chain is a stochastic process described by a sequence of states at different times, wherein the probability of each state only depends on the preceding state, wherein the states of the Markov chain are formed from noisy signal instances, including a random noise segment and a motion artifact segment, wherein the random noise segment and the motion artifact segment contribute most and the corresponding probabilities are higher than for other states, wherein the elements of the synthetic class super dataset, Xi − − − each correspond to a sequence of these states, and extracting a subset of the extended synthetic rare class super dataset X − − − to obtain a synthetic rare class dataset X − − by maximizing similarity and diversity in the synthetic rare class dataset X − −, wherein the synthetic rare class dataset X − − is a dataset of rare class time - series signals, wherein maximizing similarity ensures maximizing mutual information and maximizing diversity ensures minimum redundancy in the synthetic rare class dataset X − − such that morphological identity of the synthetic rare class dataset X − − is closely preserved with respect to the labeled rare class training dataset X − while maintaining diversity.