1. Structure
  2. AI & ML
  3. ML Models
  4. Foundation
  5. Basics
  • Home
  • What is TileDB?
  • Get Started
  • Explore Content
  • Accounts
    • Individual Accounts
      • Apply for the Free Tier
      • Profile
        • Overview
        • Cloud Credentials
        • Storage Paths
        • REST API Tokens
        • Credits
    • Organization Admins
      • Create an Organization
      • Profile
        • Overview
        • Members
        • Cloud Credentials
        • Storage Paths
        • Billing
      • API Tokens
    • Organization Members
      • Organization Invitations
      • Profile
        • Overview
        • Members
        • Cloud Credentials
        • Storage Paths
        • Billing
      • API Tokens
  • Catalog
    • Introduction
    • Data
      • Arrays
      • Tables
      • Single-Cell (SOMA)
      • Genomics (VCF)
      • Biomedical Imaging
      • Vector Search
      • Files
    • Code
      • Notebooks
      • Dashboards
      • User-Defined Functions
      • Task Graphs
      • ML Models
    • Groups
    • Marketplace
    • Search
  • Collaborate
    • Introduction
    • Organizations
    • Access Control
      • Introduction
      • Share Assets
      • Asset Permissions
      • Public Assets
    • Logging
    • Marketplace
  • Analyze
    • Introduction
    • Slice Data
    • Multi-Region Redirection
    • Notebooks
      • Launch a Notebook
      • Usage
      • Widgets
      • Notebook Image Dependencies
    • Dashboards
      • Dashboards
      • Streamlit
    • Preview
    • User-Defined Functions
    • Task Graphs
    • Serverless SQL
    • Monitor
      • Task Log
      • Task Graph Log
  • Scale
    • Introduction
    • Task Graphs
    • API Usage
  • Structure
    • Why Structure Is Important
    • Arrays
      • Introduction
      • Quickstart
      • Foundation
        • Array Data Model
        • Key Concepts
          • Storage
            • Arrays
            • Dimensions
            • Attributes
            • Cells
            • Domain
            • Tiles
            • Data Layout
            • Compression
            • Encryption
            • Tile Filters
            • Array Schema
            • Schema Evolution
            • Fragments
            • Fragment Metadata
            • Commits
            • Indexing
            • Array Metadata
            • Datetimes
            • Groups
            • Object Stores
          • Compute
            • Writes
            • Deletions
            • Consolidation
            • Vacuuming
            • Time Traveling
            • Reads
            • Query Conditions
            • Aggregates
            • User-Defined Functions
            • Distributed Compute
            • Concurrency
            • Parallelism
        • Storage Format Spec
      • Tutorials
        • Basics
          • Basic Dense Array
          • Basic Sparse Array
          • Array Metadata
          • Compression
          • Encryption
          • Data Layout
          • Tile Filters
          • Datetimes
          • Multiple Attributes
          • Variable-Length Attributes
          • String Dimensions
          • Nullable Attributes
          • Multi-Range Reads
          • Query Conditions
          • Aggregates
          • Deletions
          • Catching Errors
          • Configuration
          • Basic S3 Example
          • Basic TileDB Cloud
          • fromDataFrame
          • Palmer Penguins
        • Advanced
          • Schema Evolution
          • Advanced Writes
            • Write at a Timestamp
            • Get Fragment Info
            • Consolidation
              • Fragments
              • Fragment List
              • Consolidation Plan
              • Commits
              • Fragment Metadata
              • Array Metadata
            • Vacuuming
              • Fragments
              • Commits
              • Fragment Metadata
              • Array Metadata
          • Advanced Reads
            • Get Fragment Info
            • Time Traveling
              • Introduction
              • Fragments
              • Array Metadata
              • Schema Evolution
          • Array Upgrade
          • Backends
            • Amazon S3
            • Azure Blob Storage
            • Google Cloud Storage
            • MinIO
            • Lustre
          • Virtual Filesystem
          • User-Defined Functions
          • Distributed Compute
          • Result Estimation
          • Incomplete Queries
        • Management
          • Array Schema
          • Groups
          • Object Management
        • Performance
          • Summary of Factors
          • Dense vs. Sparse
          • Dimensions vs. Attributes
          • Compression
          • Tiling and Data Layout
          • Tuning Writes
          • Tuning Reads
      • API Reference
    • Tables
      • Introduction
      • Quickstart
      • Foundation
        • Data Model
        • Key Concepts
          • Indexes
          • Columnar Storage
          • Compression
          • Data Manipulation
          • Optimize Tables
          • ACID
          • Serverless SQL
          • SQL Connectors
          • Dataframes
          • CSV Ingestion
      • Tutorials
        • Basics
          • Ingestion with SQL
          • CSV Ingestion
          • Basic S3 Example
          • Running Locally
        • Advanced
          • Scalable Ingestion
          • Scalable Queries
      • API Reference
    • AI & ML
      • Vector Search
        • Introduction
        • Quickstart
        • Foundation
          • Data Model
          • Key Concepts
            • Vector Search
            • Vector Databases
            • Algorithms
            • Distance Metrics
            • Updates
            • Deployment Methods
            • Architecture
            • Distributed Compute
          • Storage Format Spec
        • Tutorials
          • Basics
            • Ingestion & Querying
            • Updates
            • Deletions
            • Basic S3 Example
            • Running Locally
          • Advanced
            • Versioning
            • Time Traveling
            • Consolidation
            • Distributed Compute
            • RAG LLM
            • LLM Memory
            • File Search
            • Image Search
            • Protein Search
          • Performance
        • API Reference
      • ML Models
        • Introduction
        • Quickstart
        • Foundation
          • Basics
          • Storage
          • Cloud Execution
          • Why TileDB for Machine Learning
        • Tutorials
          • Ingestion
            • Data Ingestion
              • Dense Datasets
              • Sparse Datasets
            • ML Model Ingestion
          • Management
            • Array Schema
            • Machine Learning: Groups
            • Time Traveling
    • Life Sciences
      • Single-cell
        • Introduction
        • Quickstart
        • Foundation
          • Data Model
          • Key Concepts
            • Data Structures
            • Use of Apache Arrow
            • Join IDs
            • State Management
            • TileDB Cloud URIs
          • SOMA API Specification
        • Tutorials
          • Data Ingestion
          • Bulk Ingestion Tutorial
          • Data Access
          • Distributed Compute
          • Basic S3 Example
          • Multi-Experiment Queries
          • Appending Data to a SOMA Experiment
          • Add New Measurements
          • SQL Queries
          • Running Locally
          • Shapes in TileDB-SOMA
          • Drug Discovery App
        • Spatial
          • Introduction
          • Foundation
            • Spatial Data Model
            • Data Structures
          • Tutorials
            • Spatial Data Ingestion
            • Access Spatial Data
            • Manage Coordinate Spaces
        • API Reference
      • Population Genomics
        • Introduction
        • Quickstart
        • Foundation
          • Data Model
          • Key Concepts
            • The N+1 Problem
            • Architecture
            • Arrays
            • Ingestion
            • Reads
            • Variant Statistics
            • Annotations
            • User-Defined Functions
            • Tables and SQL
            • Distributed Compute
          • Storage Format Spec
        • Tutorials
          • Basics
            • Basic Ingestion
            • Basic Queries
            • Export to VCF
            • Add New Samples
            • Deleting Samples
            • Basic S3 Example
            • Basic TileDB Cloud
          • Advanced
            • Scalable Ingestion
            • Scalable Queries
            • Query Transforms
            • Handling Large Queries
            • Annotations
              • Finding Annotations
              • Embedded Annotations
              • External Annotations
              • Annotation VCFs
              • Ingesting Annotations
            • Variant Statistics
            • Tables and SQL
            • User-Defined Functions
            • Sample Metadata
            • Split VCF
          • Performance
        • API Reference
          • Command Line Interface
          • Python API
          • Cloud API
      • Biomedical Imaging
        • Introduction
        • Foundation
          • Data Model
          • Key Concepts
            • Arrays
            • Ingestion
            • Reads
            • User Defined Functions
          • Storage Format Spec
        • Quickstart
        • Tutorials
          • Basics
            • Ingestion
            • Read
              • OpenSlide
              • TileDB-Py
          • Advanced
            • Batched Ingestion
            • Chunked Ingestion
            • Machine Learning
              • PyTorch
            • Napari
    • Files
  • API Reference
  • Self-Hosting
    • Installation
    • Upgrades
    • Administrative Tasks
    • Image Customization
      • Customize User-Defined Function Images
      • AWS ECR Container Registry
      • Customize Jupyter Notebook Images
    • Single Sign-On
      • Configure Single Sign-On
      • OpenID Connect
      • Okta SCIM
      • Microsoft Entra
  • Glossary

On this page

  • Approaches
  • Lifecycle
    • Data fetching and wrangling
    • Model design and training
    • Model deployment and serving
  1. Structure
  2. AI & ML
  3. ML Models
  4. Foundation
  5. Basics

Basics of ML Models

ai/ml
machine learning (ml)
foundation
Learn about Machine Learning, different approaches to ML, and the ML lifecycle.

Machine learning (ML) is a subfield of artificial intelligence (AI) focused on developing algorithms that allow computers to learn and improve from experience without being explicitly programmed, imitating intelligent human behavior. It finds applications in a wide range of domains, including image and speech recognition, natural language processing, autonomous vehicles, recommendation systems, healthcare, finance, and more. Its ability to analyze large datasets, detect patterns, and make predictions has revolutionized many industries, leading to improved decision-making, automation of tasks, and the development of innovative products and services. At its core, machine learning starts with data—numbers, photos, text, time series, or data from sensors.

The first phase involves gathering and preparing data that the ML model will use as training data to train itself. Next, the [human] programmer must choose a machine learning model to use, supply the data, and let the computer model train itself to find patterns or make predictions. Over time, the programmer can also tweak the model, including changing its parameters, to assist in advancing it towards more precise outcomes.

Approaches

Machine learning has three broad subcategories:

  • Supervised Learning: In supervised learning, a model is trained on labeled data, where each input example is associated with a corresponding target or output. The goal for the system is to learn a mapping from inputs to outputs, enabling the model to make predictions on new, unseen data.
  • Unsupervised Learning: Unsupervised learning involves training models on unlabeled data, where the algorithm aims to find hidden patterns or structures in the data without explicit guidance. Common tasks include clustering similar data points together or dimensionality reduction for data visualization and compression.
  • Reinforcement Learning: Reinforcement learning is about training agents to make sequential decisions in an environment to maximize a cumulative reward. The agent learns through an iterative process, receiving feedback from the environment in the form of rewards or penalties based on its actions.

Each approach has different algorithms and techniques used to train machine learning models, such as decision trees, neural networks, support vector machines, and clustering algorithms. Additionally, machine learning has specialized areas like deep learning, which involves training deep neural networks with many layers to learn complex patterns in data.

Lifecycle

Data science and ML teams need to experiment with the data and train learning models, to help push them toward more accurate results. This is one of the basic parts of the machine learning lifecycle. This lifecycle has three main stages:

  1. Data fetching and wrangling
  2. Model design and training
  3. Model deployment and serving

Data fetching and wrangling

At this stage, you structure the data pipeline for preprocessing and fetch data from one or more sources. These sources can differ, depending on the application. In the most common applications, the data come from sources like a database, a streaming service, or even just plain files. On the operational front, the diversity and the variety of these data sources require you to build loaders and create the interface, after which you can integrate them with different ML tools available. Feature engineering plays a crucial role, where you craft and select relevant features to enhance model performance. For this exact reason, you may need to wrangle your data in a preprocessing step. A typical preprocessing step involves one or more of the following:

  1. Clean outlying data points from the data.
  2. Pass data through functions, which will map them in a different dimensionality (for example, kernels).
  3. Change the shape of or transpose the data, to become consistent with the model’s expected input.

Model design and training

Model selection involves experimenting with different architectures, hyperparameters, and evaluation metrics to identify the optimal configuration. Throughout this iterative process, you can use cross-validation techniques to ensure robustness and generalization. Once you have the final model architecture, training begins, often leveraging powerful hardware accelerators. During this iterative process, you’ll perform a series of experiments (for example, different algorithms, alternative datasets, hyperparameter tuning, and so on). The results of these experiments produce different models, which you need to track and compare. After comparing the models, you’ll deploy the best model for your use case. This yields another data management problem: model storage, versioning, comparison, and general management of ML models become significant concerns. Thus, you can think of the entire machine learning lifecycle as a data management problem.

Model deployment and serving

In the last step of this cycle, you need to store, train (correctly), test, and monitor an ML model (which you can serve through an endpoint). In this stage, the focus shifts from development to deployment. Once the trained model is ready, you need to integrate the model into a production environment to serve predictions in real-time or batch processing. This involves containerizing the model for easy deployment and management. The serving infrastructure must be scalable, reliable, and performant to handle varying loads and ensure low latency. Additionally, you can use versioning and A/B testing to manage model updates and assess their impact on business objectives. Security measures, such as encryption and access control, safeguard the deployed models and sensitive data.

Continue reading to learn how TileDB addresses the data management problems commonly associated with the machine learning lifecycle.

Foundation
Storage