A method of building an epilepsy refractoriness prediction model for predicting refractoriness of epilepsy patients comprising: a) providing electronic health records data; b) constructing a patient cohort from the electronic health records data by selecting patients based on failure of at least one anti-epilepsy drug; c) constructing a set of features found in or derived from the electronic health records data, wherein said features include: (i) demographic features representing basic demographics of the patient such as age, gender and the geographic information of the patient; (ii) comorbidity features representing features corresponding to the different comorbidities associated with epilepsy such as migraine, sleep related disorders, disorders and different kinds of mental disorders; (iii) ecosystem and policy features representing factors which affect the care given to patients such as characteristics of the physicians treating the patients; (iv) epilepsy status features representative of the status of epilepsy of patients, including details about patient encounters; (v) treatment features representative of to the treatment regimen and medical procedures undertaken by patients in the observation period; d) electronically processing the patient cohort to identify a subset of the features that are predictive for refractoriness for inclusion in a predictive model configured for classifying patients as refractory or non-refractory, including performing a statistical test on the features to identify which of the features have a statistical significance value within a predetermined range; and e) training the predictive computerized model to classify the patients having at least one anti-epilepsy drug failure based on likelihood of becoming refractory. a) providing electronic health records data; b) constructing a patient cohort from the electronic health records data by selecting patients based on failure of at least one anti-epilepsy drug; c) constructing a set of features found in or derived from the electronic health records data, wherein said features include: (i) demographic features representing basic demographics of the patient such as age, gender and the geographic information of the patient; (ii) comorbidity features representing features corresponding to the different comorbidities associated with epilepsy such as migraine, sleep related disorders, disorders and different kinds of mental disorders; (iii) ecosystem and policy features representing factors which affect the care given to patients such as characteristics of the physicians treating the patients; (iv) epilepsy status features representative of the status of epilepsy of patients, including details about patient encounters; (v) treatment features representative of to the treatment regimen and medical procedures undertaken by patients in the observation period; (i) demographic features representing basic demographics of the patient such as age, gender and the geographic information of the patient; (ii) comorbidity features representing features corresponding to the different comorbidities associated with epilepsy such as migraine, sleep related disorders, disorders and different kinds of mental disorders; (iii) ecosystem and policy features representing factors which affect the care given to patients such as characteristics of the physicians treating the patients; (iv) epilepsy status features representative of the status of epilepsy of patients, including details about patient encounters; (v) treatment features representative of to the treatment regimen and medical procedures undertaken by patients in the observation period; d) electronically processing the patient cohort to identify a subset of the features that are predictive for refractoriness for inclusion in a predictive model configured for classifying patients as refractory or non-refractory, including performing a statistical test on the features to identify which of the features have a statistical significance value within a predetermined range; and e) training the predictive computerized model to classify the patients having at least one anti-epilepsy drug failure based on likelihood of becoming refractory.