https://github.com/papagorgio23/segmentation_api
https://github.com/papagorgio23/segmentation_api
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/papagorgio23/segmentation_api
- Owner: papagorgio23
- Created: 2024-04-12T00:51:44.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-19T20:51:47.000Z (over 1 year ago)
- Last Synced: 2025-01-29T12:12:03.466Z (8 months ago)
- Language: Jupyter Notebook
- Size: 1.8 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Contribution Model API
## Demo Model
This is a demo model that predicts the contribution amount based on the following features:
- First time donor (Yes/No)
- Purpose of Donation (Memo Text Description)
- Donor Occupation (Contributor Occupation)
- Donor State (Contributor State)View the demo model [here](https://papagorgio23-segmentation-api-appapp-q4hb3q.streamlit.app/)
## Build Docker Image
```bash
make docker-build
```## Run Docker Image
```bash
make docker-run
```### API Docs
When docker is running: http://localhost/docs
#### API Endpoints
predict: http://localhost/predict
```json
{
"data": [
{
"memo_text_description": "BIDEN",
"contributor_occupation": "TEACHER",
"contributor_state": "CA",
"first_time_donor": 1
},
{
"memo_text_description": "AMY",
"contributor_occupation": "PHYSICIAN",
"contributor_state": "FL",
"first_time_donor": 0
}
]
}
```
Response:
```json
[
{
"memo_text_description": "BIDEN",
"contributor_occupation": "TEACHER",
"contributor_state": "CA",
"first_time_donor": 1,
"predicted_contribution": 30.94
},
{
"memo_text_description": "AMY",
"contributor_occupation": "PHYSICIAN",
"contributor_state": "FL",
"first_time_donor": 0,
"predicted_contribution": 143.12
}
]
```
#### Predict_CSV
Upload sample csv file `Data_Science_Technical_FEC_Filing_Sample.csv` and it will return the predicted contribution amount for each row. You can download the results as a csv file.

