Spaces:
Runtime error
Runtime error
Sagar
commited on
Commit
·
4775126
1
Parent(s):
804bce3
Updated Code
Browse files
app.py
CHANGED
@@ -114,14 +114,22 @@ print('Coefficients: \n', modelepw.coef_)
|
|
114 |
# The mean squared error
|
115 |
print("Mean squared error: %.2f" % np.mean((modelepw.predict(X_test) - y_test) ** 2))
|
116 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
def greet(input):
|
118 |
temp =np.array(input.split(","), dtype=float)
|
119 |
y = model.predict([[temp[0],temp[1],temp[2],temp[3],temp[4],temp[5],temp[6],temp[7],temp[8],temp[9],temp[10],temp[11],temp[12],temp[13],temp[14]]])
|
120 |
z = modelepw.predict([[temp[0],temp[1],temp[2],temp[3],temp[4],temp[5],temp[6],temp[7],temp[8],temp[9],temp[10],temp[11],temp[12],temp[13],temp[14]]])
|
121 |
-
return str(y,",",z)
|
122 |
|
123 |
-
textbox_x = gr.Textbox(label="
|
124 |
-
textbox_y = gr.Textbox(label="Variable Y:", placeholder ="
|
125 |
-
grIn = gr.Interface(title = "
|
126 |
|
127 |
grIn.launch()
|
|
|
114 |
# The mean squared error
|
115 |
print("Mean squared error: %.2f" % np.mean((modelepw.predict(X_test) - y_test) ** 2))
|
116 |
|
117 |
+
#local Testing
|
118 |
+
# input = "25,1,10,70,3,3,3,2,3,3,3,3,2,24,2";
|
119 |
+
# temp =np.array(input.split(","), dtype=float)
|
120 |
+
# y = model.predict([[temp[0],temp[1],temp[2],temp[3],temp[4],temp[5],temp[6],temp[7],temp[8],temp[9],temp[10],temp[11],temp[12],temp[13],temp[14]]])
|
121 |
+
# z = modelepw.predict([[temp[0],temp[1],temp[2],temp[3],temp[4],temp[5],temp[6],temp[7],temp[8],temp[9],temp[10],temp[11],temp[12],temp[13],temp[14]]])
|
122 |
+
# print(str(y),",",str(z))
|
123 |
+
|
124 |
+
|
125 |
def greet(input):
|
126 |
temp =np.array(input.split(","), dtype=float)
|
127 |
y = model.predict([[temp[0],temp[1],temp[2],temp[3],temp[4],temp[5],temp[6],temp[7],temp[8],temp[9],temp[10],temp[11],temp[12],temp[13],temp[14]]])
|
128 |
z = modelepw.predict([[temp[0],temp[1],temp[2],temp[3],temp[4],temp[5],temp[6],temp[7],temp[8],temp[9],temp[10],temp[11],temp[12],temp[13],temp[14]]])
|
129 |
+
return str(str(y),",",str(z))
|
130 |
|
131 |
+
textbox_x = gr.Textbox(label="Enter Input:", placeholder="25,1,10,70,3,3,3,2,3,3,3,3,2,24,2", lines=1)
|
132 |
+
textbox_y = gr.Textbox(label="Variable Y:", placeholder ="5.0000000", lines=1)
|
133 |
+
grIn = gr.Interface(title = "Your Name Regeression ",fn=greet, inputs=textbox_x, outputs=textbox_y)
|
134 |
|
135 |
grIn.launch()
|