machine learning model to predict life standard of people within the country
# 🏠 Tanzania Life Standard Predictor - Streamlit App
## 📋 Overview
This is a web application that predicts life standard in Tanzania (Tajiri, Hali ya Kawaida, or Maskini) based on socioeconomic factors.
## 🚀 How to Run Locally
### Prerequisites
- Python 3.8 or higher
- pip
### Installation Steps
1. **Install required packages:**
```bash
pip install -r requirements.txt
```
2. **Make sure you have the model files in the same directory:**
- `model.pkl`
- `label_encoders.pkl`
- `scaler.pkl`
*(These files are generated by running the Jupyter notebook: `ml_project.ipynb`)*
3. **Run the Streamlit app:**
```bash
streamlit run app.py
```
4. **Open your browser:**
- The app will automatically open at `
localhost`
- If it doesn't open automatically, navigate to that URL manually
## 📦 Files Needed for Deployment
```
your-project-folder/
│
├── app.py # Main Streamlit application
├── requirements.txt # Python dependencies
├── model.pkl # Trained ML model
├── label_encoders.pkl # Categorical encoders
├── scaler.pkl # Feature scaler
└── README.md # This file
```
## 🌐 Deploy to Streamlit Cloud (FREE!)
### Step 1: Prepare Files
1. Make sure all files are in your project folder
2. Run the Jupyter notebook first to generate the .pkl files
### Step 2: Push to GitHub
```bash
# Initialize git (if not already done)
git init
# Add all files
git add .
# Commit
git commit -m "Tanzania Life Standard Predictor App"
# Create a new repository on GitHub
# Then push to GitHub
git remote add origin
github.com
git branch -M main
git push -u origin main
```
### Step 3: Deploy on Streamlit Cloud
1. Go to
share.streamlit.io
2. Sign in with GitHub
3. Click "New app"
4. Select your repository
5. Choose the branch (main)
6. Set the main file path: `app.py`
7. Click "Deploy"!
### Your app will be live at:
```
your_username-your_ …