Ruijia Tan commited on
Commit
834da3d
1 Parent(s): 834c937

Upload code.

Browse files
Model/saved_model/lr/compressive_strength.pkl DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:550f45334ed9f0e7a21bc7f480f195f18435e9272d3852bf0bfa2df9a9a344ce
3
- size 937
 
 
 
 
Model/saved_model/lr/elongation.pkl DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:e9fe4f2045e678c286b66e7271a927f6532ab35774f71dab2f3a823d8fc846bf
3
- size 42049
 
 
 
 
Model/saved_model/lr/hardness.pkl DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:7fb61f94fc1e0becb7fc1125c54e21bb47e63658c49a2f4d685d5c759c962816
3
- size 124771
 
 
 
 
Model/saved_model/lr/plasticity.pkl DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:2523c8f36729ef800a9a9caea6b02c0a049ac012e4ce690115831891247eb065
3
- size 101525
 
 
 
 
Model/saved_model/lr/tensile_strength.pkl DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:caad1f7df03626cf820eb00ad032cefd90375544356488de3fb7f58071c880f6
3
- size 44408
 
 
 
 
Model/saved_model/lr/yield_strength.pkl DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:05516385450822deb25cf0d963021b3eb41503970e07a38f651b57eb77a26780
3
- size 54432
 
 
 
 
app.py CHANGED
@@ -16,14 +16,6 @@ import joblib
16
  '''
17
  Get the path of all of the saved models.
18
  '''
19
-
20
- lr_compressive_strength = "./Model/saved_model/lr/compressive_strength.pkl"
21
- lr_elongation = "./Model/saved_model/lr/elongation.pkl"
22
- lr_hardness = "./Model/saved_model/lr/hardness.pkl"
23
- lr_plasticity ="./Model/saved_model/lr/plasticity.pkl"
24
- lr_tensile_strength ="./Model/saved_model/lr/tensile_strength.pkl"
25
- lr_yield_strength ="./Model/saved_model/lr/yield_strength.pkl"
26
-
27
  kmeans_ssl_compressive_strength = "./Model/saved_model/kmeans_ssl/compressive_strength.pkl"
28
  kmeans_ssl_elongation = "./Model/saved_model/kmeans_ssl/elongation.pkl"
29
  kmeans_ssl_hardness = "./Model/saved_model/kmeans_ssl/hardness.pkl"
@@ -91,17 +83,7 @@ def pred(Al, B, C, Co, Cr, Cu, Fe, Ga, Ge, Hf, Li, Mg, Mn, Mo, N, Nb, Ni, Sc, Si
91
  # print(Composition)
92
  # print(comp.values())
93
 
94
- if operation=="Linear Regression":
95
- #Using RandomForest to predict properties.
96
- Hardness = predict_input(lr_hardness).predict(df)
97
- YieldStrength=predict_input(lr_yield_strength).predict(df)
98
- TensileStrength=predict_input(lr_tensile_strength).predict(df)
99
- Elongation=predict_input(lr_elongation).predict(df)
100
- CompressiveStrength=predict_input(lr_compressive_strength).predict(df)
101
- Plasticity=predict_input(lr_plasticity).predict(df)
102
- # print("1")
103
-
104
- elif operation=="K-Means Semi-supervisor Model":
105
  #Using KNN & RandomForest to predict properties.
106
  Hardness = predict_input(kmeans_ssl_hardness).predict(df)
107
  YieldStrength = predict_input(kmeans_ssl_yield_strength).predict(df)
@@ -109,7 +91,6 @@ def pred(Al, B, C, Co, Cr, Cu, Fe, Ga, Ge, Hf, Li, Mg, Mn, Mo, N, Nb, Ni, Sc, Si
109
  Elongation = predict_input(kmeans_ssl_elongation).predict(df)
110
  CompressiveStrength = predict_input(kmeans_ssl_compressive_strength).predict(df)
111
  Plasticity = predict_input(kmeans_ssl_plasticity).predict(df)
112
- # print("2")
113
 
114
  elif operation == "GMM Semi-supervisor Model":
115
  # Using semi_supervisor Label Propagation to predict properties.
@@ -227,7 +208,7 @@ with gr.Blocks() as demo:
227
 
228
  # The section to select the Machine Learning Model.
229
  with gr.Row():
230
- operation = gr.inputs.Radio(["Linear Regression","K-Means Semi-supervisor Model", "GMM Semi-supervisor Model"])
231
 
232
  # The section to input the element ratio.
233
  with gr.Row():
 
16
  '''
17
  Get the path of all of the saved models.
18
  '''
 
 
 
 
 
 
 
 
19
  kmeans_ssl_compressive_strength = "./Model/saved_model/kmeans_ssl/compressive_strength.pkl"
20
  kmeans_ssl_elongation = "./Model/saved_model/kmeans_ssl/elongation.pkl"
21
  kmeans_ssl_hardness = "./Model/saved_model/kmeans_ssl/hardness.pkl"
 
83
  # print(Composition)
84
  # print(comp.values())
85
 
86
+ if operation=="K-Means Semi-supervisor Model":
 
 
 
 
 
 
 
 
 
 
87
  #Using KNN & RandomForest to predict properties.
88
  Hardness = predict_input(kmeans_ssl_hardness).predict(df)
89
  YieldStrength = predict_input(kmeans_ssl_yield_strength).predict(df)
 
91
  Elongation = predict_input(kmeans_ssl_elongation).predict(df)
92
  CompressiveStrength = predict_input(kmeans_ssl_compressive_strength).predict(df)
93
  Plasticity = predict_input(kmeans_ssl_plasticity).predict(df)
 
94
 
95
  elif operation == "GMM Semi-supervisor Model":
96
  # Using semi_supervisor Label Propagation to predict properties.
 
208
 
209
  # The section to select the Machine Learning Model.
210
  with gr.Row():
211
+ operation = gr.inputs.Radio(["K-Means Semi-supervisor Model", "GMM Semi-supervisor Model"])
212
 
213
  # The section to input the element ratio.
214
  with gr.Row():