Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions Basics/Open_Source_Guides/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Open Source Guides

Open source software is built by people who collaborate, share knowledge, and improve projects together. If you are new to open source, the guides below are a useful starting point.

These resources are based on the [Open Source Guides](https://opensource.guide/) maintained by GitHub and the open source community.

## Getting Started

- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/) - Learn how to find projects, choose a contribution, and submit changes.
- [Starting an Open Source Project](https://opensource.guide/starting-a-project/) - Learn the basics of launching an open source project.
- [Finding Users for Your Project](https://opensource.guide/finding-users/) - Ideas for helping people discover and use your project.

## Building a Healthy Project

- [Building Welcoming Communities](https://opensource.guide/building-community/) - Learn how to create an inclusive and welcoming community.
- [Best Practices for Maintainers](https://opensource.guide/best-practices/) - Practical guidance for maintaining an open source project.
- [Your Code of Conduct](https://opensource.guide/code-of-conduct/) - Understand the role of a code of conduct in a project community.
- [Leadership and Governance](https://opensource.guide/leadership-and-governance/) - Learn how projects can make decisions and establish governance.
- [Maintaining Balance for Open Source Maintainers](https://opensource.guide/maintaining-balance-for-open-source/) - Tips for sustainable open source maintenance.

## Security, Accessibility, and Sustainability

- [Accessibility Best Practices for Your Project](https://opensource.guide/accessibility-best-practices-for-your-project/) - Practical steps for making projects more accessible.
- [Security Best Practices for Your Project](https://opensource.guide/security-best-practices-for-your-project/) - Learn about security practices that help protect open source projects.
- [Open Source Metrics](https://opensource.guide/metrics/) - Use project metrics to understand activity and growth.
- [Getting Paid for Open Source Work](https://opensource.guide/getting-paid/) - Explore ways to make open source work sustainable.
- [The Legal Side of Open Source](https://opensource.guide/legal/) - An introduction to licensing and other legal considerations.

## A Simple Contribution Workflow

A typical contribution to a GitHub project looks like this:

1. **Find a project** that interests you.
2. **Read the README and contribution guidelines.**
3. **Fork the repository** to your GitHub account.
4. **Clone your fork** to your computer.
5. **Create a new branch** for your change.
6. **Make and test your changes.**
7. **Commit the changes** with a clear message.
8. **Push the branch** to your fork.
9. **Open a pull request** and clearly explain what you changed and why.
10. **Respond to review feedback** and update your branch if needed.

For beginners, documentation fixes, typo corrections, examples, tests, and small improvements can all be valuable contributions.

## Useful Git Commands

```bash
git clone https://github.com/YOUR-USERNAME/REPOSITORY.git
cd REPOSITORY
git checkout -b my-contribution

git status
git add .
git commit -m "Add open source contribution guide"
git push -u origin my-contribution
```

After pushing the branch, open a pull request from your fork to the original repository.

## Source and Attribution

This page is a concise learning index based on the topics covered by [Open Source Guides](https://opensource.guide/). The original Open Source Guides content is released under the [CC-BY-4.0 license](https://creativecommons.org/licenses/by/4.0/).

For the complete and current guides, visit [opensource.guide](https://opensource.guide/).
16 changes: 16 additions & 0 deletions DataScience/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Python
__pycache__/
*.py[cod]
.venv/
venv/

# Local datasets and generated files
datasets/
images_dataset/
*.log

# IDE / OS
.vscode/
.idea/
.DS_Store
Thumbs.db
37 changes: 34 additions & 3 deletions DataScience/BangloreHomePrices/readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![](BHP_website.PNG)

This data science project series walks through step by step process of how to build a real estate price prediction website. We will first build a model using sklearn and linear regression using banglore home prices dataset from kaggle.com. Second step would be to write a python flask server that uses the saved model to serve http requests. Third component is the website built in html, css and javascript that allows user to enter home square ft area, bedrooms etc and it will call python flask server to retrieve the predicted price. During model building we will cover almost all data science concepts such as data load and cleaning, outlier detection and removal, feature engineering, dimensionality reduction, gridsearchcv for hyperparameter tunning, k fold cross validation etc. Technology and tools wise this project covers,
This data science project series walks through step by step process of how to build a real estate price prediction website. We will first build a model using sklearn and linear regression using Bangalore home prices dataset from kaggle.com. Second step would be to write a python flask server that uses the saved model to serve http requests. Third component is the website built in html, css and javascript that allows user to enter home square ft area, bedrooms etc and it will call python flask server to retrieve the predicted price. During model building we will cover almost all data science concepts such as data load and cleaning, outlier detection and removal, feature engineering, dimensionality reduction, gridsearchcv for hyperparameter tuning, k fold cross validation etc. Technology and tools wise this project covers,

1. Python
2. Numpy and Pandas for data cleaning
Expand Down Expand Up @@ -52,7 +52,7 @@ ssh -i "C:\Users\Viral\.ssh\Banglore.pem" ubuntu@ec2-3-133-88-210.us-east-2.comp
```
2. Create symlink for this file in /etc/nginx/sites-enabled by running this command,
```
sudo ln -v -s /etc/nginx/sites-available/bhp.conf
sudo ln -v -s /etc/nginx/sites-available/bhp.conf /etc/nginx/sites-enabled/bhp.conf
```
3. Remove symlink for default file in /etc/nginx/sites-enabled directory,
```
Expand All @@ -66,10 +66,41 @@ ssh -i "C:\Users\Viral\.ssh\Banglore.pem" ubuntu@ec2-3-133-88-210.us-east-2.comp
```
sudo apt-get install python3-pip
sudo pip3 install -r /home/ubuntu/BangloreHomePrices/server/requirements.txt
python3 /home/ubuntu/BangloreHomePrices/client/server.py
python3 /home/ubuntu/BangloreHomePrices/server/server.py
```
Running last command above will prompt that server is running on port 5000.
8. Now just load your cloud url in browser (for me it was http://ec2-3-133-88-210.us-east-2.compute.amazonaws.com/) and this will be fully functional website running in production cloud environment





## Run locally

From the `server` directory, install the dependencies and start the Flask API:

```bash
cd BangloreHomePrices/server
python -m venv .venv
# Windows: .venv\Scripts\activate
# Linux/macOS: source .venv/bin/activate
pip install -r requirements.txt
python server.py
```

The API is available at `http://localhost:5000`. The `/health` endpoint can be
used to verify that the server is running. The saved model artifacts must be
placed in `server/artifacts/` before starting the API.

## API example

```bash
curl -X POST http://localhost:5000/predict_home_price ^
-d "total_sqft=1000" -d "location=1st Phase JP Nagar" -d "bhk=2" -d "bath=2"
```

## Contributing

Bug fixes, documentation improvements, tests, and small usability improvements
are welcome. Please keep changes focused and explain the motivation in your
pull request.
56 changes: 38 additions & 18 deletions DataScience/BangloreHomePrices/server/server.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,52 @@
from flask import Flask, request, jsonify
from flask import Flask, jsonify, request
import util

app = Flask(__name__)

@app.route('/get_location_names', methods=['GET'])
def get_location_names():
response = jsonify({
'locations': util.get_location_names()
})
response.headers.add('Access-Control-Allow-Origin', '*')

def _set_cors(response):
response.headers["Access-Control-Allow-Origin"] = "*"
return response

@app.route('/predict_home_price', methods=['GET', 'POST'])

@app.get("/get_location_names")
def get_location_names():
return _set_cors(jsonify({"locations": util.get_location_names()}))


@app.route("/predict_home_price", methods=["GET", "POST"])
def predict_home_price():
total_sqft = float(request.form['total_sqft'])
location = request.form['location']
bhk = int(request.form['bhk'])
bath = int(request.form['bath'])
data = request.form if request.form else request.args

response = jsonify({
'estimated_price': util.get_estimated_price(location,total_sqft,bhk,bath)
})
response.headers.add('Access-Control-Allow-Origin', '*')
try:
total_sqft = float(data["total_sqft"])
bhk = int(data["bhk"])
bath = int(data["bath"])
location = data["location"].strip()
except (KeyError, TypeError, ValueError):
return _set_cors(jsonify({
"error": "Provide valid total_sqft, bhk, bath, and location values."
})), 400

if total_sqft <= 0 or bhk <= 0 or bath <= 0 or not location:
return _set_cors(jsonify({
"error": "total_sqft, bhk, bath, and location must contain valid positive values."
})), 400

try:
estimated_price = util.get_estimated_price(location, total_sqft, bhk, bath)
except RuntimeError as exc:
return _set_cors(jsonify({"error": str(exc)})), 503

return _set_cors(jsonify({"estimated_price": estimated_price}))


@app.get("/health")
def health():
return jsonify({"status": "ok"})

return response

if __name__ == "__main__":
print("Starting Python Flask Server For Home Price Prediction...")
util.load_saved_artifacts()
app.run()
app.run(host="0.0.0.0", port=5000)
21 changes: 21 additions & 0 deletions DataScience/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Contributing

Thanks for contributing to this DataScience project.

## Before you start

- Keep pull requests focused on one improvement.
- Avoid committing generated datasets, virtual environments, or local IDE files.
- Update documentation when a change affects setup or usage.
- Test the affected component before opening a pull request.

## Pull requests

Please include:

1. A short description of the problem.
2. A summary of the solution.
3. Testing steps or commands.
4. Any limitations or follow-up work.

For model changes, include relevant evaluation results when available.
Loading