Spaces:
Sleeping
Sleeping
Update model_methods.py
Browse files- 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://
|
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('
|
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
|