Exercise Part 4: Train a Machine Learning Model Using Azure ML
Ready to play the role of a machine learning maestro? In this exercise, we’ll dive into Microsoft Azure Machine Learning’s automated feature to train a model that predicts bicycle rentals. Think of it as a chef trying different ingredients to whip up the best dish!
Step 1: Understanding Automated Machine Learning
- What It Does: Automated machine learning tests various methods and algorithms to find the best model for your data. It’s like a talent show for algorithms, where the best performer wins!
Step 2: Setting Up an Experiment
- Automated ML Page: In Azure Machine Learning studio, find the Automated ML page (look under Author).
- Create a New Automated ML Run:
- Select Dataset: Use the ‘bike-rentals’ dataset.
- Configure Run:
- Experiment Name: mslearn-bike-rental
- Target Column: rentals (this is the main star, the value you want to predict)
- Training Compute Target: Use the compute cluster you created earlier.
- Task Type and Settings:
- Task Type: Regression (since you’re predicting a number)
- Additional Configurations:
- Primary Metric: Normalized root mean square error (a fancy way of measuring accuracy)
- Explain Best Model: Selected (to understand which features matter most)
- Blocked Algorithms: Only use RandomForest and LightGBM (to save time)
- Exit Criterion:
- Training Job Time (hours): 0.25 (15 minutes)
- Metric Score Threshold: 0.08 (stops the experiment if it finds a model this good or better)
- Featurization Settings:
- Enable Featurization: Selected (let Azure ML prep the data for you)
Step 3: Running the Experiment
- Start the Magic: Submit the details and watch as the experiment kicks off. First, it will prepare, then start running. It might be coffee break time while you wait!
Step 4: Reviewing the Best Model
- Best Model Summary: Once the experiment is done, check out the Details tab for a summary of the winning model.
- Model Details: Select the Algorithm name to dive deeper. The model’s success is based on how small the Normalized root mean square error is – the smaller, the better.
Step 5: Analyzing Model Performance
- Check Other Metrics: On the Explanations tab, explore other evaluation metrics for your regression model.
- Understanding Predictions and Errors:
- Predicted vs. True Chart: Look for a diagonal trend showing that predictions are close to the actual values.
- Residual Histogram: Here, you want most errors (differences between predicted and actual values) to be small, clustered around 0.
Step 6: Feature Influence
- Global Importance Chart: This shows which features in your dataset most influence the label prediction. It’s like finding out which spices made the dish a hit!
And there you have it! You’ve just trained a machine learning model to predict bicycle rentals. Who knew numbers could tell such exciting stories?






Leave a Reply