snajmark commited on
Commit
f013f1a
·
1 Parent(s): 9fc2fc5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -139,7 +139,7 @@ def predict_inverse(hardness_original_target, ys_original_target, metals_to_use,
139
  for c in one_hot_columns:
140
  if c in continuous_variables:
141
  if c.startswith("PROPERTY: Metal") and c not in metals_to_use:
142
- domain.append({'name': str(c), 'type': 'continuous', 'domain': (0., 0.)})
143
  else:
144
  domain.append({'name': str(c), 'type': 'continuous', 'domain': (0., 1.)})#(0.,1.)})
145
  else:
@@ -189,8 +189,12 @@ def predict_inverse(hardness_original_target, ys_original_target, metals_to_use,
189
  result[column] = round(result[column], 2)
190
 
191
  columns = list(result.columns)
 
 
 
 
192
  return (result[columns[2:-3]], columns[-3], result.at[0, columns[0]],
193
- result.at[0, columns[1]], columns[-2], columns[-1])
194
 
195
 
196
  example_inputs = [820, 1800, ['Al', 'Fe', 'Ni']]
 
139
  for c in one_hot_columns:
140
  if c in continuous_variables:
141
  if c.startswith("PROPERTY: Metal") and c not in metals_to_use:
142
+ domain.append({'name': str(c), 'type': 'continuous', 'domain': (0.01, 0.)})
143
  else:
144
  domain.append({'name': str(c), 'type': 'continuous', 'domain': (0., 1.)})#(0.,1.)})
145
  else:
 
189
  result[column] = round(result[column], 2)
190
 
191
  columns = list(result.columns)
192
+ optimal_processing = columns[-2]
193
+ if optimal_processing == 'OTHER':
194
+ return 'CAST'
195
+
196
  return (result[columns[2:-3]], columns[-3], result.at[0, columns[0]],
197
+ result.at[0, columns[1]], optimal_processing, columns[-1])
198
 
199
 
200
  example_inputs = [820, 1800, ['Al', 'Fe', 'Ni']]