File size: 11,377 Bytes
506c2e0 2469150 f35bff2 2469150 f35bff2 2469150 f35bff2 2469150 26a8ea5 2b395f2 2469150 f35bff2 2469150 26a8ea5 2469150 f35bff2 38a6b6a 2b395f2 2469150 2b395f2 2469150 2b395f2 2469150 2b395f2 f35bff2 2469150 f35bff2 2b395f2 f35bff2 2469150 2b395f2 2469150 832348e 2b395f2 832348e 2b395f2 2469150 fa5b1e0 2b395f2 832348e 2469150 2b395f2 2469150 2b395f2 2469150 2b395f2 832348e 2469150 2b395f2 2469150 2b395f2 832348e 2469150 6ce20d9 2469150 6ce20d9 2469150 2b395f2 2469150 2b395f2 832348e 2469150 f35bff2 2b395f2 f35bff2 2469150 38a6b6a 2b395f2 38a6b6a 2469150 f35bff2 2469150 f35bff2 2469150 f35bff2 2469150 2b395f2 2469150 2b395f2 f35bff2 2469150 f35bff2 2b395f2 2469150 f35bff2 2469150 2b395f2 f35bff2 2469150 6ce20d9 2469150 6ce20d9 2469150 2b395f2 2469150 f35bff2 2469150 2b395f2 f35bff2 2469150 f35bff2 2469150 2b395f2 2469150 2b395f2 f35bff2 2469150 2b395f2 2469150 2b395f2 f35bff2 2469150 26a8ea5 2469150 26a8ea5 2469150 f35bff2 2469150 6ce20d9 2469150 6ce20d9 2469150 6ce20d9 2469150 6ce20d9 832348e 2469150 2b395f2 2469150 832348e 2469150 832348e 2469150 f35bff2 2469150 2b395f2 f35bff2 2469150 832348e 2469150 832348e 2469150 832348e 2469150 832348e 2469150 832348e 2469150 f35bff2 2469150 832348e 2469150 832348e f35bff2 2469150 2b395f2 f35bff2 2469150 f35bff2 2469150 2b395f2 2469150 506c2e0 2469150 2b395f2 f35bff2 2469150 506c2e0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 |
---
tags:
- fred
- economic
- ML
---
# FRED ML - Enterprise Economic Analytics Platform
A comprehensive, enterprise-grade Machine Learning system for analyzing Federal Reserve Economic Data (FRED) with automated data processing, advanced analytics, and interactive visualizations.
## ๐ข Enterprise Features
### ๐ Core Capabilities
- **๐ Real-time Data Processing**: Automated FRED API integration with enhanced client
- **๐ Data Quality Assessment**: Comprehensive data validation and quality metrics
- **๐ Automated Workflows**: CI/CD pipeline with quality gates
- **โ๏ธ Cloud-Native**: AWS Lambda and S3 integration
- **๐งช Comprehensive Testing**: Unit, integration, and E2E tests
- **๐ Security**: Enterprise-grade security with audit logging
- **๐ Performance**: Optimized for high-throughput data processing
- **๐ก๏ธ Reliability**: Robust error handling and recovery mechanisms
### ๐ค Advanced Analytics
- **๐ Statistical Modeling**:
- Linear regression with lagged variables
- Correlation analysis (Pearson, Spearman, Kendall)
- Granger causality testing
- Comprehensive diagnostic testing (normality, homoscedasticity, autocorrelation, multicollinearity)
- Principal Component Analysis (PCA)
- **๐ฎ Time Series Forecasting**:
- ARIMA models with automatic order selection
- Exponential Smoothing (ETS) models
- Stationarity testing (ADF, KPSS)
- Time series decomposition (trend, seasonal, residual)
- Backtesting with performance metrics (MAE, RMSE, MAPE)
- Confidence intervals and uncertainty quantification
- **๐ฏ Economic Segmentation**:
- Time period clustering (economic regimes)
- Series clustering (behavioral patterns)
- K-means and hierarchical clustering
- Optimal cluster detection (elbow method, silhouette analysis)
- Dimensionality reduction (PCA, t-SNE)
- **๐ Interactive Visualizations**: Dynamic charts and dashboards
- **๐ก Comprehensive Insights**: Automated insights extraction and key findings identification
## ๐ Enterprise Project Structure
```
FRED_ML/
โโโ ๐ src/ # Core application code
โ โโโ ๐ core/ # Core pipeline components
โ โโโ ๐ analysis/ # Economic analysis modules
โ โโโ ๐ visualization/ # Data visualization components
โ โโโ ๐ lambda/ # AWS Lambda functions
โโโ ๐ tests/ # Enterprise test suite
โ โโโ ๐ unit/ # Unit tests
โ โโโ ๐ integration/ # Integration tests
โ โโโ ๐ e2e/ # End-to-end tests
โ โโโ ๐ run_tests.py # Comprehensive test runner
โโโ ๐ scripts/ # Enterprise automation scripts
โ โโโ ๐ cleanup_redundant_files.py # Project cleanup
โ โโโ ๐ deploy_complete.py # Complete deployment
โ โโโ ๐ health_check.py # System health monitoring
โโโ ๐ config/ # Enterprise configuration
โ โโโ ๐ settings.py # Centralized configuration management
โโโ ๐ docs/ # Comprehensive documentation
โ โโโ ๐ api/ # API documentation
โ โโโ ๐ architecture/ # System architecture docs
โ โโโ ๐ CONVERSATION_SUMMARY.md
โโโ ๐ data/ # Data storage
โ โโโ ๐ raw/ # Raw data files
โ โโโ ๐ processed/ # Processed data
โ โโโ ๐ exports/ # Generated exports
โโโ ๐ deploy/ # Deployment configurations
โ โโโ ๐ docker/ # Docker configurations
โ โโโ ๐ kubernetes/ # Kubernetes manifests
โ โโโ ๐ helm/ # Helm charts
โโโ ๐ infrastructure/ # Infrastructure as code
โ โโโ ๐ ci-cd/ # CI/CD configurations
โ โโโ ๐ monitoring/ # Monitoring setup
โ โโโ ๐ alerts/ # Alert configurations
โโโ ๐ .github/workflows/ # GitHub Actions workflows
โโโ ๐ requirements.txt # Python dependencies
โโโ ๐ pyproject.toml # Project configuration
โโโ ๐ Dockerfile # Container configuration
โโโ ๐ Makefile # Enterprise build automation
โโโ ๐ README.md # This file
```
## ๐ ๏ธ Enterprise Quick Start
### Prerequisites
- Python 3.9+
- AWS Account (for cloud features)
- FRED API Key
- Docker (optional, for containerized deployment)
### Installation
1. **Clone the repository**
```bash
git clone https://github.com/your-org/FRED_ML.git
cd FRED_ML
```
2. **Set up development environment**
```bash
# Complete setup with all dependencies
make setup
# Or manual setup
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -r requirements.txt
pip install -e .
```
3. **Configure environment variables**
```bash
export FRED_API_KEY="your_fred_api_key"
export AWS_ACCESS_KEY_ID="your_aws_access_key"
export AWS_SECRET_ACCESS_KEY="your_aws_secret_key"
export AWS_DEFAULT_REGION="us-east-1"
export ENVIRONMENT="development" # or "production"
```
4. **Validate configuration**
```bash
make config-validate
```
5. **Run comprehensive tests**
```bash
make test
```
## ๐งช Enterprise Testing
### Run all tests
```bash
make test
```
### Run specific test types
```bash
# Unit tests only
make test-unit
# Integration tests only
make test-integration
# End-to-end tests only
make test-e2e
# Tests with coverage
make test-coverage
```
### Quality Assurance
```bash
# Full QA suite (linting, formatting, type checking, tests)
make qa
# Pre-commit checks
make pre-commit
```
## ๐ Enterprise Deployment
### Local Development
```bash
# Start development environment
make dev
# Start local development server
make dev-local
```
### Production Deployment
```bash
# Production environment
make prod
# Deploy to AWS
make deploy-aws
# Deploy to Streamlit Cloud
make deploy-streamlit
```
### Docker Deployment
```bash
# Build Docker image
make build-docker
# Run with Docker
docker run -p 8501:8501 fred-ml:latest
```
## ๐ Enterprise Monitoring
### Health Checks
```bash
# System health check
make health
# View application logs
make logs
# Clear application logs
make logs-clear
```
### Performance Monitoring
```bash
# Performance tests
make performance-test
# Performance profiling
make performance-profile
```
### Security Audits
```bash
# Security scan
make security-scan
# Security audit
make security-audit
```
## ๐ง Enterprise Configuration
### Configuration Management
The project uses a centralized configuration system in `config/settings.py`:
```python
from config.settings import get_config
config = get_config()
fred_api_key = config.get_fred_api_key()
aws_credentials = config.get_aws_credentials()
```
### Environment Variables
- `FRED_API_KEY`: Your FRED API key
- `AWS_ACCESS_KEY_ID`: AWS access key for cloud features
- `AWS_SECRET_ACCESS_KEY`: AWS secret key
- `ENVIRONMENT`: Set to 'production' for production mode
- `LOG_LEVEL`: Logging level (DEBUG, INFO, WARNING, ERROR)
- `DB_HOST`, `DB_PORT`, `DB_NAME`, `DB_USER`, `DB_PASSWORD`: Database configuration
## ๐ Enterprise Analytics
### Running Analytics Pipeline
```bash
# Run complete analytics pipeline
make analytics-run
# Clear analytics cache
make analytics-cache-clear
```
### Custom Analytics
```python
from src.analysis.comprehensive_analytics import ComprehensiveAnalytics
analytics = ComprehensiveAnalytics(api_key="your_key")
results = analytics.run_complete_analysis()
```
## ๐ก๏ธ Enterprise Security
### Security Features
- **API Rate Limiting**: Configurable rate limits for API calls
- **Audit Logging**: Comprehensive audit trail for all operations
- **SSL/TLS**: Secure communication protocols
- **Input Validation**: Robust input validation and sanitization
- **Error Handling**: Secure error handling without information leakage
### Security Best Practices
- All API keys stored as environment variables
- No hardcoded credentials in source code
- Regular security audits and dependency updates
- Comprehensive logging for security monitoring
## ๐ Enterprise Performance
### Performance Optimizations
- **Caching**: Intelligent caching of frequently accessed data
- **Parallel Processing**: Multi-threaded data processing
- **Memory Management**: Efficient memory usage and garbage collection
- **Database Optimization**: Optimized database queries and connections
- **CDN Integration**: Content delivery network for static assets
### Performance Monitoring
- Real-time performance metrics
- Automated performance testing
- Resource usage monitoring
- Scalability testing
## ๐ Enterprise CI/CD
### Automated Workflows
- **Quality Gates**: Automated quality checks before deployment
- **Testing**: Comprehensive test suite execution
- **Security Scanning**: Automated security vulnerability scanning
- **Performance Testing**: Automated performance regression testing
- **Deployment**: Automated deployment to multiple environments
### GitHub Actions
The project includes comprehensive GitHub Actions workflows:
- Automated testing on pull requests
- Security scanning and vulnerability assessment
- Performance testing and monitoring
- Automated deployment to staging and production
## ๐ Enterprise Documentation
### Documentation Structure
- **API Documentation**: Comprehensive API reference
- **Architecture Documentation**: System design and architecture
- **Deployment Guides**: Step-by-step deployment instructions
- **Troubleshooting**: Common issues and solutions
- **Performance Tuning**: Optimization guidelines
### Generating Documentation
```bash
# Generate documentation
make docs
# Serve documentation locally
make docs-serve
```
## ๐ค Enterprise Support
### Getting Help
- **Documentation**: Comprehensive documentation in `/docs`
- **Issues**: Report bugs and feature requests via GitHub Issues
- **Discussions**: Community discussions via GitHub Discussions
- **Security**: Report security vulnerabilities via GitHub Security
### Contributing
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Run the full test suite: `make test`
5. Submit a pull request
### Code Quality Standards
- **Linting**: Automated code linting with flake8
- **Formatting**: Consistent code formatting with black and isort
- **Type Checking**: Static type checking with mypy
- **Testing**: Comprehensive test coverage requirements
- **Documentation**: Inline documentation and docstrings
## ๐ License
This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
## ๐ Acknowledgments
- Federal Reserve Economic Data (FRED) for providing the economic data API
- Streamlit for the interactive web framework
- The open-source community for various libraries and tools
## ๐ Contact
For enterprise support and inquiries:
- **Email**: [email protected]
- **Documentation**: https://docs.your-org.com/fred-ml
- **Issues**: https://github.com/your-org/FRED_ML/issues
---
**FRED ML** - Enterprise Economic Analytics Platform
*Version 2.0.1 - Enterprise Grade* |