Today's sedentary life leads to a plethora of lifestyle-related illnesses. This has led to the quest to predict diseases before they occur. In the past, research on stress prediction was carried out conventionally in a laboratory-based environment. However, recent studies are focusing on developing noninvasive ways to predict stress with the help of wearable devices. Generally, the models developed for stress prediction do not provide accurate results because the stress patterns are highly subjective and vary from person to person. Therefore, person-dependent models may achieve higher accuracies. These models, however, have to be trained with collected data over a comparatively longer period of time. In this paper, an Adaptive Neuro-Fuzzy Inference System aided Fire Works Grey Wolf Optimization (ANFIS-FWGWO) classification algorithm has been proposed for stress prediction. In particular, the proposed machine learning framework has been implemented to predict computer users' stress by using a sensor-integrated keyboard data. Various physiological parametric data were acquired during two different phases for the experimentation, and the received data was analyzed using an efficient machine learning framework. Specifically, the proposed framework encompasses various techniques such as data preprocessing for data smoothing and the Least Absolute Shrinkage and Selection Operator (LASSO) feature selection algorithm for identifying the important features on the data set. From the experimental analysis, it is concluded that the ANFIS-FWGWO classification algorithm discriminates the stress subjects with a high degree of accuracy when compared with existing classification algorithms.