Views
No views yet
1import joblib
2import pandas as pd
3
4# Load the model
5model = joblib.load('LS-W4-Mini-RF_Addiction_Impact.joblib')
6
7# Example of new data to predict on
8new_data = pd.DataFrame({
9 'Gender': ['Female'],
10 'Academic_Level': ['Undergraduate'],
11 'Most_Used_Platform': ['Instagram'],
12 'Relationship_Status': ['Single'],
13 'Age': [20],
14 'Avg_Daily_Usage_Hours': [5.0],
15 'Sleep_Hours_Per_Night': [6],
16 'Mental_Health_Score': [7],
17 'Addicted_Score': [8],
18 'Conflicts_Over_Social_Media': [0]
19})
20
21# Make a prediction
22prediction = model.predict(new_data)
23print("Prediction (1 = Yes, 0 = No):", prediction)
24RandomForestClassifierColumnTransformer for one-hot encoding categorical features and the RandomForestClassifier itself.n_estimators=100, random_state=42.