File size: 2,053 Bytes
db8ab74
1d6fe2d
db8ab74
 
 
 
 
 
 
 
3918f1f
1d6fe2d
 
 
 
 
db8ab74
 
 
 
 
 
6ffec2e
 
 
 
 
 
 
8cb93d6
0bfee02
6ffec2e
 
db8ab74
 
 
 
 
 
 
 
 
 
 
 
2aaa464
1d6fe2d
2aaa464
 
 
 
 
 
 
 
db8ab74
1d6fe2d
db8ab74
1d6fe2d
db8ab74
1d6fe2d
db8ab74
1d6fe2d
db8ab74
1d6fe2d
db8ab74
1d6fe2d
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
---
language: en
tags:
- machine-learning
- regression
- house-price-prediction
- sklearn
- knn
datasets:
- house-prices-dataset
URL: "https://www.kaggle.com/datasets/manutrex78/houses-prices-according-to-location"
metrics:
- r2_score
- mean_absolute_error
- root_mean_squared_error
license: creativeml-openrail-m
---

# House Price Prediction Model

This is a **K-Nearest Neighbors (KNN) Regressor** model trained to predict house prices based on features such as the number of rooms, distance to the city center, country, and build quality.

House Price Prediction Model


## **Prediction Results**
The model provides an estimated house price based on the inputs, as shown in the image.



![House Price Prediction](https://huggingface.co/Tahani1/Houses-Prices-Prediction/resolve/main/C90E9037-01EB-44E8-AAD9-4197D181AEA2.jpeg)


## Model Details

- **Model Type**: K-Nearest Neighbors Regressor (KNN)
- **Training Algorithm**: Scikit-learn's `KNeighborsRegressor`
- **Number of Neighbors**: 5
- **Input Features**:
  - Number of Rooms
  - Distance to Center (in km)
  - Country (Categorical)
  - Build Quality (1 to 10)
- **Target Variable**: House Price

## Training Data

The model was trained on a dataset containing house prices along with the following features:

- **Number of Rooms**: The number of rooms in the house.
- **Distance to Center**: The distance from the house to the city center in kilometers.
- **Country**: The country where the house is located.
- **Build Quality**: A subjective measure of the build quality of the house, ranging from 1 to 10.

The dataset used for training is `Prices house.csv`.

### Using Gradio Interface

You can interact with the model using the Gradio interface hosted on Hugging Face Spaces:

[![Gradio App](https://img.shields.io/badge/🤗%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/your-username/your-space-name)

### Using Python Code

To use the model in Python, follow these steps:

1. Install the required libraries:
   ```bash
   pip install scikit-learn pandas numpy joblib