Feedforward Neural Network (FNN) is one of the most popular neural network models that is utilized to solve a wide range of nonlinear and complex problems. Several models such as stochastic gradient descent have been developed to train FNNs. However, they mainly suffer from falling into local optima leading to reduce the accuracy of FNNs. Moreover, the convergence speed of training process depends on the initial values of weights and biases in FNNs. Generally, these values are randomly determined by most of the training models. To deal with these issues, in this paper, we develop a novel evolutionary algorithm by modifying the original version of Whale Optimization Algorithm (WOA). To this end, a nonlinear function is introduced to improve the exploration and exploitation phases in the search process of WOA. Then, the modified WOA is applied to automatically obtain the initial values of weights and biases in FNN leading to reduce the probability of falling into local optima. In addition, the FNN model trained by the modified WOA is used to develop a classification approach for medical diagnosis problems. Ten medical diagnosis datasets are utilized to evaluate the efficiency of the proposed method. Also, four evaluation metrics including accuracy, AUC, specificity, and sensitivity are used in the experiments to compare the performance of classification models. The experimental results demonstrate that the proposed method is better than other competing classification models due to achieving higher values of accuracy, AUC, specificity, and sensitivity metricsfor the used datasets.