This repository contains a housing price prediction application built with a React frontend and a Flask backend. The application allows users to input various features of a house and predict its price using different machine learning algorithms.
The Housing Price Prediction Application provides an interface for users to enter details about a property and choose a machine learning algorithm to predict the price of the property. The backend is equipped with multiple models, including XGBoost, Linear Regression, Random Forest, and Gradient Boosting.
- User-friendly interface to input house features
- Dropdown menus for categorical features
- Selection of various machine learning algorithms
- Display of predicted price and model performance metrics (R² scores)
- Real-time prediction using a Flask API
- React
- Flask
- Pandas
- Scikit-learn
- XGBoost
- Flask-CORS
Follow these steps to set up the application locally.
- Clone the repository:
git clone https://github.com/your-username/housing-price-prediction.git cd housing-price-prediction/frontend
- Install dependencies:
npm install
- Start the React application:
npm start
-
Navigate to the backend directory:
cd ../backend
-
Set up a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install dependencies:
pip install -r requirements.txt
-
Place the dataset (
dataset_etiketlenmis_son.xlsx
) in the backend directory. -
Start the Flask application:
flask run
- Open the frontend application in your browser at http://localhost:3000.
- Fill in the form with the necessary house details.
- Select a machine learning algorithm from the dropdown menu.
- Click the "Gönder" button to get the price prediction.
- View the predicted price and model performance metrics displayed on the page.
housing-price-prediction/
├── frontend/
│ ├── src/
│ │ ├── MainPage.js
│ │ ├── dataset.js
│ │ └── ...
│ ├── public/
│ └── package.json
└── backend/
├── main.py
├── requirements.txt
└── dataset_etiketlenmis_son.xlsx
MainPage.js
: The main component containing the form and logic for handling user input and API requests.dataset.js
: Contains dataset mappings for categorical feature transformations.
main.py
: The Flask application with endpoints for model training and prediction.requirements.txt
: Lists the Python dependencies for the backend.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature-branch
- Make your changes and commit them:
git commit -m "Add new feature"
- Push to the branch:
git push origin feature-branch
- Submit a pull request.