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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -10,11 +10,11 @@ KNN_Regressor = load('knn_lab4.joblib')
10
  ## Building a Fubction for prediction:
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
 
 
10
  ## Building a Fubction for prediction:
11
 
12
  def predictPrice(input1, input2, input3, input4, input5, input6, input7, input8):
13
+ features = np.array([[input1, input2, input3, input4, input5, input6, input7, input8]])
14
+ features_scaled = scaler.transform(features)
15
+ prediction = KNN_Regressor.predict(features_scaled)
16
+ return prediction
17
+
18
 
19
 
20