Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -212,29 +212,33 @@ with st.sidebar:
|
|
212 |
current_example = st.session_state.get('current_example', {})
|
213 |
|
214 |
with tab1:
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
|
|
|
|
|
|
|
|
238 |
|
239 |
with tab2:
|
240 |
# Категориальные признаки
|
|
|
212 |
current_example = st.session_state.get('current_example', {})
|
213 |
|
214 |
with tab1:
|
215 |
+
# Числовые признаки
|
216 |
+
for i in range(0, len(numeric_features), 2):
|
217 |
+
col1, col2 = st.columns(2)
|
218 |
+
with col1:
|
219 |
+
if i < len(numeric_features):
|
220 |
+
feature = numeric_features[i]
|
221 |
+
# Явно преобразуем значение в float
|
222 |
+
default_value = float(current_example.get(feature, numeric_defaults[feature]))
|
223 |
+
input_data[feature] = st.number_input(
|
224 |
+
f'{feature}',
|
225 |
+
value=default_value,
|
226 |
+
step=0.01, # Добавляем шаг
|
227 |
+
format="%.2f",
|
228 |
+
help=f"Среднее: {float(numeric_defaults[feature]):.2f}"
|
229 |
+
)
|
230 |
+
with col2:
|
231 |
+
if i + 1 < len(numeric_features):
|
232 |
+
feature = numeric_features[i + 1]
|
233 |
+
# Явно преобразуем значение в float
|
234 |
+
default_value = float(current_example.get(feature, numeric_defaults[feature]))
|
235 |
+
input_data[feature] = st.number_input(
|
236 |
+
f'{feature}',
|
237 |
+
value=default_value,
|
238 |
+
step=0.01, # Добавляем шаг
|
239 |
+
format="%.2f",
|
240 |
+
help=f"Среднее: {float(numeric_defaults[feature]):.2f}"
|
241 |
+
)
|
242 |
|
243 |
with tab2:
|
244 |
# Категориальные признаки
|