> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SageMaker Built in Algorithms

> Overview of Amazon SageMaker built-in algorithms, their use cases, supported data types, benefits, and example usage for scalable training, model families like tabular, NLP, vision, time-series, and unsupervised

Amazon SageMaker provides a suite of built-in algorithms that are pre-packaged in containers and optimized for scalable training. These algorithms let you focus on preparing data and choosing hyperparameters while SageMaker manages dependencies, distributed training, and infrastructure. They support multiple input modes (file and pipe) and are suitable for tabular, text (NLP), image (vision), unsupervised, and time-series problems. You can launch them programmatically from the SageMaker SDK or from the console, and they integrate with other SageMaker services like Pipelines and Clarify.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/X8TnA5cnzmjKZ8gW/images/AWS-Certified-Machine-Learning-Engineer-Associate/ML-Model-Development/SageMaker-Built-in-Algorithms/amazon-sagemaker-built-in-algorithms-intro.jpg?fit=max&auto=format&n=X8TnA5cnzmjKZ8gW&q=85&s=01629a2843f9948768a99d27f24124b3" alt="The image is an introduction slide about Amazon SageMaker's built-in algorithms, highlighting features like being prebuilt and containerized, optimized for performance, scalable training, flexible data input, and wide use cases." width="1920" height="1080" data-path="images/AWS-Certified-Machine-Learning-Engineer-Associate/ML-Model-Development/SageMaker-Built-in-Algorithms/amazon-sagemaker-built-in-algorithms-intro.jpg" />
</Frame>

What are foundation models?

Foundation models are very large, general-purpose neural networks trained on broad, diverse datasets. They provide high-quality base capabilities (for example, language understanding or image feature extraction) and can be fine-tuned for downstream tasks such as classification, summarization, retrieval, or question answering.

Why use SageMaker built-in algorithms?

* Reduce engineering overhead: no custom low-level training loop required for many common tasks.
* Optimized performance: containers are tuned for distributed training and production-ready performance.
* Easy to launch: accessible via the SageMaker SDK or the AWS console for fast experimentation.
* Scalable: run across multiple instances, GPUs, or CPUs for larger datasets and faster training.
* Ecosystem integration: works with [SageMaker Pipelines](https://aws.amazon.com/sagemaker/pipelines/) for CI/CD and [SageMaker Clarify](https://aws.amazon.com/sagemaker/clarify/) for bias and explainability.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/X8TnA5cnzmjKZ8gW/images/AWS-Certified-Machine-Learning-Engineer-Associate/ML-Model-Development/SageMaker-Built-in-Algorithms/built-in-algorithms-benefits-sagemaker.jpg?fit=max&auto=format&n=X8TnA5cnzmjKZ8gW&q=85&s=b66be90c9a68989fce9633e50126acc9" alt="The image outlines five benefits of using built-in algorithms, including no need to write training code, optimized performance, ease of use with SDK or console, scalability, and integration with SageMaker Pipelines and Clarify." width="1920" height="1080" data-path="images/AWS-Certified-Machine-Learning-Engineer-Associate/ML-Model-Development/SageMaker-Built-in-Algorithms/built-in-algorithms-benefits-sagemaker.jpg" />
</Frame>

These integrations simplify end-to-end ML workflows and improve transparency and monitoring for trained models.

Supported data types and algorithm families

You will commonly find built-in algorithms that address the following categories: tabular, text (NLP), time series, unsupervised learning, and vision. Each family targets specific input formats and use cases.

Tabular ML

Tabular (structured) data is organized in rows and columns—like CSV, SQL tables, or spreadsheet files. Typical tabular use cases include customer segmentation, fraud detection, and churn prediction. SageMaker includes efficient algorithms for regression, classification, ranking, and embeddings for categorical features.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/X8TnA5cnzmjKZ8gW/images/AWS-Certified-Machine-Learning-Engineer-Associate/ML-Model-Development/SageMaker-Built-in-Algorithms/machine-learning-algorithms-tabular-data.jpg?fit=max&auto=format&n=X8TnA5cnzmjKZ8gW&q=85&s=d8ec182d293f89abbaf0d8f5a92896d0" alt="The image outlines types of machine learning algorithms that work with tabular data, highlighting use cases such as customer segmentation, fraud detection, and churn prediction. It mentions the use of structured data organized in rows and columns, like CSV files, SQL tables, and Excel sheets." width="1920" height="1080" data-path="images/AWS-Certified-Machine-Learning-Engineer-Associate/ML-Model-Development/SageMaker-Built-in-Algorithms/machine-learning-algorithms-tabular-data.jpg" />
</Frame>

Common tabular algorithms in SageMaker:

* Linear Learner — classification and regression with linear models.
* XGBoost — gradient-boosted decision trees (classification/regression).
* Factorization Machines — effective for sparse features and recommendation systems.
* K-Nearest Neighbors (KNN) — instance-based classification and regression for small/medium datasets.
* Object2Vec — learn embeddings for categorical and tabular features.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/X8TnA5cnzmjKZ8gW/images/AWS-Certified-Machine-Learning-Engineer-Associate/ML-Model-Development/SageMaker-Built-in-Algorithms/machine-learning-algorithms-tabular-data-2.jpg?fit=max&auto=format&n=X8TnA5cnzmjKZ8gW&q=85&s=385e29afb5a58c2ab48fe95a6b8597cc" alt="The image lists four types of machine learning algorithms for tabular data: Linear Learner, XGBoost, Factorization Machines, and K-Nearest Neighbors (KNN), each with a brief description of their use cases." width="1920" height="1080" data-path="images/AWS-Certified-Machine-Learning-Engineer-Associate/ML-Model-Development/SageMaker-Built-in-Algorithms/machine-learning-algorithms-tabular-data-2.jpg" />
</Frame>

Text (NLP)

Text-based ML handles unstructured natural language data: emails, reviews, articles, and social media. Use cases include sentiment analysis, document classification, spam detection, translation, and summarization. SageMaker offers built-in algorithms and JumpStart models for many NLP tasks.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/X8TnA5cnzmjKZ8gW/images/AWS-Certified-Machine-Learning-Engineer-Associate/ML-Model-Development/SageMaker-Built-in-Algorithms/machine-learning-algorithms-text-diagram.jpg?fit=max&auto=format&n=X8TnA5cnzmjKZ8gW&q=85&s=cf7062571d639bae456e22e26cb42b60" alt="The image is a diagram showcasing types of machine learning algorithms for text, highlighting use cases such as document classification, sentiment analysis, and spam detection, with examples including emails, reviews, news articles, and tweets." width="1920" height="1080" data-path="images/AWS-Certified-Machine-Learning-Engineer-Associate/ML-Model-Development/SageMaker-Built-in-Algorithms/machine-learning-algorithms-text-diagram.jpg" />
</Frame>

Text algorithms and approaches:

* BlazingText — fast word2vec-style embeddings and text classification.
* Sequence-to-sequence models — translation and abstractive summarization.
* BERT-based classifiers — available via [Amazon SageMaker JumpStart](https://aws.amazon.com/sagemaker/jumpstart/).
* LDA — topic modeling for unsupervised text clustering.
* Object2Vec — embeddings when combining text with categorical/tabular features.

Time Series

Time-series models learn trends and seasonality from timestamped data and forecast future values. Typical applications include IoT sensor monitoring, inventory/sales forecasting, and financial time-series forecasting.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/X8TnA5cnzmjKZ8gW/images/AWS-Certified-Machine-Learning-Engineer-Associate/ML-Model-Development/SageMaker-Built-in-Algorithms/machine-learning-timeseries-algorithms-summary.jpg?fit=max&auto=format&n=X8TnA5cnzmjKZ8gW&q=85&s=243968e32da7e2de38f23538552e8511" alt="The image explains types of machine learning algorithms focusing on timeseries, highlighting use cases such as IoT sensor monitoring, stock price forecasting, and sales prediction, with examples like temperature, stock prices, or foot traffic data." width="1920" height="1080" data-path="images/AWS-Certified-Machine-Learning-Engineer-Associate/ML-Model-Development/SageMaker-Built-in-Algorithms/machine-learning-timeseries-algorithms-summary.jpg" />
</Frame>

Unsupervised Learning

Unsupervised learning uncovers patterns without labeled targets. Typical tasks include clustering, dimensionality reduction, anomaly detection, and topic discovery. These techniques are useful for customer segmentation, exploratory data analysis, and streaming anomaly detection.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/X8TnA5cnzmjKZ8gW/images/AWS-Certified-Machine-Learning-Engineer-Associate/ML-Model-Development/SageMaker-Built-in-Algorithms/unsupervised-machine-learning-patterns-use-cases.jpg?fit=max&auto=format&n=X8TnA5cnzmjKZ8gW&q=85&s=8ede21a6f76fa918aa751fb5c17f12d9" alt="The image describes unsupervised machine learning, highlighting its ability to find hidden patterns in data without labeled outputs, with use cases such as topic modeling, customer segmentation, and anomaly detection. Examples of methods include clustering, dimensionality reduction, and association rules." width="1920" height="1080" data-path="images/AWS-Certified-Machine-Learning-Engineer-Associate/ML-Model-Development/SageMaker-Built-in-Algorithms/unsupervised-machine-learning-patterns-use-cases.jpg" />
</Frame>

Common unsupervised algorithms:

* K-Means — clustering.
* PCA (Principal Component Analysis) — dimensionality reduction for visualization and preprocessing.
* Random Cut Forest (RCF) — anomaly detection for time-series and streaming use cases.
* LDA — unsupervised topic modeling for text.

Vision ML

Vision ML works with images and video data for tasks such as classification, detection, segmentation, and embedding-based retrieval. Use cases include medical imaging, satellite image analysis, OCR, and visual search.

Vision capabilities include:

* Image classification (single-label/multi-label).
* Object detection (SSD-based models).
* Semantic segmentation — pixel-wise classification, valuable in medical and remote-sensing domains.
* Image embeddings (Object2Vec) — for similarity search and retrieval.

Consolidated algorithm summary

| Category     | Algorithms / Models                                                  | Typical Use Cases                                                        |
| ------------ | -------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| Tabular      | Linear Learner, XGBoost, Factorization Machines, KNN, Object2Vec     | Classification, regression, recommendation, ranking                      |
| Text (NLP)   | BlazingText, Seq2Seq, BERT (JumpStart), LDA, Object2Vec              | Classification, sentiment, translation, summarization, topic modeling    |
| Time Series  | Forecasting algorithms, RCF                                          | Forecasting, monitoring, anomaly detection                               |
| Unsupervised | K-Means, PCA, RCF, LDA                                               | Clustering, dimensionality reduction, anomaly detection, topic discovery |
| Vision       | Image classification, SSD object detection, segmentation, embeddings | Detection, segmentation, visual search, medical imaging                  |

SageMaker built-in containers and input formats

Built-in algorithms expect specific input formats depending on the algorithm: CSV, libsvm, RecordIO, or TFRecord. Check the algorithm documentation for required channel names (for example, `train` and `validation`) and input format before launching training jobs.

<Callout icon="lightbulb" color="#1CB2FE">
  Built-in and framework containers often expect specific data formats (e.g., CSV, RecordIO, or libsvm). Check the algorithm documentation for required input formats and channel names before running training.
</Callout>

SageMaker SDK example: train XGBoost in Script Mode

This concise example shows how to run a SageMaker XGBoost training job using the SageMaker Python SDK in Script Mode. Replace the placeholder values for the IAM role and S3 paths with your own.

```python theme={null}
from sagemaker.xgboost import XGBoost

# Replace these values for your environment
role = "arn:aws:iam::123456789012:role/SageMakerRole"
s3_train_path = "s3://your-bucket/path/train"
s3_val_path = "s3://your-bucket/path/validation"

xgb = XGBoost(
    entry_point="train.py",             # your training script
    role=role,
    instance_count=1,
    instance_type="ml.m5.xlarge",
    framework_version="1.3-1",          # XGBoost container version
    hyperparameters={
        "max_depth": 5,
        "eta": 0.2,
        "objective": "binary:logistic",
        "num_round": 100,
    },
)

# Map channel names to S3 locations and start the training job
xgb.fit({"train": s3_train_path, "validation": s3_val_path})
```

This example demonstrates:

* Launching a managed SageMaker training job with the XGBoost built-in container.
* Using Script Mode (`entry_point="train.py"`) so you can provide custom preprocessing and training code.
* Specifying compute resources (instance type and count) and hyperparameters.
* Providing `train` and `validation` channels that point to S3 prefixes.

Further reading and references

* [Amazon SageMaker Documentation](https://docs.aws.amazon.com/sagemaker/latest/dg/whatis.html)
* [SageMaker JumpStart models and solutions](https://aws.amazon.com/sagemaker/jumpstart/)
* [SageMaker Pipelines](https://aws.amazon.com/sagemaker/pipelines/)
* [SageMaker Clarify](https://aws.amazon.com/sagemaker/clarify/)
* [SageMaker Python SDK — Estimators](https://sagemaker.readthedocs.io/en/stable/api/training/estimators.html)

End of article.

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/aws-machine-learning-associates/module/f3f28bdc-5ae5-43bb-85b6-01f7b1bfb71b/lesson/3715ee50-3846-428e-bc51-fcc75fa715df" />
</CardGroup>
