Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -227,6 +227,7 @@ def input_important_features(semester_label, default_values=None):
|
|
| 227 |
data = []
|
| 228 |
semesters = ["HỌC KỲ I", "HỌC KỲ II", "HỌC KỲ III", "HỌC KỲ IV", "HỌC KỲ V", "HỌC KỲ VI"]
|
| 229 |
|
|
|
|
| 230 |
if model_type == "Dùng toàn bộ dữ liệu":
|
| 231 |
st.subheader("🔢 Nhập thông tin học kỳ chi tiết")
|
| 232 |
for idx, sem in enumerate(semesters):
|
|
@@ -235,8 +236,16 @@ if model_type == "Dùng toàn bộ dữ liệu":
|
|
| 235 |
data += input_semester(sem, default_values)
|
| 236 |
nganh = 0 if major == "Công nghệ thông tin" else 1
|
| 237 |
final_features = np.array(data + [nganh]).reshape(1, -1)
|
|
|
|
|
|
|
| 238 |
else:
|
| 239 |
st.subheader("✨ Nhập thông tin rút gọn")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 240 |
for idx, sem in enumerate(semesters):
|
| 241 |
example_data = sample_cntt_example_simple if sample_option == "Dùng ví dụ mẫu ngành Công nghệ thông tin" else sample_kinhte_example_simple if sample_option == "Dùng ví dụ mẫu ngành Kinh tế" else None
|
| 242 |
default_values = example_data["semester_data"][idx*9:(idx+1)*9] if example_data else None
|
|
|
|
| 227 |
data = []
|
| 228 |
semesters = ["HỌC KỲ I", "HỌC KỲ II", "HỌC KỲ III", "HỌC KỲ IV", "HỌC KỲ V", "HỌC KỲ VI"]
|
| 229 |
|
| 230 |
+
# Mô hình 1: "Dùng toàn bộ dữ liệu"
|
| 231 |
if model_type == "Dùng toàn bộ dữ liệu":
|
| 232 |
st.subheader("🔢 Nhập thông tin học kỳ chi tiết")
|
| 233 |
for idx, sem in enumerate(semesters):
|
|
|
|
| 236 |
data += input_semester(sem, default_values)
|
| 237 |
nganh = 0 if major == "Công nghệ thông tin" else 1
|
| 238 |
final_features = np.array(data + [nganh]).reshape(1, -1)
|
| 239 |
+
|
| 240 |
+
# Mô hình 2: "Dùng mô hình đơn giản"
|
| 241 |
else:
|
| 242 |
st.subheader("✨ Nhập thông tin rút gọn")
|
| 243 |
+
|
| 244 |
+
# Ensure the example defaults to "Không ví dụ" when model type is 2
|
| 245 |
+
if model_type == "Dùng mô hình đơn giản":
|
| 246 |
+
sample_option = "Không ví dụ" # Set the default example to "Không ví dụ"
|
| 247 |
+
|
| 248 |
+
# Allow selecting an example
|
| 249 |
for idx, sem in enumerate(semesters):
|
| 250 |
example_data = sample_cntt_example_simple if sample_option == "Dùng ví dụ mẫu ngành Công nghệ thông tin" else sample_kinhte_example_simple if sample_option == "Dùng ví dụ mẫu ngành Kinh tế" else None
|
| 251 |
default_values = example_data["semester_data"][idx*9:(idx+1)*9] if example_data else None
|