Mental health is a major concern for all classes of people, but especially physicians in the present world. A challenging task is to identify the significant risk factors that are responsible for depression among physicians. To address this issue, the study aimed to build a machine learning-based predictive model that will be capable of predicting depression levels and finding associated risk factors. A raw dataset was collected to conduct this study and preprocessed as necessary. Then, the dataset was divided into 10 sub-datasets to determine the best possible set of attributes to predict depression. Seven different classification algorithms, KNN, DT, LGBM, GB, RF, ETC, and StackDPP, were applied to all the sub-datasets. StackDPP is a stacking-based ensemble classifier, which is proposed in this study. It was found that StackDPP outperformed on all the datasets. The findings indicate that the StackDPP with the sub-dataset with all the attributes gained the highest accuracy (0.962581), and the top 20 attributes were enough to gain 0.96129 accuracy by StackDPP, which was close to the performance of the dataset with all the attributes. In addition, risk factors were analyzed in this study to reveal the most significant risk factors that are responsible for depression among physicians. The findings of the study indicate that the proposed model is highly capable of predicting the level of depression, along with finding the most significant risk factors. The study will enable mental health professionals and psychiatrists to decide on treatment and therapy for physicians by analyzing the depression level and finding the most significant risk factors.