Skip to content

Commit

Permalink
Merge pull request #594 from ananyag309/update
Browse files Browse the repository at this point in the history
Add files via upload
  • Loading branch information
UppuluriKalyani authored Oct 26, 2024
2 parents 2be0292 + 3c8e9a3 commit b9b7c0f
Show file tree
Hide file tree
Showing 4 changed files with 3,480 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Prediction Models/stress_level_detect/model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from joblib import load

# Load the trained Random Forest model
model = load('models/stress_level_detect/saved_models/random_forest_model.joblib')

def stress_level_prediction(age, freq_no_purpose, freq_distracted, restless, worry_level, difficulty_concentrating, compare_to_successful_people, feelings_about_comparisons, freq_seeking_validation, freq_feeling_depressed, interest_fluctuation, sleep_issues):
# Feature extraction
features = [
float(age),
int(freq_no_purpose),
int(freq_distracted),
int(restless),
int(worry_level),
int(difficulty_concentrating),
int(compare_to_successful_people),
int(feelings_about_comparisons),
int(freq_seeking_validation),
int(freq_feeling_depressed),
int(interest_fluctuation),
int(sleep_issues)
]

prediction = model.predict([features])[0]

return prediction

Loading

0 comments on commit b9b7c0f

Please sign in to comment.