|
| 1 | +# AGENTS.md |
| 2 | + |
| 3 | +## Project Overview |
| 4 | + |
| 5 | +This is **Machine Learning for Beginners**, a comprehensive 12-week, 26-lesson curriculum covering classic machine learning concepts using Python (primarily with Scikit-learn) and R. The repository is designed as a self-paced learning resource with hands-on projects, quizzes, and assignments. Each lesson explores ML concepts through real-world data from various cultures and regions worldwide. |
| 6 | + |
| 7 | +Key components: |
| 8 | +- **Educational Content**: 26 lessons covering introduction to ML, regression, classification, clustering, NLP, time series, and reinforcement learning |
| 9 | +- **Quiz Application**: Vue.js-based quiz app with pre- and post-lesson assessments |
| 10 | +- **Multi-language Support**: Automated translations to 40+ languages via GitHub Actions |
| 11 | +- **Dual Language Support**: Lessons available in both Python (Jupyter notebooks) and R (R Markdown files) |
| 12 | +- **Project-Based Learning**: Each topic includes practical projects and assignments |
| 13 | + |
| 14 | +## Repository Structure |
| 15 | + |
| 16 | +``` |
| 17 | +ML-For-Beginners/ |
| 18 | +├── 1-Introduction/ # ML basics, history, fairness, techniques |
| 19 | +├── 2-Regression/ # Regression models with Python/R |
| 20 | +├── 3-Web-App/ # Flask web app for ML model deployment |
| 21 | +├── 4-Classification/ # Classification algorithms |
| 22 | +├── 5-Clustering/ # Clustering techniques |
| 23 | +├── 6-NLP/ # Natural Language Processing |
| 24 | +├── 7-TimeSeries/ # Time series forecasting |
| 25 | +├── 8-Reinforcement/ # Reinforcement learning |
| 26 | +├── 9-Real-World/ # Real-world ML applications |
| 27 | +├── quiz-app/ # Vue.js quiz application |
| 28 | +├── translations/ # Auto-generated translations |
| 29 | +└── sketchnotes/ # Visual learning aids |
| 30 | +``` |
| 31 | + |
| 32 | +Each lesson folder typically contains: |
| 33 | +- `README.md` - Main lesson content |
| 34 | +- `notebook.ipynb` - Python Jupyter notebook |
| 35 | +- `solution/` - Solution code (Python and R versions) |
| 36 | +- `assignment.md` - Practice exercises |
| 37 | +- `images/` - Visual resources |
| 38 | + |
| 39 | +## Setup Commands |
| 40 | + |
| 41 | +### For Python Lessons |
| 42 | + |
| 43 | +Most lessons use Jupyter notebooks. Install required dependencies: |
| 44 | + |
| 45 | +```bash |
| 46 | +# Install Python 3.8+ if not already installed |
| 47 | +python --version |
| 48 | + |
| 49 | +# Install Jupyter |
| 50 | +pip install jupyter |
| 51 | + |
| 52 | +# Install common ML libraries |
| 53 | +pip install scikit-learn pandas numpy matplotlib seaborn |
| 54 | + |
| 55 | +# For specific lessons, check lesson-specific requirements |
| 56 | +# Example: Web App lesson |
| 57 | +pip install flask |
| 58 | +``` |
| 59 | + |
| 60 | +### For R Lessons |
| 61 | + |
| 62 | +R lessons are in `solution/R/` folders as `.rmd` or `.ipynb` files: |
| 63 | + |
| 64 | +```bash |
| 65 | +# Install R and required packages |
| 66 | +# In R console: |
| 67 | +install.packages(c("tidyverse", "tidymodels", "caret")) |
| 68 | +``` |
| 69 | + |
| 70 | +### For Quiz Application |
| 71 | + |
| 72 | +The quiz app is a Vue.js application located in the `quiz-app/` directory: |
| 73 | + |
| 74 | +```bash |
| 75 | +cd quiz-app |
| 76 | +npm install |
| 77 | +``` |
| 78 | + |
| 79 | +### For Documentation Site |
| 80 | + |
| 81 | +To run the documentation locally: |
| 82 | + |
| 83 | +```bash |
| 84 | +# Install Docsify |
| 85 | +npm install -g docsify-cli |
| 86 | + |
| 87 | +# Serve from repository root |
| 88 | +docsify serve |
| 89 | + |
| 90 | +# Access at http://localhost:3000 |
| 91 | +``` |
| 92 | + |
| 93 | +## Development Workflow |
| 94 | + |
| 95 | +### Working with Lesson Notebooks |
| 96 | + |
| 97 | +1. Navigate to the lesson directory (e.g., `2-Regression/1-Tools/`) |
| 98 | +2. Open the Jupyter notebook: |
| 99 | + ```bash |
| 100 | + jupyter notebook notebook.ipynb |
| 101 | + ``` |
| 102 | +3. Work through the lesson content and exercises |
| 103 | +4. Check solutions in the `solution/` folder if needed |
| 104 | + |
| 105 | +### Python Development |
| 106 | + |
| 107 | +- Lessons use standard Python data science libraries |
| 108 | +- Jupyter notebooks for interactive learning |
| 109 | +- Solution code available in each lesson's `solution/` folder |
| 110 | + |
| 111 | +### R Development |
| 112 | + |
| 113 | +- R lessons are in `.rmd` format (R Markdown) |
| 114 | +- Solutions located in `solution/R/` subdirectories |
| 115 | +- Use RStudio or Jupyter with R kernel to run R notebooks |
| 116 | + |
| 117 | +### Quiz Application Development |
| 118 | + |
| 119 | +```bash |
| 120 | +cd quiz-app |
| 121 | + |
| 122 | +# Start development server |
| 123 | +npm run serve |
| 124 | +# Access at http://localhost:8080 |
| 125 | + |
| 126 | +# Build for production |
| 127 | +npm run build |
| 128 | + |
| 129 | +# Lint and fix files |
| 130 | +npm run lint |
| 131 | +``` |
| 132 | + |
| 133 | +## Testing Instructions |
| 134 | + |
| 135 | +### Quiz Application Testing |
| 136 | + |
| 137 | +```bash |
| 138 | +cd quiz-app |
| 139 | + |
| 140 | +# Lint code |
| 141 | +npm run lint |
| 142 | + |
| 143 | +# Build to verify no errors |
| 144 | +npm run build |
| 145 | +``` |
| 146 | + |
| 147 | +**Note**: This is primarily an educational curriculum repository. There are no automated tests for lesson content. Validation is done through: |
| 148 | +- Completing lesson exercises |
| 149 | +- Running notebook cells successfully |
| 150 | +- Checking output against expected results in solutions |
| 151 | + |
| 152 | +## Code Style Guidelines |
| 153 | + |
| 154 | +### Python Code |
| 155 | +- Follow PEP 8 style guidelines |
| 156 | +- Use clear, descriptive variable names |
| 157 | +- Include comments for complex operations |
| 158 | +- Jupyter notebooks should have markdown cells explaining concepts |
| 159 | + |
| 160 | +### JavaScript/Vue.js (Quiz App) |
| 161 | +- Follows Vue.js style guide |
| 162 | +- ESLint configuration in `quiz-app/package.json` |
| 163 | +- Run `npm run lint` to check and auto-fix issues |
| 164 | + |
| 165 | +### Documentation |
| 166 | +- Markdown files should be clear and well-structured |
| 167 | +- Include code examples in fenced code blocks |
| 168 | +- Use relative links for internal references |
| 169 | +- Follow existing formatting conventions |
| 170 | + |
| 171 | +## Build and Deployment |
| 172 | + |
| 173 | +### Quiz Application Deployment |
| 174 | + |
| 175 | +The quiz app can be deployed to Azure Static Web Apps: |
| 176 | + |
| 177 | +1. **Prerequisites**: |
| 178 | + - Azure account |
| 179 | + - GitHub repository (already forked) |
| 180 | + |
| 181 | +2. **Deploy to Azure**: |
| 182 | + - Create Azure Static Web App resource |
| 183 | + - Connect to GitHub repository |
| 184 | + - Set app location: `/quiz-app` |
| 185 | + - Set output location: `dist` |
| 186 | + - Azure automatically creates GitHub Actions workflow |
| 187 | + |
| 188 | +3. **GitHub Actions Workflow**: |
| 189 | + - Workflow file created at `.github/workflows/azure-static-web-apps-*.yml` |
| 190 | + - Automatically builds and deploys on push to main branch |
| 191 | + |
| 192 | +### Documentation PDF |
| 193 | + |
| 194 | +Generate PDF from documentation: |
| 195 | + |
| 196 | +```bash |
| 197 | +npm install |
| 198 | +npm run convert |
| 199 | +``` |
| 200 | + |
| 201 | +## Translation Workflow |
| 202 | + |
| 203 | +**Important**: Translations are automated via GitHub Actions using Co-op Translator. |
| 204 | + |
| 205 | +- Translations are auto-generated when changes are pushed to `main` branch |
| 206 | +- **DO NOT manually translate content** - the system handles this |
| 207 | +- Workflow defined in `.github/workflows/co-op-translator.yml` |
| 208 | +- Uses Azure AI/OpenAI services for translation |
| 209 | +- Supports 40+ languages |
| 210 | + |
| 211 | +## Contributing Guidelines |
| 212 | + |
| 213 | +### For Content Contributors |
| 214 | + |
| 215 | +1. **Fork the repository** and create a feature branch |
| 216 | +2. **Make changes to lesson content** if adding/updating lessons |
| 217 | +3. **Do not modify translated files** - they are auto-generated |
| 218 | +4. **Test your code** - ensure all notebook cells run successfully |
| 219 | +5. **Verify links and images** work correctly |
| 220 | +6. **Submit a pull request** with clear description |
| 221 | + |
| 222 | +### Pull Request Guidelines |
| 223 | + |
| 224 | +- **Title format**: `[Section] Brief description of changes` |
| 225 | + - Example: `[Regression] Fix typo in lesson 5` |
| 226 | + - Example: `[Quiz-App] Update dependencies` |
| 227 | +- **Before submitting**: |
| 228 | + - Ensure all notebook cells execute without errors |
| 229 | + - Run `npm run lint` if modifying quiz-app |
| 230 | + - Verify markdown formatting |
| 231 | + - Test any new code examples |
| 232 | +- **PR must include**: |
| 233 | + - Description of changes |
| 234 | + - Reason for changes |
| 235 | + - Screenshots if UI changes |
| 236 | +- **Code of Conduct**: Follow the [Microsoft Open Source Code of Conduct](CODE_OF_CONDUCT.md) |
| 237 | +- **CLA**: You will need to sign the Contributor License Agreement |
| 238 | + |
| 239 | +## Lesson Structure |
| 240 | + |
| 241 | +Each lesson follows a consistent pattern: |
| 242 | + |
| 243 | +1. **Pre-lecture quiz** - Test baseline knowledge |
| 244 | +2. **Lesson content** - Written instructions and explanations |
| 245 | +3. **Code demonstrations** - Hands-on examples in notebooks |
| 246 | +4. **Knowledge checks** - Verify understanding throughout |
| 247 | +5. **Challenge** - Apply concepts independently |
| 248 | +6. **Assignment** - Extended practice |
| 249 | +7. **Post-lecture quiz** - Assess learning outcomes |
| 250 | + |
| 251 | +## Common Commands Reference |
| 252 | + |
| 253 | +```bash |
| 254 | +# Python/Jupyter |
| 255 | +jupyter notebook # Start Jupyter server |
| 256 | +jupyter notebook notebook.ipynb # Open specific notebook |
| 257 | +pip install -r requirements.txt # Install dependencies (where available) |
| 258 | + |
| 259 | +# Quiz App |
| 260 | +cd quiz-app |
| 261 | +npm install # Install dependencies |
| 262 | +npm run serve # Development server |
| 263 | +npm run build # Production build |
| 264 | +npm run lint # Lint and fix |
| 265 | + |
| 266 | +# Documentation |
| 267 | +docsify serve # Serve documentation locally |
| 268 | +npm run convert # Generate PDF |
| 269 | + |
| 270 | +# Git workflow |
| 271 | +git checkout -b feature/my-change # Create feature branch |
| 272 | +git add . # Stage changes |
| 273 | +git commit -m "Description" # Commit changes |
| 274 | +git push origin feature/my-change # Push to remote |
| 275 | +``` |
| 276 | + |
| 277 | +## Additional Resources |
| 278 | + |
| 279 | +- **Microsoft Learn Collection**: [ML for Beginners modules](https://learn.microsoft.com/en-us/collections/qrqzamz1nn2wx3?WT.mc_id=academic-77952-bethanycheum) |
| 280 | +- **Quiz App**: [Online quizzes](https://ff-quizzes.netlify.app/en/ml/) |
| 281 | +- **Discussion Board**: [GitHub Discussions](https://github.com/microsoft/ML-For-Beginners/discussions) |
| 282 | +- **Video Walkthroughs**: [YouTube Playlist](https://aka.ms/ml-beginners-videos) |
| 283 | + |
| 284 | +## Key Technologies |
| 285 | + |
| 286 | +- **Python**: Primary language for ML lessons (Scikit-learn, Pandas, NumPy, Matplotlib) |
| 287 | +- **R**: Alternative implementation using tidyverse, tidymodels, caret |
| 288 | +- **Jupyter**: Interactive notebooks for Python lessons |
| 289 | +- **R Markdown**: Documents for R lessons |
| 290 | +- **Vue.js 3**: Quiz application framework |
| 291 | +- **Flask**: Web application framework for ML model deployment |
| 292 | +- **Docsify**: Documentation site generator |
| 293 | +- **GitHub Actions**: CI/CD and automated translations |
| 294 | + |
| 295 | +## Security Considerations |
| 296 | + |
| 297 | +- **No secrets in code**: Never commit API keys or credentials |
| 298 | +- **Dependencies**: Keep npm and pip packages updated |
| 299 | +- **User input**: Flask web app examples include basic input validation |
| 300 | +- **Sensitive data**: Example datasets are public and non-sensitive |
| 301 | + |
| 302 | +## Troubleshooting |
| 303 | + |
| 304 | +### Jupyter Notebooks |
| 305 | + |
| 306 | +- **Kernel issues**: Restart kernel if cells hang: Kernel → Restart |
| 307 | +- **Import errors**: Ensure all required packages are installed with pip |
| 308 | +- **Path issues**: Run notebooks from their containing directory |
| 309 | + |
| 310 | +### Quiz Application |
| 311 | + |
| 312 | +- **npm install fails**: Clear npm cache: `npm cache clean --force` |
| 313 | +- **Port conflicts**: Change port with: `npm run serve -- --port 8081` |
| 314 | +- **Build errors**: Delete `node_modules` and reinstall: `rm -rf node_modules && npm install` |
| 315 | + |
| 316 | +### R Lessons |
| 317 | + |
| 318 | +- **Package not found**: Install with: `install.packages("package-name")` |
| 319 | +- **RMarkdown rendering**: Ensure rmarkdown package is installed |
| 320 | +- **Kernel issues**: May need to install IRkernel for Jupyter |
| 321 | + |
| 322 | +## Project-Specific Notes |
| 323 | + |
| 324 | +- This is primarily a **learning curriculum**, not production code |
| 325 | +- Focus is on **understanding ML concepts** through hands-on practice |
| 326 | +- Code examples prioritize **clarity over optimization** |
| 327 | +- Most lessons are **self-contained** and can be completed independently |
| 328 | +- **Solutions provided** but learners should attempt exercises first |
| 329 | +- Repository uses **Docsify** for web documentation without build step |
| 330 | +- **Sketchnotes** provide visual summaries of concepts |
| 331 | +- **Multi-language support** makes content globally accessible |
0 commit comments