yxmauw commited on
Commit
800fc00
·
1 Parent(s): 2f6dde2

Update model_methods.py

Browse files
Files changed (1) hide show
  1. model_methods.py +2 -2
model_methods.py CHANGED
@@ -8,14 +8,14 @@ import pickle
8
 
9
  def predict(new_data):
10
  # impute missing `Overall Qual` values
11
- url = 'https://raw.githubusercontent.com/yxmauw/General_Assembly_Pub/main/project_2/cloud_app/streamlit_imp_data.csv'
12
  imp_data = pd.read_csv(url, header=0)
13
  imp = KNNImputer()
14
  imp.fit(imp_data)
15
  shaped_data = np.reshape(new_data, (1, -1))
16
  input_data = imp.transform(shaped_data)
17
  # load model
18
- with open('project_2/cloud_app/final_model.sav','rb') as f:
19
  model = pickle.load(f)
20
  pred = model.predict([input_data][0])
21
  return pred
 
8
 
9
  def predict(new_data):
10
  # impute missing `Overall Qual` values
11
+ url = 'https://huggingface.co/spaces/yxmauw/ames-houseprice-recommender/raw/main/streamlit_imp_data.csv'
12
  imp_data = pd.read_csv(url, header=0)
13
  imp = KNNImputer()
14
  imp.fit(imp_data)
15
  shaped_data = np.reshape(new_data, (1, -1))
16
  input_data = imp.transform(shaped_data)
17
  # load model
18
+ with open('final_model.sav','rb') as f:
19
  model = pickle.load(f)
20
  pred = model.predict([input_data][0])
21
  return pred