Mykes commited on
Commit
0511d73
·
verified ·
1 Parent(s): 24eb786

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -27
app.py CHANGED
@@ -212,33 +212,33 @@ with st.sidebar:
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
  # Категориальные признаки
 
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
  # Категориальные признаки