Mykes commited on
Commit
24eb786
·
verified ·
1 Parent(s): 47075e0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -23
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
- 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
- default_value = current_example.get(feature, float(numeric_defaults[feature]))
222
- input_data[feature] = st.number_input(
223
- f'{feature}',
224
- value=default_value,
225
- format="%.2f",
226
- help=f"Среднее: {numeric_defaults[feature]:.2f}"
227
- )
228
- with col2:
229
- if i + 1 < len(numeric_features):
230
- feature = numeric_features[i + 1]
231
- default_value = current_example.get(feature, float(numeric_defaults[feature]))
232
- input_data[feature] = st.number_input(
233
- f'{feature}',
234
- value=default_value,
235
- format="%.2f",
236
- help=f"Среднее: {numeric_defaults[feature]:.2f}"
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
  # Категориальные признаки