Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -134,7 +134,15 @@ def predict_from_tuple(in1, in2, in3, in4, in5, request: gr.Request):
|
|
134 |
one_hot = utils.turn_into_one_hot(input_df, input_mapping)
|
135 |
print("One hot columns are ", one_hot.columns)
|
136 |
return predict(one_hot, request)
|
137 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
|
139 |
def predict_inverse(target_hardness, target_yield_strength, request: gr.Request):
|
140 |
|
|
|
134 |
one_hot = utils.turn_into_one_hot(input_df, input_mapping)
|
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))
|
143 |
+
print(predictions, hardness_target, ys_target, error_hardness, error_ys)
|
144 |
+
return error_hardness + error_ys
|
145 |
+
|
146 |
|
147 |
def predict_inverse(target_hardness, target_yield_strength, request: gr.Request):
|
148 |
|