snajmark commited on
Commit
3527d4e
·
1 Parent(s): 777df58

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -13
app.py CHANGED
@@ -360,19 +360,18 @@ def predict_inverse(antimicrobial_activity_target, substrate, microorganism, num
360
  df_columns.remove(column)
361
  constrained_columns = ['Substrate', 'Washing_cycles', 'Microorganism ']
362
  for c in test_data_columns:
363
- if c in constrained_columns:
364
- if c.startswith('Substrate'):
365
- if c == substrate:
366
- domain.append({'name': str(c), 'type': 'categorical', 'domain': (1.0, 1.0)})
367
- else:
368
- domain.append({'name': str(c), 'type': 'categorical', 'domain': (0.0, 0.0)})
369
- if c == 'Microorganism ':
370
- if c == microorganism:
371
- domain.append({'name': str(c), 'type': 'categorical', 'domain': (1.0, 1.0)})
372
- else:
373
- domain.append({'name': str(c), 'type': 'categorical', 'domain': (0.0, 0.0)})
374
- if c == 'Washing_cycles':
375
- domain.append({'name': str(c), 'type': 'categorical', 'domain': (int(num_washing_cycles), int(num_washing_cycles))})
376
  else:
377
  if c in numerical_columns:
378
  domain.append({'name': str(c), 'type': 'continuous', 'domain': (0.,1.)})
 
360
  df_columns.remove(column)
361
  constrained_columns = ['Substrate', 'Washing_cycles', 'Microorganism ']
362
  for c in test_data_columns:
363
+ if c.startswith('Substrate'):
364
+ if c == substrate:
365
+ domain.append({'name': str(c), 'type': 'categorical', 'domain': (1.0, 1.0)})
366
+ else:
367
+ domain.append({'name': str(c), 'type': 'categorical', 'domain': (0.0, 0.0)})
368
+ elif c == 'Microorganism ':
369
+ if c == microorganism:
370
+ domain.append({'name': str(c), 'type': 'categorical', 'domain': (1.0, 1.0)})
371
+ else:
372
+ domain.append({'name': str(c), 'type': 'categorical', 'domain': (0.0, 0.0)})
373
+ elif c == 'Washing_cycles':
374
+ domain.append({'name': str(c), 'type': 'categorical', 'domain': (int(num_washing_cycles), int(num_washing_cycles))})
 
375
  else:
376
  if c in numerical_columns:
377
  domain.append({'name': str(c), 'type': 'continuous', 'domain': (0.,1.)})