Shafeek Saleem commited on
Commit
086dd3b
1 Parent(s): b576f65
Files changed (2) hide show
  1. assets/quiz.json +24 -74
  2. pages/3_Training the Model.py +10 -10
assets/quiz.json CHANGED
@@ -1,92 +1,42 @@
1
  [
2
  {
3
- "question": "Which of the following best describes emotion detection?",
4
- "options": [
5
- "Teaching computers to understand human emotions",
6
- "Teaching humans to understand computer languages",
7
- "Teaching computers to create video games",
8
- "Teaching humans to recognize facial features"
9
- ],
10
- "answer": "Teaching computers to understand human emotions"
11
  },
12
  {
13
- "question": "What programming language is commonly used in developing emotion detection applications?",
14
- "options": [
15
- "Python",
16
- "Java",
17
- "C++",
18
- "Ruby"
19
- ],
20
- "answer": "Python"
21
  },
22
  {
23
- "question": "What is the purpose of OpenCV in an emotion detection application?",
24
- "options": [
25
- "To analyze and manipulate images and videos",
26
- "To recognize and understand human emotions",
27
- "To create graphical user interfaces",
28
- "To generate statistical reports"
29
- ],
30
- "answer": "To analyze and manipulate images and videos"
31
  },
32
  {
33
- "question": "Why is it important to have a diverse dataset when training an emotion detection model?",
34
- "options": [
35
- "It helps the model better understand different facial expressions",
36
- "It improves the performance of the computer's processor",
37
- "It makes the application run faster",
38
- "It reduces the training time for the model"
39
- ],
40
- "answer": "It helps the model better understand different facial expressions"
41
  },
42
  {
43
- "question": "What is the final step after training the model in an emotion detection application?",
44
- "options": [
45
- "Collect more data for training",
46
- "Test the model's accuracy and performance",
47
- "Install additional software plugins",
48
- "Optimize the application's user interface"
49
- ],
50
- "answer": "Test the model's accuracy and performance"
51
  },
52
  {
53
- "question": "How does the inference process work in an emotion detection application?",
54
- "options": [
55
- "It analyzes facial features and predicts the associated emotion",
56
- "It collects user feedback and improves the model's accuracy",
57
- "It converts emotions into numerical values for analysis",
58
- "It adjusts the application's settings based on user preferences"
59
- ],
60
- "answer": "It analyzes facial features and predicts the associated emotion"
61
  },
62
  {
63
- "question": "What is an example of a real-world application of emotion detection technology?",
64
- "options": [
65
- "Virtual reality gaming",
66
- "Weather forecasting",
67
- "Online shopping",
68
- "Recipe suggestions"
69
- ],
70
- "answer": "Virtual reality gaming"
71
  },
72
  {
73
- "question": "What is the importance of ethical considerations in emotion detection applications?",
74
- "options": [
75
- "Ensuring privacy and consent when collecting data",
76
- "Optimizing the application's performance",
77
- "Reducing the complexity of the model",
78
- "Enhancing the visual appearance of the application"
79
- ],
80
- "answer": "Ensuring privacy and consent when collecting data"
81
- },
82
- {
83
- "question": "What can students do to further explore and improve their emotion detection application?",
84
- "options": [
85
- "Experiment with different image preprocessing techniques",
86
- "Rewrite the entire code from scratch",
87
- "Avoid using real-time video feeds for testing",
88
- "Skip the testing phase and move directly to deployment"
89
- ],
90
- "answer": "Experiment with different image preprocessing techniques"
91
  }
92
  ]
 
1
  [
2
  {
3
+ "question": "Which machine learning technique is commonly used for weather forecasting due to its ability to handle time series data efficiently?",
4
+ "options": ["Support Vector Machines (SVM)", "Decision Trees", "Random Forests", "Recurrent Neural Networks (RNN)"],
5
+ "answer": "Recurrent Neural Networks (RNN)"
 
 
 
 
 
6
  },
7
  {
8
+ "question": "What type of weather data is typically used as input for machine learning models in weather forecasting?",
9
+ "options": ["Historical weather data", "Stock market data", "Social media posts", "Traffic congestion data"],
10
+ "answer": "Historical weather data"
 
 
 
 
 
11
  },
12
  {
13
+ "question": "Which evaluation metric is commonly used to assess the performance of weather forecasting models, particularly for numerical predictions like temperature or precipitation?",
14
+ "options": ["Accuracy", "F1 score", "Mean Absolute Error (MAE)", "Precision"],
15
+ "answer": "Mean Absolute Error (MAE)"
 
 
 
 
 
16
  },
17
  {
18
+ "question": "In weather forecasting, what is the process of combining predictions from multiple models to improve overall accuracy and performance called?",
19
+ "options": ["Ensemble learning", "Feature engineering", "Gradient boosting", "Reinforcement learning"],
20
+ "answer": "Ensemble learning"
 
 
 
 
 
21
  },
22
  {
23
+ "question": "Which data visualization technique is often used to display the relationship between weather variables, such as temperature and humidity, over a specific period?",
24
+ "options": ["Bar chart", "Scatter plot", "Pie chart", "Line graph"],
25
+ "answer": "Line graph"
 
 
 
 
 
26
  },
27
  {
28
+ "question": "What is the primary advantage of using deep learning models, such as Convolutional Neural Networks (CNN), for weather forecasting?",
29
+ "options": ["They require less computational power.", "They don't require historical weather data.", "They can automatically extract relevant features from raw data.", "They are not affected by missing data."],
30
+ "answer": "They can automatically extract relevant features from raw data."
 
 
 
 
 
31
  },
32
  {
33
+ "question": "Which step of the weather forecasting process involves gathering and processing data from various sources to initialize the models?",
34
+ "options": ["Post-processing", "Model evaluation", "Data assimilation", "Feature selection"],
35
+ "answer": "Data assimilation"
 
 
 
 
 
36
  },
37
  {
38
+ "question": "Which machine learning algorithm is well-suited for short-term weather predictions, such as the next few hours or days?",
39
+ "options": ["K-Nearest Neighbors (KNN)", "Long Short-Term Memory (LSTM) networks", "Naive Bayes", "Principal Component Analysis (PCA)"],
40
+ "answer": "Long Short-Term Memory (LSTM) networks"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  }
42
  ]
pages/3_Training the Model.py CHANGED
@@ -53,8 +53,8 @@ def create_model_inputs(data, lag, mean_period):
53
 
54
 
55
  def show_output(y_test, y_pred):
56
- st.sidebar.subheader("Model Performance")
57
- st.sidebar.write(f"Test R2 score: {r2_score(y_test, y_pred):.2f}")
58
 
59
  fig, axs = plt.subplots(3, figsize=(12, 18))
60
  axs[0].plot(y_test.index, y_pred/1000, label='Predicted')
@@ -186,14 +186,14 @@ def step3_page():
186
  my_bar.progress(100, text="Training completed")
187
  state = "model predict"
188
  st.success("Model training successfully completed!")
189
-
190
- # Display feature importance
191
- if st.checkbox('Show feature importance'):
192
- feature_names = ['Solar_Irradiance', 'Temperature', 'Rain_Fall', 'Wind_speed', 'PV_Output_lag',
193
- 'PV_Output_mean']
194
- fig = feature_importance_plot(model, feature_names)
195
- with _lock:
196
- st.pyplot(fig)
197
 
198
  if state == "model predict":
199
  st.subheader("Step 5: Model Evaluation")
 
53
 
54
 
55
  def show_output(y_test, y_pred):
56
+ st.subheader("Model Performance")
57
+ st.write(f"Test R2 score: {r2_score(y_test, y_pred):.2f}")
58
 
59
  fig, axs = plt.subplots(3, figsize=(12, 18))
60
  axs[0].plot(y_test.index, y_pred/1000, label='Predicted')
 
186
  my_bar.progress(100, text="Training completed")
187
  state = "model predict"
188
  st.success("Model training successfully completed!")
189
+ #
190
+ # # Display feature importance
191
+ # if st.checkbox('Show feature importance'):
192
+ # feature_names = ['Solar_Irradiance', 'Temperature', 'Rain_Fall', 'Wind_speed', 'PV_Output_lag',
193
+ # 'PV_Output_mean']
194
+ # fig = feature_importance_plot(model, feature_names)
195
+ # with _lock:
196
+ # st.pyplot(fig)
197
 
198
  if state == "model predict":
199
  st.subheader("Step 5: Model Evaluation")