Machine learning methods to predict the risk of epilepsy, including vascular epilepsy, in oncohematological patients are currently considered promising. These methods are used in research to predict pharmacoresistant epilepsy and surgical treatment outcomes in order to determine the epileptogenic zone and functional neural systems in patients with epilepsy, as well as to develop new approaches to classification and perform other tasks. This paper presents the results of applying machine learning to analyzing data and developing diagnostic models of epilepsy in oncohematological and cardiovascular patients. This study contributes to solving the problem of often unjustified diagnosis of primary epilepsy in patients with oncohematological or cardiovascular pathology, prescribing antiseizure drugs to patients with single seizure syndromes without finding a disease associated with these cases. We analyzed the hospital database of the V.A. Almazov Scientific Research Center of the Ministry of Health of Russia. The study included 66,723 treatment episodes of patients with vascular diseases (I10–I15, I61–I69, I20–I25) and 16,383 episodes with malignant neoplasms of lymphoid, hematopoietic, and related tissues (C81–C96 according to ICD-10) for the period from 2010 to 2020. Data analysis and model calculations indicate that the best result was shown by gradient boosting with mean accuracy cross-validation score = 0.96. f1-score = 98, weighted avg precision = 93, recall = 96, f1-score = 94. The highest correlation coefficient for G40 and different clinical conditions was achieved with fibrillation, hypertension, stenosis or occlusion of the precerebral arteries (0.16), cerebral sinus thrombosis (0.089), arterial hypertension (0.17), age (0.03), non-traumatic intracranial hemorrhage (0.07), atrial fibrillation (0.05), delta absolute neutrophil count (0.05), platelet count at discharge (0.04), transfusion volume for stem cell transplantation (0.023). From the clinical point of view, the identified differences in the importance of predictors in a broader patient model are consistent with a practical algorithm for organic brain damage. Atrial fibrillation is one of the leading factors in the development of both ischemic and hemorrhagic strokes. At the same time, brain infarction can be accompanied both by the development of epileptic seizures in the acute period and by unprovoked epileptic seizures and development of epilepsy in the early recovery and in a longer period. In addition, a microembolism of the left heart chambers can lead to multiple microfocal lesions of the brain, which is one of the pathogenetic aspects of epilepsy in elderly patients. The presence of precordial fibrillation requires anticoagulant therapy, the use of which increases the risk of both spontaneous and traumatic intracranial hemorrhage.