Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -133,6 +133,16 @@ def changedatashape():
|
|
133 |
os.remove('sample.csv')
|
134 |
|
135 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
def predict(m,historical=True):
|
137 |
if historical:
|
138 |
date = input('date:')
|
@@ -142,6 +152,7 @@ def predict(m,historical=True):
|
|
142 |
else:
|
143 |
getdata()
|
144 |
changedatashape()
|
|
|
145 |
|
146 |
# Specify the path to your CSV file
|
147 |
csv_file_path = 'sample2.csv'
|
@@ -169,5 +180,10 @@ def predict(m,historical=True):
|
|
169 |
writer.writerow([new_column_header] + ['feature{}'.format(i+1) for i in range(1, num_columns + 1)])
|
170 |
writer.writerows(data)
|
171 |
|
172 |
-
if st.button("
|
173 |
-
predict(9,historical=False)
|
|
|
|
|
|
|
|
|
|
|
|
133 |
os.remove('sample.csv')
|
134 |
|
135 |
|
136 |
+
command = "java --enable-preview -jar /jadbio-model-exe.jar \
|
137 |
+
-m /jadbio-1.4.119-model-Augustwithprice_feature0.bin \
|
138 |
+
-i /content/sample2.csv \
|
139 |
+
-o predictions.csv"
|
140 |
+
|
141 |
+
def generate_result():
|
142 |
+
subprocess.run(command)
|
143 |
+
|
144 |
+
|
145 |
+
|
146 |
def predict(m,historical=True):
|
147 |
if historical:
|
148 |
date = input('date:')
|
|
|
152 |
else:
|
153 |
getdata()
|
154 |
changedatashape()
|
155 |
+
generate_result()
|
156 |
|
157 |
# Specify the path to your CSV file
|
158 |
csv_file_path = 'sample2.csv'
|
|
|
180 |
writer.writerow([new_column_header] + ['feature{}'.format(i+1) for i in range(1, num_columns + 1)])
|
181 |
writer.writerows(data)
|
182 |
|
183 |
+
if st.button("Predict result"):
|
184 |
+
predict(9,historical=False)
|
185 |
+
predi = pd.read_csv('predictions.csv')
|
186 |
+
if 0.5<predi.iloc[0,1]<0.63:
|
187 |
+
st.write("increase")
|
188 |
+
else:
|
189 |
+
st.write("decrease")
|