Abstract It is of paramount importance to enhance medical practices, given how important it is to protect human life. Medical therapy can be accelerated by automating patient prediction using machine learning techniques. To double the efficiency of classifiers, several preprocessing strategies must be adopted for their crucial duty in this field. Feature Selection (FS) is one tool that has been used frequently to modify data and enhance classification outcomes by lowering the dimensionality of datasets. Excluded features are those that have a poor correlation coefficient with the label class, i.e., they have no meaningful correlation with classification and do not indicate where the instance belongs. Along with the recurring features, which show a strong association with the remainder of the features. Contrarily, the model being produced during training is harmed, and the classifier is misled by their presence. This causes overfitting and increases algorithm complexity and processing time. The pattern is made clearer by FS, which also creates a broader classification model with a lower chance of overfitting in an acceptable amount of time and algorithmic complexity. To optimize the FS process, building wrappers must employ metaheuristic algorithms as search algorithms. The best solution, which reflects the best subset of features within a particular medical dataset that aids in patient diagnosis, is sought in this study using the Snake Optimizer (SO). The swarm-based approaches that SO is founded on have left it with several general flaws, like local minimum trapping, early convergence, uneven exploration and exploitation, and early convergence. By employing the cosine function to calculate the separation between the present solution and the ideal solution, the logarithm operator was paired with SO to better the exploitation process and get over these restrictions. In order to get the best overall answer, this forces the solutions to spiral downward. Additionally, SO is employed to put the evolutionary algorithms’ preservation of the best premise into practice. This is accomplished by utilizing three alternative selection systems – tournament, proportional, and linear – to improve the exploration phase. These are used in exploration to allow solutions to be found more thoroughly and in relation to a chosen solution than at random. These are Tournament Logarithmic Snake Optimizer (TLSO), Proportional Logarithmic Snake Optimizer, and Linear Order Logarithmic Snake Optimizer. A number of 22 reference medical datasets were used in experiments. The findings indicate that, among 86% of the datasets, TLSO attained the best accuracy, and among 82% of the datasets, the best feature reduction. In terms of the standard deviation, the TLSO also attained noteworthy reliability and stability. On the basis of running duration, it is, nonetheless, quite effective.