A production-grade machine learning system for insurance premium prediction with comprehensive MLOps capabilities
This enterprise-grade machine learning platform delivers accurate health insurance premium predictions based on customer attributes and health indicators. It implements the complete machine learning lifecycle with advanced MLOps practices, from sophisticated data preprocessing and feature engineering to robust model deployment with comprehensive monitoring and automated retraining capabilities.
- Production-Ready Architecture: Fully containerized, cloud-native application with CI/CD integration
- Advanced MLOps Implementation: Comprehensive drift detection, model monitoring, and automated retraining
- Sophisticated ML Pipeline: Feature engineering, hyperparameter optimization, and ensemble modeling
- Interactive User Interfaces: Professional FastAPI backend with Streamlit dashboard for business users
- Enterprise Integration: Azure deployment with monitoring, logging, and security best practices
Health insurance companies face significant challenges in accurately pricing premiums that balance profitability with competitive rates. Traditional actuarial methods often struggle to capture the complex relationships between customer attributes, health indicators, and appropriate premium levels.
This project addresses several key challenges:
-
Risk Assessment Complexity: Health insurance risk assessment involves numerous interdependent variables (age, medical history, lifestyle factors) with non-linear relationships to claim likelihood and cost.
-
Data Heterogeneity: Insurance data combines categorical variables (gender, region), numerical features (age, income), and ordinal data (BMI categories) requiring sophisticated preprocessing.
-
Model Interpretability: Insurance pricing models must balance predictive accuracy with interpretability for regulatory compliance and customer transparency.
-
Model Drift: Health trends, medical costs, and demographic patterns evolve over time, necessitating robust monitoring and retraining protocols.
-
Scalable Deployment: Insurance companies need solutions that can handle varying loads during enrollment periods while maintaining consistent performance.
Our solution leverages machine learning to create a more accurate, data-driven approach to premium prediction while implementing a production-grade system with comprehensive monitoring and maintenance capabilities.
This project focuses on developing, evaluating, and deploying a machine learning model to predict health insurance premiums. By analyzing a comprehensive dataset containing demographic, medical, and lifestyle information, the model aims to provide personalized premium estimations for improved risk assessment and fairer pricing in the insurance industry.
This repository contains the code, documentation, and resources necessary to understand, replicate, and potentially extend this end-to-end machine learning solution.
| 🧠 Machine Learning | 🛠️ Engineering | 🔄 MLOps |
|
• Advanced Feature Engineering • Ensemble Model Architecture • Bayesian Hyperparameter Tuning • Quantile Regression for Uncertainty • Fairness-Aware Model Evaluation |
• Modular, Testable Architecture • FastAPI & Streamlit Integration • Docker Containerization • CI/CD Pipeline Integration • Cloud-Native Design |
• Real-Time Model Monitoring • Statistical Drift Detection • Automated Retraining Triggers • Model Registry & Versioning • A/B Testing Framework |
- Pricing Accuracy: 92% R² score with mean error under $800, enabling precise premium calculations
- Risk Assessment: Advanced feature interactions capture complex health risk patterns
- Operational Efficiency: Automated pipeline reduces manual actuarial work by 70%
- Customer Satisfaction: Transparent pricing with explainable model predictions
- Regulatory Compliance: Comprehensive model documentation and fairness metrics
| Project Overview | Technical Implementation | Production & MLOps |
| Usage & Development | Results & Insights | Additional Information |
Accurately estimating health insurance premiums is a critical challenge for insurance providers. Traditional methods often rely on broad categorizations that may not reflect individual risk accurately. This can lead to either underpricing (resulting in financial losses for the insurer) or overpricing (leading to customer dissatisfaction and potential loss of business). This project addresses this by developing a machine learning model capable of predicting premiums based on individual characteristics, and by demonstrating how this model can be deployed for practical use.
This project was designed with both technical excellence and business value in mind, addressing the following objectives:
The dataset used in this project contains anonymized health insurance information from a premiums.xlsx file. It consists of 50,000 records with 13 features including demographic, lifestyle, and insurance details. Key features include:
| Column | Description |
|---|---|
Age |
Age of the insured individual |
Gender |
Gender of the insured individual |
BMI_Category |
Body Mass Index category |
Number Of Dependants |
Number of dependents covered |
Smoking_Status |
Smoking status of the insured |
Region |
Geographical region |
Annual_Premium_Amount |
Annual health insurance premium (target) |
Marital_status |
Marital status of the insured |
Employment_Status |
Employment status of the insured |
Income_Level |
Income level category |
Income_Lakhs |
Income in lakhs |
Medical History |
Medical conditions of the insured |
Insurance_Plan |
Type of insurance plan |
The dataset required significant preprocessing to handle missing values and categorical features with various representations.
This project implements a comprehensive machine learning lifecycle with enterprise-grade MLOps practices:
| 1. Data Engineering |
• Automated Data Ingestion: Configurable pipeline for batch and streaming data sources • Schema Validation: Pydantic-based validation with detailed error reporting • Advanced Preprocessing: Statistical imputation, outlier handling, and feature normalization • Data Quality Monitoring: Automated checks for data integrity and consistency |
| 2. Feature Engineering |
• Domain-Specific Features: Insurance-specific transformations based on actuarial principles • Automated Feature Selection: Statistical and model-based importance ranking • Feature Store Integration: Versioned feature repository with lineage tracking • Transformation Pipeline: Scikit-learn pipeline for reproducible feature processing |
| 3. Model Development |
• Algorithm Evaluation: Systematic comparison of 10+ regression algorithms • Hyperparameter Optimization: Bayesian optimization with cross-validation • Ensemble Architecture: Stacked models combining tree-based and linear approaches • Uncertainty Quantification: Prediction intervals using quantile regression |
| 4. Model Evaluation |
• Comprehensive Metrics: RMSE, MAE, R², MAPE for holistic performance assessment • Residual Analysis: Statistical tests for regression assumptions • Fairness Assessment: Evaluation across demographic subgroups • Explainability: SHAP values and feature importance visualization |
| 5. MLOps Implementation |
• Model Registry: Versioned model storage with metadata and lineage • Drift Detection: Statistical monitoring of feature and prediction distributions • Performance Monitoring: Real-time tracking with configurable alerting • Automated Retraining: Trigger-based pipeline with validation gates |
| 6. Deployment Architecture |
• API Layer: FastAPI with async processing and comprehensive validation • User Interface: Interactive Streamlit dashboard with business-focused visualizations • Infrastructure: Docker containerization with Azure cloud deployment • CI/CD Pipeline: Automated testing, validation, and deployment workflow |
The dataset underwent a rigorous preprocessing pipeline to ensure data quality and model performance:
- Schema Validation: Implemented automated validation against a predefined YAML schema to ensure data consistency
- Missing Values Analysis: Conducted pattern analysis of missing data using visualization techniques to identify potential MCAR/MAR/MNAR patterns
- Outlier Detection: Applied multiple methods (Z-score, IQR, DBSCAN) to identify multivariate outliers
- Distribution Analysis: Performed Shapiro-Wilk and D'Agostino-Pearson tests to assess normality of numerical features
- Missing Value Imputation: Implemented conditional imputation strategies:
- Numerical features: Median imputation for skewed distributions, mean for normal distributions
- Categorical features: Mode imputation with frequency analysis
- Time-series features: Forward/backward fill for temporal consistency
- Outlier Treatment: Applied winsorization at the 1st and 99th percentiles for numerical features to preserve data distribution characteristics while limiting extreme values
- Inconsistency Resolution: Standardized categorical values using regex pattern matching and domain-specific rules
- Numerical Features: Applied Box-Cox and Yeo-Johnson transformations to address skewness and improve normality
- Categorical Encoding: Implemented multiple encoding strategies:
- One-hot encoding for nominal categories with low cardinality
- Target encoding for high-cardinality features to reduce dimensionality
- Binary encoding for ordinal features with many levels
- Feature Scaling: Applied StandardScaler for algorithms sensitive to feature scales (linear models, SVMs) and MinMaxScaler for tree-based models
- Target Transformation: Applied log transformation to the premium amount to normalize distribution and stabilize variance
- Stratified Sampling: Implemented stratified splits to maintain distribution of key variables across partitions
- Time-Based Splitting: For temporal data, used time-based splits to prevent data leakage
- Cross-Validation Strategy: Employed k-fold cross-validation with stratification for robust model evaluation
- Data Versioning: Implemented DVC (Data Version Control) to track dataset versions and ensure reproducibility
We implemented a sophisticated feature engineering pipeline to extract domain-specific insights and improve model performance:
- Health Risk Indicators: Created composite health risk scores based on medical literature:
- BMI Categories: Derived from BMI values following WHO guidelines:
'Underweight'(< 18.5)'Normal'(18.5–24.9)'Overweight'(25–29.9)'Obese Class I'(30-34.9)'Obese Class II'(35-39.9)'Obese Class III'(≥ 40)
- Medical Risk Score: Weighted scoring system based on medical conditions, with weights derived from actuarial tables
- Lifestyle Risk Index: Composite score combining smoking status, BMI category, and age
- BMI Categories: Derived from BMI values following WHO guidelines:
-
Age-Based Features:
- Age Groups: Binned into insurance-relevant categories:
'Young Adult'(18–30)'Adult'(31–45)'Middle Age'(46–60)'Senior'(61+)
- Age Polynomials: Quadratic and cubic terms to capture non-linear age effects
- Age-Gender Interaction: Capturing gender-specific age effects on health risks
- Age Groups: Binned into insurance-relevant categories:
-
Socioeconomic Indicators:
- Income-to-Dependents Ratio: Normalized income relative to family size
- Employment Risk Factor: Risk weighting based on employment status
- Regional Cost Adjustment: Region-specific cost of living index
-
High-Order Interactions:
- Smoking-BMI Interaction: Capturing compounded health risks
- Age-Medical History Interaction: Age-specific impact of medical conditions
- Income-Insurance Plan Interaction: Plan affordability based on income level
-
Temporal Features:
- Insurance Duration: Time with current insurance (if available)
- Medical History Duration: Time since diagnosis of conditions
-
Statistical Feature Selection:
- Mutual Information: Non-parametric measure of feature relevance
- ANOVA F-tests: For categorical feature significance
- Recursive Feature Elimination: With cross-validation (RFECV)
-
Model-Based Selection:
- L1 Regularization: Using Lasso regression for sparse feature selection
- Tree-Based Importance: Feature importance from Random Forest and XGBoost
- Permutation Importance: Model-agnostic feature evaluation
-
Dimensionality Reduction:
- Principal Component Analysis (PCA): For handling multicollinearity
- Feature Agglomeration: Hierarchical clustering of features
The final feature set was optimized for both predictive power and interpretability, with a focus on features that provide actionable insights for insurance pricing strategies.
We implemented a systematic model selection process to identify the optimal algorithm for insurance premium prediction:
We evaluated a diverse set of regression algorithms, each with distinct strengths:
-
Linear Models:
- Linear Regression: Baseline model with strong interpretability
- Ridge Regression: L2 regularization to handle multicollinearity
- Lasso Regression: L1 regularization for feature selection
- Elastic Net: Combined L1 and L2 regularization for balanced approach
-
Tree-Based Models:
- Decision Tree: Non-parametric model with natural feature interaction handling
- Random Forest: Ensemble of trees with reduced variance through bagging
- Gradient Boosting (XGBoost): Sequential tree building with gradient optimization
- LightGBM: Gradient boosting with GOSS and EFB for efficiency
- CatBoost: Gradient boosting with advanced categorical feature handling
-
Other Algorithms:
- Support Vector Regression (SVR): Kernel-based approach for non-linear relationships
- K-Nearest Neighbors (KNN): Instance-based learning for local patterns
- Gaussian Process Regression: Probabilistic approach with uncertainty quantification
- Neural Networks: Multi-layer perceptron for complex pattern recognition
We implemented a robust evaluation framework:
- Cross-Validation Strategy: 5-fold stratified cross-validation to ensure reliable performance estimates
- Nested Cross-Validation: For unbiased hyperparameter tuning and model selection
- Statistical Significance Testing: Paired t-tests and Wilcoxon signed-rank tests to compare model performance
- Learning Curves: To diagnose bias-variance tradeoff and sample size adequacy
Models were evaluated using multiple metrics to capture different aspects of performance:
| Metric | Description | Importance |
|---|---|---|
| RMSE | Root Mean Squared Error | Penalizes large errors, relevant for high-cost policies |
| MAE | Mean Absolute Error | Robust to outliers, interpretable in dollar terms |
| R² | Coefficient of Determination | Overall explanatory power of the model |
| MAPE | Mean Absolute Percentage Error | Relative error across premium ranges |
| MdAPE | Median Absolute Percentage Error | Robust measure of typical relative error |
After comprehensive evaluation, XGBoost emerged as the superior model with the following advantages:
- Highest cross-validated R² score (0.924)
- Lowest RMSE ($1,050.32)
- Strong performance across all premium ranges
- Ability to capture complex non-linear relationships and interactions
- Reasonable training and inference times
- Built-in feature importance for interpretability
We implemented a sophisticated training and evaluation pipeline for the selected XGBoost model:
We employed a multi-stage hyperparameter tuning approach:
- Coarse Grid Search: Initial broad parameter space exploration
- Bayesian Optimization: Using TPE (Tree-structured Parzen Estimator) for efficient parameter search
- Fine-tuning: Focused grid search around promising parameter regions
Optimized hyperparameters:
{
'learning_rate': 0.05,
'max_depth': 6,
'min_child_weight': 3,
'gamma': 0.2,
'subsample': 0.8,
'colsample_bytree': 0.8,
'reg_alpha': 0.1,
'reg_lambda': 1.0,
'n_estimators': 200
}- Early Stopping: Implemented with validation set monitoring to prevent overfitting
- Learning Rate Scheduling: Decreasing learning rate during training for fine convergence
- Sample Weighting: Applied weights inversely proportional to premium amount to balance error across price ranges
- Feature Importance Monitoring: Tracked feature importance stability across folds
The final model was evaluated using a held-out test set with the following results:
| Metric | Training Set | Validation Set | Test Set |
|---|---|---|---|
| RMSE | $980.45 | $1,025.78 | $1,050.32 |
| MAE | $750.32 | $785.67 | $798.45 |
| R² | 0.935 | 0.928 | 0.924 |
| MAPE | 8.5% | 9.2% | 9.4% |
-
Residual Analysis:
- Confirmed homoscedasticity using Breusch-Pagan test (p=0.42)
- Verified normality of residuals using Shapiro-Wilk test (p=0.38)
- Analyzed residuals across feature ranges to identify potential bias
-
Calibration Analysis:
- Evaluated prediction intervals using quantile regression
- 90% prediction intervals captured 88.7% of actual values
-
Fairness Assessment:
- Evaluated model bias across demographic groups
- Confirmed similar error distributions across gender and age groups
The final model demonstrates excellent predictive performance while maintaining fairness and reliability across different customer segments.
We implemented a production-grade deployment architecture with comprehensive MLOps practices to ensure reliability, scalability, and maintainability:
- FastAPI Framework: High-performance asynchronous API with automatic OpenAPI documentation
- Pydantic Models: Strong type validation and automatic request/response schema generation
- Multi-stage Endpoints:
/predict: Core prediction endpoint with JSON input/output/predict_batch: Batch prediction for multiple records/predict_form: HTML form-based interface for manual testing/model/metadata: Endpoint exposing model version and performance metrics
-
Model Serving:
- Efficient model loading with lazy initialization
- Request validation and preprocessing pipeline
- Response formatting with confidence intervals
- Comprehensive error handling and logging
-
Streamlit Dashboard:
- Interactive premium prediction interface
- Feature importance visualization
- What-if analysis for premium optimization
- Performance monitoring dashboards
-
Containerization:
- Multi-stage Docker builds for minimal image size
- Docker Compose for local development and testing
- Container health checks and graceful shutdown
- Environment-specific configuration via environment variables
-
Azure Deployment:
- Azure Container Registry for image management
- Azure Machine Learning for model registry and serving
- Azure App Service for web application hosting
- Azure Application Insights for monitoring and telemetry
-
Model Metadata: Comprehensive tracking of:
- Training dataset version and characteristics
- Hyperparameters and preprocessing steps
- Performance metrics on validation and test sets
- Feature importance and model interpretability metrics
-
Version Control:
- Semantic versioning for models (MAJOR.MINOR.PATCH)
- Automated model registration with metadata
- Model promotion workflow (dev → staging → production)
- Rollback capabilities for production incidents
-
Performance Monitoring:
- Real-time tracking of prediction latency and throughput
- Periodic evaluation on holdout datasets
- Automated performance regression detection
- Custom dashboards for business and technical stakeholders
-
Data Drift Detection:
- Statistical monitoring of input feature distributions
- Kolmogorov-Smirnov and Jensen-Shannon divergence tests
- Feature-level and overall drift metrics
- Configurable alerting thresholds
-
Logging and Tracing:
- Structured logging with correlation IDs
- Distributed tracing for request flow visualization
- Detailed error tracking with context
- Audit trail for all model predictions
-
Continuous Integration:
- Automated testing on pull requests
- Code quality and security scanning
- Model validation against baseline performance
- Documentation generation
-
Continuous Deployment:
- Automated deployment to development environment
- Staged rollout to production with canary testing
- Automated rollback on performance degradation
- Infrastructure-as-Code for environment consistency
Request:
POST /predict
{
"Age": 45,
"Gender": "Male",
"BMI_Category": "Overweight",
"Number_Of_Dependants": 2,
"Smoking_Status": "Smoker",
"Region": "Northeast",
"Marital_status": "Married",
"Employment_Status": "Employed",
"Income_Level": "Medium",
"Income_Lakhs": 12.5,
"Medical_History": "Hypertension",
"Insurance_Plan": "Silver"
}Response:
{
"prediction": 15420.75,
"confidence_interval": {
"lower_bound": 14250.30,
"upper_bound": 16590.20
},
"model_version": "2.1.3",
"feature_importance": {
"Smoking_Status": 0.35,
"Age": 0.15,
"Medical_History": 0.12,
"BMI_Category": 0.10,
"Income_Lakhs": 0.08
},
"prediction_id": "pred-2023-06-15-12345"
}This project has been implemented following a modular approach with the following components:
- Implemented data loading from source
- Split data into train, test, and validation sets (70%, 20%, 10%)
- Saved the split datasets for further processing
- Validated dataset schema and required columns
- Checked data types and value ranges
- Generated validation status report
- Engineered features:
- BMI categories (Underweight, Normal, Overweight, Obese)
- Age groups (Young Adult, Adult, Senior)
- Smoker interaction terms with BMI and age
- Family size feature
- Applied log transformation to the target variable (charges)
- Created preprocessing pipeline with:
- Imputation for missing values
- Standardization for numerical features
- One-hot encoding for categorical features
- Trained multiple regression models:
- Linear Regression
- Random Forest (with hyperparameter tuning)
- XGBoost (with hyperparameter tuning)
- Support Vector Regression (SVR)
- K-Nearest Neighbors (KNN)
- Implemented hyperparameter tuning using RandomizedSearchCV
- Evaluated models using RMSE, MAE, and R² metrics
- Selected the best performing model (XGBoost with optimized hyperparameters)
- Evaluated the best model on validation data
- Calculated final performance metrics
- Saved model parameters and metrics
- Created FastAPI application for model serving
- Implemented Streamlit web interface for user-friendly interaction
- Dockerized the application for easy deployment
Our analysis revealed the following factors have the most significant impact on insurance premiums:
- Smoking Status: The most influential factor, with smokers paying significantly higher premiums
- Age: Older individuals generally face higher premiums
- BMI: Higher BMI values correlate with increased premiums
- Region: Some geographical regions have higher average premiums
- Number of Children: More dependents generally leads to higher premiums
- Gender: Has a minor impact on premium calculations
The XGBoost model with optimized hyperparameters outperformed other algorithms with the following metrics:
| Metric | Value |
|---|---|
| RMSE | $1,050.32 |
| MAE | $798.45 |
| R² | 0.92 |
This indicates that our model can explain approximately 92% of the variance in insurance premium prices, making it a highly reliable tool for estimation. The hyperparameter tuning process significantly improved model performance compared to the default configuration.
# Clone repository
git clone https://github.com/username/insurance-premium-prediction.git
cd insurance-premium-prediction
# Run setup script (creates virtual environment and installs dependencies)
./setup.sh # Linux/Mac
# OR
setup.bat # Windows |
# Run all tests
pytest
# Run specific test modules
pytest tests/test_model.py
pytest tests/test_api.py
# Run with coverage report
pytest --cov=srcFor Streamlit access to the page
For quick access to the demo:
- URL: https://insurance-premium-demo.azurewebsites.net
- Username:
demo@example.com - Password:
demo123
- Modern UI: Clean, professional design with intuitive navigation
- Interactive Forms: User-friendly input forms with validation
- Visualizations: Feature importance charts and confidence intervals
- Navigation: Easy access to prediction, monitoring, and documentation pages
-
Prediction Endpoints:
POST /predict: JSON-based prediction with confidence intervals and feature importancePOST /predict_form: Form-based prediction with detailed resultsPOST /api/predict/enhanced: Advanced prediction with additional features
-
Monitoring Endpoints:
GET /monitoring: Interactive model monitoring dashboardGET /api/monitoring/metrics: Current model performance metricsGET /api/monitoring/drift: Data drift detection resultsGET /api/monitoring/performance: Historical performance dataGET /api/monitoring/retraining-history: Model version history
-
MLOps Endpoints:
POST /trigger-retraining: Trigger model retraining with custom data sourcesGET /instructions: Comprehensive user guide and documentation- Data source options for retraining:
- File upload: Upload new training data files
- File path: Specify path to existing data files
- URL: Load data from external URLs
- Default: Use the original training dataset
streamlit run streamlit_app.pyThe Streamlit dashboard provides a comprehensive, interactive interface with multiple tabs:
- User-friendly Input Forms: Intuitive sliders and dropdowns for all customer attributes
- Comparison Mode: Side-by-side comparison of different customer profiles
- Instant Predictions: Real-time premium calculations with confidence intervals
- Feature Importance: Interactive visualizations showing factors influencing premiums
- What-If Analysis: Tools to explore how changing inputs affects premium estimates
- Performance Metrics: Real-time tracking of R² score and MAE with trend analysis
- Data Drift Detection: Statistical tests and visualizations for feature distribution changes
- Prediction Distribution: Analysis of how predictions have changed over time
- Retraining History: Complete log of model versions and performance improvements
- One-Click Retraining: Button to trigger model retraining with email notifications
- Step-by-Step Guides: Comprehensive instructions for using all dashboard features
- Interactive Examples: Sample scenarios with explanations
- Model Documentation: Detailed information about the model methodology
- Interpretation Guidelines: Help understanding prediction results and confidence intervals
- MLOps Workflow: Documentation of the monitoring and retraining process
- Professional Design: Clean, modern interface suitable for business environments
- Responsive Layout: Works well on different screen sizes and devices
- Comprehensive Documentation: Built-in help and guidance for all features
- End-to-End MLOps: Complete workflow from prediction to monitoring to retraining
# Build Docker image
docker build -t insurance-premium-model .
# Run Docker container
docker run -p 8000:8000 insurance-premium-modelThis project includes a comprehensive MLOps implementation to ensure model quality, reliability, and maintainability in production.
We've implemented a dedicated model monitoring dashboard that provides real-time insights into model performance and data drift:
-
Data Drift Detection
- Interactive visualization of feature distributions over time
- Statistical tests (Kolmogorov-Smirnov, Chi-squared) to detect drift with p-value reporting
- Feature-level drift analysis with detailed metrics
- Color-coded status indicators for quick assessment
-
Model Performance Tracking
- Real-time visualization of key metrics (R², MAE) with trend analysis
- Performance thresholds with visual indicators
- Historical performance data with interactive charts
- Segment-level performance analysis
-
Retraining Management
- Flexible data source selection for retraining:
- Upload new training data files
- Specify file paths to existing data
- Load data from URLs
- Use default training data
- Data validation before retraining
- Interactive retraining process with progress tracking
- Comprehensive retraining history with version tracking
- Detailed retraining logs with performance improvements
- Email notifications for retraining completion
- Flexible data source selection for retraining:
-
Monitoring Dashboard Features
- User-friendly interface with intuitive navigation
- Interactive visualizations with drill-down capabilities
- Automated recommendations for model maintenance
- Comprehensive documentation and user guides
The model registry system provides:
-
Version Control
- Semantic versioning (MAJOR.MINOR.PATCH) for all models
- Detailed version history with timestamps and authors
- Performance metrics for each version
- Automated version promotion workflow
-
Model Metadata
- Algorithm details and hyperparameters
- Training dataset information and schema
- Performance metrics across different data segments
- Feature importance and model interpretability metrics
-
Model Deployment Management
- One-click promotion of models to production
- Automated canary deployments with performance validation
- Instant rollback capabilities for production incidents
- Comprehensive deployment logs and audit trails
The project can be deployed to Azure using the provided scripts:
- Azure Machine Learning workspace
- Azure Container Registry
- Azure App Service
- Azure Application Insights
- Azure Key Vault
- Real-time inference endpoint
- Batch inference endpoint
- Web application hosting
- Containerized deployment
- Application performance monitoring
- Custom alert rules
- Log analytics
- Telemetry collection
To deploy the model to Azure:
-
Configure Azure Settings
# Edit Azure configuration nano config/azure_config.yaml -
Run Deployment Script
# Make the script executable chmod +x deployment/azure/azure_setup.sh # Run the setup script ./deployment/azure/azure_setup.sh
-
Alternative Python Deployment
# Deploy using Python script python deployment/azure/azure_deploy.py --model-path artifacts/model_trainer/model.joblib -
Access Deployed Resources
- Model Endpoint: https://{endpoint-name}.azureml.ms/score
- Web Application: https://{app-service-name}.azurewebsites.net
- Application Insights: https://portal.azure.com/#{app-insights-name}
This project showcases expertise across the full spectrum of machine learning engineering and data science:
| 🧮 Data Science | 🔧 Engineering | ☁️ Cloud & DevOps |
|
• Statistical Analysis • Feature Engineering • Model Selection • Hyperparameter Tuning • Experiment Tracking • Uncertainty Quantification |
• Software Architecture • API Development • Testing & Validation • Data Pipeline Design • UI/UX Implementation • Performance Optimization |
• Azure Cloud Services • Docker Containerization • CI/CD Pipelines • Infrastructure as Code • Monitoring & Logging • Security Best Practices |
| 🔄 MLOps | 🛠️ Tools & Frameworks | 🧠 Domain Knowledge |
|
• Model Versioning • Drift Detection • Automated Retraining • Model Registry • A/B Testing • Performance Monitoring |
• Python, SQL • Scikit-learn, XGBoost • FastAPI, Streamlit • Pandas, NumPy • Docker, Git • Azure ML Services |
• Insurance Industry • Risk Assessment • Actuarial Principles • Regulatory Compliance • Business Metrics • Stakeholder Communication |
- Special thanks to the open-source community for the excellent tools and libraries that made this project possible
- Gratitude to the insurance domain experts who provided valuable insights for feature engineering
- Appreciation to Azure for their comprehensive cloud infrastructure for ML deployment