snajmark commited on
Commit
a588dc7
·
1 Parent(s): 74a631b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -135,8 +135,10 @@ def predict_from_tuple(in1, in2, in3, in4, in5, request: gr.Request):
135
  print("One hot columns are ", one_hot.columns)
136
  return predict(one_hot, request)
137
 
 
 
138
 
139
- def fit_outputs(x, hardness_target, ys_target):
140
  predictions = predict(x)
141
  error_hardness = np.sqrt(np.square(predictions[0]-hardness_target))
142
  error_ys = np.sqrt(np.square(predictions[2]-ys_target))
@@ -144,7 +146,7 @@ def fit_outputs(x, hardness_target, ys_target):
144
  return error_hardness + error_ys
145
 
146
 
147
- def predict_inverse(target_hardness, target_yield_strength, request: gr.Request):
148
 
149
  continuous_variables = ['PROPERTY: Calculated Density (g/cm$^3$)',
150
  'PROPERTY: Calculated Young modulus (GPa)']
 
135
  print("One hot columns are ", one_hot.columns)
136
  return predict(one_hot, request)
137
 
138
+ hardness_target = 1
139
+ ys_target = 2
140
 
141
+ def fit_outputs(x):
142
  predictions = predict(x)
143
  error_hardness = np.sqrt(np.square(predictions[0]-hardness_target))
144
  error_ys = np.sqrt(np.square(predictions[2]-ys_target))
 
146
  return error_hardness + error_ys
147
 
148
 
149
+ def predict_inverse(one_hot, request: gr.Request):
150
 
151
  continuous_variables = ['PROPERTY: Calculated Density (g/cm$^3$)',
152
  'PROPERTY: Calculated Young modulus (GPa)']