1. Model Training & Deployment
- Model Artifacts: After training, the model is packaged with trained parameters, a model definition, and metadata. These artifacts are stored (usually in Amazon S3) and combined with inference code for deployment.
- Inference Code: The software that reads the model artifacts and implements the model for predictions.
2. Inference Options
- Real-Time Inference:
Use case: For low-latency, high-throughput requests (e.g., instant predictions).
Deployment: The model is deployed to a persistent endpoint to handle ongoing requests.
Example: Real-time fraud detection. - Batch Inference:
Use case: For large datasets processed at once, where speed isn’t critical.
Deployment: The model runs when batch jobs are executed, and computing resources are used only during processing.
Example: Monthly inventory forecasting using historical sales data.
3. Machine Learning Styles
- Supervised Learning:
How it works: The model is trained with labeled data (input-output pairs).
Example: Classifying images of fish vs. other animals (input: image, output: label “fish” or “not fish”).
Challenge: Requires extensive labeling of data, which can be time-consuming. Amazon offers SageMaker Ground Truth to help with data labeling through crowdsourcing.
- Unsupervised Learning:
How it works: The model is trained with data that has features but no labels. It finds patterns, groups, or clusters data.
Use cases: Pattern recognition, anomaly detection, and data grouping.
Example: Clustering network traffic to identify security threats or detecting sensor anomalies (e.g., identifying a failing temperature sensor in an oil well).
Benefits: Does not require labeled data, making it easier to set up.
- Reinforcement Learning:
How it works: An agent learns by interacting with an environment, receiving rewards or penalties based on actions taken.
Use case: Autonomous decision-making.
Training: The agent learns through trial and error, refining actions to achieve goals.
Example: AWS DeepRacer – teaching a race car (the agent) to drive on a track efficiently.
Goal: Unlike unsupervised learning, reinforcement learning has a defined end goal that the agent works towards through continuous improvement.
4. Key Differences in Learning Styles
- Supervised Learning: Needs labeled data (input-output pairs).
- Unsupervised Learning: Works with unlabeled data to identify patterns or clusters.
- Reinforcement Learning: The agent learns through actions and rewards in an environment to achieve a goal, without labeled input.
Key Terms to Remember:
- Model Artifacts: Files containing trained parameters and metadata, stored for deployment.
- Inference Code: Software that implements the model and makes predictions.
- Real-Time Inference: Model is deployed to an endpoint for continuous, low-latency requests.
- Batch Inference: Inferences are processed in bulk, typically offline, with no persistent endpoint.
- Supervised Learning: Learning from labeled data (input-output pairs).
- Unsupervised Learning: Learning from unlabeled data to find patterns or groups.
- Reinforcement Learning: Learning through trial and error to achieve goals, rewarded for correct actions.