Spaces:
Runtime error
Runtime error
SRIMATHI E
commited on
Commit
·
7f0e0ce
1
Parent(s):
601d20b
Update app.py
Browse files
app.py
CHANGED
@@ -26,7 +26,6 @@ The project aims to develop an anomaly detection model to predict whether the en
|
|
26 |
*anomaly* - Whether this reading is anomalous (1) or not (0).
|
27 |
"""
|
28 |
|
29 |
-
!pip install pyspark
|
30 |
|
31 |
from pyspark.sql import SparkSession
|
32 |
from pyspark.sql.functions import col, split, substring, when
|
@@ -177,15 +176,13 @@ print("Accuracy: ",accuracy)
|
|
177 |
|
178 |
pipeline_model.write().overwrite().save("/content/trained_model")
|
179 |
|
180 |
-
pip install gradio
|
181 |
-
|
182 |
import gradio as gr
|
183 |
from pyspark.ml import PipelineModel
|
184 |
from pyspark.sql import SparkSession
|
185 |
from pyspark.ml.feature import VectorAssembler
|
186 |
|
187 |
|
188 |
-
loaded_model = PipelineModel.load("
|
189 |
|
190 |
def predict(building_id, meter_reading, time, month, day, weekend):
|
191 |
|
|
|
26 |
*anomaly* - Whether this reading is anomalous (1) or not (0).
|
27 |
"""
|
28 |
|
|
|
29 |
|
30 |
from pyspark.sql import SparkSession
|
31 |
from pyspark.sql.functions import col, split, substring, when
|
|
|
176 |
|
177 |
pipeline_model.write().overwrite().save("/content/trained_model")
|
178 |
|
|
|
|
|
179 |
import gradio as gr
|
180 |
from pyspark.ml import PipelineModel
|
181 |
from pyspark.sql import SparkSession
|
182 |
from pyspark.ml.feature import VectorAssembler
|
183 |
|
184 |
|
185 |
+
loaded_model = PipelineModel.load("trained_model")
|
186 |
|
187 |
def predict(building_id, meter_reading, time, month, day, weekend):
|
188 |
|