Batch 20 Mini
Batch 20 Mini
Presented by
M.Teja(218W1A1239)
B.Bhargavi(228W5A1203)
[2] A survey of machine These datasets SVM, PNN, The purpose of this Sophisticated
learning techniques in are used Real Multilayer project is to conduct a techniques of
physiology based mental data, MAHNOB Perceptron (with comprehensive survey on signal processing
stress detection systems - and DEAP. one hidden layer), machine learning are required
2019 SVM (using Pearson techniques in physiology- to extract patterns
Kernel function) based mental stress
detection.
Literature Review
Publication Details Datasets Algorithms Used Purpose Remarks
/ Technologies
Used
[3] Stress Detection stress detection where Support Vector Purpose machine learning Machine learning
Using Machine the data set is Machine, Logistic algorithms for predicting algorithms for
Learning collected from the Regression, stress levels and stress detection
Algorithms(2020) website where collect Random Forest, K- understanding the impact of offer a promising
the statistical data and nearest neighbor stress on individuals' solution for mental
also consider the behavior and health. health issues,
attributes for the requiring
datase interdisciplinary
[4] Mental Stress The dataset was taken Random Forest , aims to correlate the stress Interdisciplinary
Detection in University from the 206 students Naïve- Bayes , levels with the time spent on Collaboration has
Students using of Jaypee Institute of K-Nearest the internet, providing Projects like these
Machine Learning Information Neighbour, insights into the relationship often require
Algorithms – 2019 Technology Noida. Svm. between internet usage and collaboration
mental stress. between experts in
machine learning,
psychology.
Literature Review
Publication Details Datasets Algorithms Used Purpose Remarks
/ Technologies
Used
[5] Stress detection Te dataset to train our Logistic Regression, The paper aims to The "Stress Detection
using natural language ML model for binary Decision Trees, and leverage social media Using Natural
processing sentiment analysis has Random Forest. content and apply Language Processing
and machine learning 100042 tweets.the machine learning and and Machine Learning
over social dataset which we deep learning Over Social
interactions- 2022 utilize possesses three techniques to predict Interactions" project
columns: ‘id’, the emotional state of uses natural language
‘sentiment label’, and users, detect stress, processing and
‘sentiment text’. and analyze social machine learning
issues
Literature Summary
• The literature review explores computer-assisted stress identification in
students, highlighting its impact on academic performance, mental health,
and overall well-being.
• It discusses various technological solutions, such as mobile applications,
wearable devices, and online platforms, and their assessment methods.
• The review also reviews the efficacy of stress management interventions,
including mindfulness-based techniques and biofeedback techniques.
• Challenges include user engagement, privacy concerns, and scalability,
and suggests future research directions for integrating advanced analytics
and artificial intelligence.
Dataset Description
• Dataset Characteristics :Multivariate
• Dataset Type : Comma Separated Values
• Number of Instances : 16151
• Number of Attributes : 10
• Associated task : Classification ( Stress Level )
https://www.kaggle.com/datasets/ydalat/lifestyle-and-wellbeing-data
Requirements
• Jupyter notebook
• Machine learning libraries ( sklearn )
• Front end : HTML, CSS, Javascript
• Backend : Flask
• Visual studio code
Architecture Diagram
Input Data Preprocessing Preprocessed Data
Data cleaning,Label
Survey data
Encoding etc.,
Testing Dataset
Training Dataset
Model
Training
Model
Testing
jModel
Severe Stress Evaluation Machine
Learning
Moderately
Model
Severe Stress Sending Predictions
Moderate Stress to application
SVM:
• Support Vector Machine or SVM is one of the most popular Supervised
Learning algorithms, which is used for Classification as well a Regression
problems.
• SVM aims to find the optimal hyperplane that separates data points into
different classes while maximizing the margin between classes
Random Forest
Input:
Number of classifiers c, which is the total number of decision tree classifiers to be generated.
Training data D, the dataset used for training the classifiers.
Percentage of features to consider x%, The percentage of features randomly selected for each decision tree.
Output: c number of decision tree classifiers that is random forest.
Method:
To generate C classifiers :
for i = 1 to C do
Randomly sample the training data D with replacement to produce Di
Create a root node, Ni containing Di
Call BuildTree(Ni)
end for
BuildTree(Ni):
if N contains instances of only one class, then
return
else
Randomly select x% of the possible features in N
Select the feature F with the highest information gain to split on
Entropy 𝑆 ≡ σ𝑐𝑖=1 −𝑝𝑖 log 2 𝑝𝑖
𝑆𝑣
𝐺𝑎𝑖𝑛 𝑆, 𝐴 ≡ 𝐸𝑛𝑡𝑟𝑜𝑝𝑦 𝑆 − 𝐸𝑛𝑡𝑟𝑜𝑝𝑦 𝑆𝑣
𝑆
𝑣∈ Values 𝐴
Create f child nodes of N, N1, …., Nf , Where F has f possible values (F1, … , Ff)
for i = 1 to f do
Set the contents of Ni to Di is all instances in N that match Fi
Call BuildTree(Ni)
end for
end if
SVM Algorithm:
Input:
- Training dataset (X_train, Y_train)
- Regularization parameter (C)
- Kernel type (linear, polynomial, radial basis function (RBF), etc.)
- Kernel parameters (degree for polynomial kernel, gamma for RBF kernel, etc.)
Output: Trained SVM model
Algorithm:
1. Initialize random weights (w) and bias (b) .
2. Define the kernel function K(x, xi) based on the selected kernel type.
Training:
3. For each training sample (xi, yi) in X_train:
a. Calculate the decision function for sample xi:
f(xi) = w * xi + b
b. Compute the loss L(w, b) using the hinge loss function:
L(w, b) = 1/2 * ||w||^2 + C * Σ(max(0, 1 - yi * f(xi)))
c. Update weights and bias using gradient descent to minimize the loss:
w = w - η * (∂L/∂w + λ * w)
b = b - η * ∂L/∂b
where η is the learning rate and λ is the regularization parameter
4. Repeat steps 3a-3c until convergence or a maximum number of iterations.
Prediction:
5. Given a new test sample x_test:
a. Calculate the decision function for x_test:
f(x_test) = w * x_test + b
b. Predict the class label using the decision function:
if f(x_test) >= 0:
predicted_class = 1
else:
predicted_class = -1
Output:
6. Output the trained SVM model with weights (w) and bias (b).
Implementation Details
Step 1:- Dataset Collection and Preparation:
• Preprocess the dataset by handling missing values, encoding categorical variables
Step 2:- Model Selection:
• Choose appropriate machine learning algorithms for stress level prediction, such as decision trees,
random forests, support vector machines (SVM)
Step 3:- Training-Validation Split:
• Split the dataset into training and validation sets to assess model performance.
Step 4:- Model Evaluation:
• Evaluate the trained models on the validation set using relevant evaluation metrics such as accuracy,
precision, recall, F1-score
Step 5:- Model Integration:
• Trained machine learning model using a library like pickle or joblib to save them as files.
• Integrate the model into the backend of the stress assessment tool using Flask or another web framework.
Results