Diagnosing depression and anxiety involves various methods, including referenda-based approaches that may lack accuracy. However, machine learning has emerged as a promising approach to address these limitations and improve diagnostic accuracy. In this scientific paper, we present a study that utilizes a digital dataset to apply machine learning techniques for diagnosing psychological disorders. The study employs numerical, striatum, and mathematical analytic methodologies to extract dataset features. The Recursive Feature Elimination (RFE) algorithm is used for feature selection, and several classification algorithms, including SVM, decision tree, random forest, logistic regression, and XGBoost, are evaluated to identify the most effective technique for the proposed methodology. The dataset consists of 783 samples from patients with depression and anxiety, which are used to test the proposed strategies. The classification results are evaluated using performance metrics such as accuracy (AC), precision (PR), recall (RE), and F1-score (F1). The objective of this study is to identify the best algorithm based on these metrics, aiming to achieve optimal classification of depression and anxiety disorders. The results obtained will be further enhanced by modifying the dataset and exploring additional machine learning algorithms. This research significantly contributes to the field of mental health diagnosis by leveraging machine learning techniques to enhance the accuracy and effectiveness of diagnosing depression and anxiety disorders.