snajmark commited on
Commit
9d46951
·
1 Parent(s): 3b59191

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -359,6 +359,7 @@ def predict_inverse(antimicrobial_activity_target, substrate, microorganism, num
359
  for column in targets:
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:
@@ -372,15 +373,14 @@ def predict_inverse(antimicrobial_activity_target, substrate, microorganism, num
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
- for df_column in df_columns:
377
- if df_column.startswith('Substrate') or df_column.startswith('Washing_cycles') or df_column.startswith('Microorganism'):
378
- continue
379
- if df_column in numerical_columns:
380
- domain.append({'name': str(c), 'type': 'continuous', 'domain': (0.,1.)})
381
- else:
382
- domain.append({'name': str(df_column), 'type': 'categorical', 'domain': (0,1),
383
- 'dimensionality': dimensionality_dict[df_column]})
384
  print("Domain is ", domain)
385
  print(len(domain))
386
 
 
359
  for column in targets:
360
  df_columns.remove(column)
361
  constrained_columns = ['Substrate', 'Washing_cycles', 'Microorganism ']
362
+ ### Add input constraints
363
  for c in test_data_columns:
364
  if c.startswith('Substrate'):
365
  if c == substrate:
 
373
  domain.append({'name': str(c), 'type': 'categorical', 'domain': (0.0, 0.0)})
374
  elif c == 'Washing_cycles':
375
  domain.append({'name': str(c), 'type': 'categorical', 'domain': (int(num_washing_cycles), int(num_washing_cycles))})
376
+ for df_column in df_columns:
377
+ if df_column.startswith('Substrate') or df_column.startswith('Washing_cycles') or df_column.startswith('Microorganism'):
378
+ continue
379
+ if df_column in numerical_columns:
380
+ domain.append({'name': str(df_column), 'type': 'continuous', 'domain': (0.,1.)})
381
  else:
382
+ domain.append({'name': str(df_column), 'type': 'categorical', 'domain': (0,1),
383
+ 'dimensionality': dimensionality_dict[df_column]})
 
 
 
 
 
 
384
  print("Domain is ", domain)
385
  print(len(domain))
386