Gallai commited on
Commit
9ddebaa
·
verified ·
1 Parent(s): f12839a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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.fit(features)
15
- features_array = np.array(features).reshape(1, -1)
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")