Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,12 +11,13 @@ KNN_Regressor = load('knn_lab4.joblib')
|
|
| 11 |
|
| 12 |
def predictPrice(input1, input2, input3, input4, input5, input6, input7, input8):
|
| 13 |
features = [input1, input2, input3, input4, input5, input6, input7, input8]
|
| 14 |
-
scaler.
|
| 15 |
-
features_array = np.array(
|
| 16 |
prediction = KNN_Regressor.predict(features_array)
|
| 17 |
return prediction
|
| 18 |
|
| 19 |
|
|
|
|
| 20 |
## Buidling inputs and outputs:
|
| 21 |
|
| 22 |
input1 = gr.Slider(-124.35, -114.31, step=5, label = "Longitude")
|
|
|
|
| 11 |
|
| 12 |
def predictPrice(input1, input2, input3, input4, input5, input6, input7, input8):
|
| 13 |
features = [input1, input2, input3, input4, input5, input6, input7, input8]
|
| 14 |
+
normalized_features = scaler.transform(features)
|
| 15 |
+
features_array = np.array(normalized_features).reshape(1, -1)
|
| 16 |
prediction = KNN_Regressor.predict(features_array)
|
| 17 |
return prediction
|
| 18 |
|
| 19 |
|
| 20 |
+
|
| 21 |
## Buidling inputs and outputs:
|
| 22 |
|
| 23 |
input1 = gr.Slider(-124.35, -114.31, step=5, label = "Longitude")
|