A machine learning-based application for predicting poverty levels using historical data.
smart-poverty-forecast/
├── backend/ # FastAPI backend server
│ ├── main.py # API endpoints
│ ├── *.pkl # Trained ML models
│ └── requirements.txt
├── frontend/ # Streamlit frontend application
│ ├── app.py # Web interface
│ └── requirements.txt
└── README.md
- Python 3.7+ installed
- pip package manager
-
Install Backend Dependencies:
cd backend pip install -r requirements.txt -
Install Frontend Dependencies:
cd frontend pip install -r requirements.txt
- Run
start_backend.batto start the backend server - Run
start_frontend.batto start the frontend application (in a separate terminal)
Terminal 1 - Backend:
cd backend
uvicorn main:app --reloadBackend will be available at: http://127.0.0.1:8000
Terminal 2 - Frontend:
cd frontend
streamlit run app.pyFrontend will be available at: http://localhost:8501
GET /- Health check endpointPOST /predict- Predict poverty levels- Parameters:
income: Current median household incomepoverty_last_year: Poverty percentage last yearincome_last_year: Income from last yearavg_3yr: 3-year poverty average
- Parameters:
- Start the backend server first
- Start the frontend application
- Open your browser to the Streamlit URL (usually http://localhost:8501)
- Enter the required values and click "Predict Poverty Levels"
- The backend server must be running before using the frontend
- Models are loaded automatically when the backend starts
- Use
--reloadflag for development (automatic restart on code changes)