Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -30,7 +30,7 @@ x_train, x_test, y_train, y_test=train_test_split(x_strength,y_strength, test_si
|
|
| 30 |
|
| 31 |
learner = DecisionTreeRegressor(criterion='friedman_mse', max_depth=3)
|
| 32 |
|
| 33 |
-
|
| 34 |
clf = NGBRegressor (learning_rate= 0.0708, minibatch_frac= 0.6472, n_estimators= 548, Base=learner)
|
| 35 |
clf.fit(x_train, y_train)
|
| 36 |
|
|
@@ -47,7 +47,9 @@ def OPS_LWAC(OPC, SCM_FA, SCM_SF, w_b, FA, CA, OPS, SP, T):
|
|
| 47 |
#value2 = bb[0]
|
| 48 |
#prediction = clf.predict(x.reshape(1, -1))
|
| 49 |
#-3*y_dists.params["scale"]+y_dists.params["loc"]
|
| 50 |
-
|
|
|
|
|
|
|
| 51 |
|
| 52 |
inputs = [
|
| 53 |
gr.inputs.Number(label="cement content (OPC, unit: kg/m3)"),
|
|
@@ -60,7 +62,7 @@ inputs = [
|
|
| 60 |
gr.inputs.Number(label="superplasticizer content (SP, unit: kg/m3)"),
|
| 61 |
gr.inputs.Number(label="curing time (T, unit: d)")
|
| 62 |
]
|
| 63 |
-
outputs = gr.outputs.Textbox(label="Estimated
|
| 64 |
|
| 65 |
app = gr.Interface(fn=OPS_LWAC, inputs=inputs, outputs=outputs, description="Estimation of compressive strength of OPS-based lightweight concrete")
|
| 66 |
app.launch()
|
|
|
|
| 30 |
|
| 31 |
learner = DecisionTreeRegressor(criterion='friedman_mse', max_depth=3)
|
| 32 |
|
| 33 |
+
|
| 34 |
clf = NGBRegressor (learning_rate= 0.0708, minibatch_frac= 0.6472, n_estimators= 548, Base=learner)
|
| 35 |
clf.fit(x_train, y_train)
|
| 36 |
|
|
|
|
| 47 |
#value2 = bb[0]
|
| 48 |
#prediction = clf.predict(x.reshape(1, -1))
|
| 49 |
#-3*y_dists.params["scale"]+y_dists.params["loc"]
|
| 50 |
+
result_string = "[CS: {:.2f}; σ: {:.2f}]".format(aa, bb)
|
| 51 |
+
return result_string
|
| 52 |
+
#return [aa, bb]
|
| 53 |
|
| 54 |
inputs = [
|
| 55 |
gr.inputs.Number(label="cement content (OPC, unit: kg/m3)"),
|
|
|
|
| 62 |
gr.inputs.Number(label="superplasticizer content (SP, unit: kg/m3)"),
|
| 63 |
gr.inputs.Number(label="curing time (T, unit: d)")
|
| 64 |
]
|
| 65 |
+
outputs = gr.outputs.Textbox(label="Estimated mean prediction and σ value (unit: MPa)")
|
| 66 |
|
| 67 |
app = gr.Interface(fn=OPS_LWAC, inputs=inputs, outputs=outputs, description="Estimation of compressive strength of OPS-based lightweight concrete")
|
| 68 |
app.launch()
|