### Full Installation from Source (CPU) Source: https://auto.gluon.ai/stable/install.html Installs AutoGluon from source for CPU. This involves cloning the repository, installing PyTorch with CPU support, and running a full installation script. ```bash pip install uv python -m uv pip install -U torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu git clone https://github.com/autogluon/autogluon ./autogluon/full_install.sh ``` -------------------------------- ### Install AutoGluon CPU with UV on Linux Source: https://auto.gluon.ai/dev/install.html Installs the UV package installer and then the CPU version of AutoGluon using uv. ```bash # Install UV package installer (faster than pip) pip install -U uv # Install AutoGluon python -m uv pip install autogluon --extra-index-url https://download.pytorch.org/whl/cpu ``` -------------------------------- ### Install AutoGluon GPU with UV on Linux Source: https://auto.gluon.ai/dev/install.html Installs the UV package installer and then the GPU version of AutoGluon using uv. ```bash # Install UV package installer (faster than pip) pip install -U uv # Install AutoGluon with GPU support python -m uv pip install autogluon ``` -------------------------------- ### Install AutoGluon Source CPU with UV on Linux Source: https://auto.gluon.ai/dev/install.html Installs UV, PyTorch CPU, clones the AutoGluon repository, and runs the full installation script. ```bash pip install uv python -m uv pip install -U torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu git clone https://github.com/autogluon/autogluon ./autogluon/full_install.sh ``` -------------------------------- ### Launch Tensorboard for Monitoring Source: https://auto.gluon.ai/dev/tutorials/multimodal/text_prediction/multilingual_text.html Start Tensorboard to monitor the training progress of your AutoGluon model. Ensure Tensorboard is installed and use the provided log directory. ```shell # Assume you have installed tensorboard tensorboard --logdir /home/ci/autogluon/docs/tutorials/multimodal/text_prediction/AutogluonModels/ag-20260527_092525 ``` -------------------------------- ### Install AutoGluon with UV (CPU) Source: https://auto.gluon.ai/stable/install.html Installs AutoGluon with CPU support using the UV package installer for faster installations. First, install UV, then install AutoGluon. ```bash # Install UV package installer (faster than pip) pip install -U uv # Install AutoGluon python -m uv pip install autogluon --extra-index-url https://download.pytorch.org/whl/cpu ``` -------------------------------- ### Install PyTorch for CPU (Windows) Source: https://auto.gluon.ai/stable/install.html Install the CPU version of PyTorch using uv pip. This is a prerequisite for installing AutoGluon on Windows without GPU support. ```bash pip install uv python -m uv pip install -U torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu ``` -------------------------------- ### Install AutoGluon with Foundational Model Support Source: https://auto.gluon.ai/dev/_sources/tutorials/tabular/tabular-foundational-models.ipynb.txt Install AutoGluon and specific foundational models using pip. Ensure you have `uv` installed for efficient package management. ```bash # Individual model installations: !pip install uv !uv pip install autogluon.tabular[mitra] # For Mitra !uv pip install autogluon.tabular[tabicl] # For TabICL !uv pip install autogluon.tabular[tabpfn] # For TabPFNv2 ``` -------------------------------- ### Fit with Advanced Presets and Deployment Optimization Source: https://auto.gluon.ai/dev/_modules/autogluon/tabular/predictor/predictor.html This example uses 'best_quality' for maximum accuracy and 'optimize_for_deployment' to reduce disk usage, demonstrating how to combine presets for specific needs. ```python from autogluon.tabular import TabularDataset, TabularPredictor train_data = TabularDataset('https://autogluon.s3.amazonaws.com/datasets/adult/train.csv') label = 'income' predictor = TabularPredictor(label=label) predictor.fit(train_data, presets=['best_quality', 'optimize_for_deployment']) ``` -------------------------------- ### Basic TabularPredictor Initialization and Fitting Source: https://auto.gluon.ai/stable/_modules/autogluon/tabular/predictor/predictor.html Initializes a TabularPredictor and fits it to the training data. This is a fundamental example for getting started with AutoGluon. ```python from autogluon.tabular import TabularDataset, TabularPredictor train_data = TabularDataset('https://autogluon.s3.amazonaws.com/datasets/Inc/train.csv') label = 'class' predictor = TabularPredictor(label=label).fit(train_data) ``` -------------------------------- ### Initialize and Fit TabMModel Source: https://auto.gluon.ai/dev/_modules/autogluon/tabular/models/tabm/tabm_model.html Demonstrates the process of initializing and fitting the TabMModel. It includes dependency checks, device selection, data splitting, preprocessing, and model training. Ensure 'autogluon.tabular[tabm]' is installed. ```python from autogluon.tabular.models.tabm.tabm_model import TabMModel # Assuming X, y are pandas DataFrame and Series respectively # Example usage: model = TabMModel() model.fit(X, y) ``` -------------------------------- ### Install AutoGluon Cloud Source: https://auto.gluon.ai/cloud/dev/_sources/index.md.txt Install the AutoGluon Cloud Python package using pip. Ensure your AWS resources are set up before running examples. ```bash pip install autogluon.cloud ``` -------------------------------- ### ModuleNotFoundError Example Source: https://auto.gluon.ai/dev/tutorials/multimodal/object_detection/quick_start/quick_start_coco.html This traceback illustrates a ModuleNotFoundError that can occur if the AutoGluon multimodal package or its dependencies are not installed correctly. Ensure all required packages are installed to avoid this error. ```python --------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) File ~/autogluon/multimodal/src/autogluon/multimodal/__init__.py:8, in 5 except ImportError: 6 pass ----> 8 from .predictor import MultiModalPredictor File ~/autogluon/multimodal/src/autogluon/multimodal/predictor.py:19, in 16 from autogluon.core.metrics import Scorer 18 from .constants import AUTOMM_TUTORIAL_MODE, FEW_SHOT_CLASSIFICATION, NER, OBJECT_DETECTION, SEMANTIC_SEGMENTATION ---> 19 from .learners import ( 20 BaseLearner, 21 EnsembleLearner, 22 FewShotSVMLearner, 23 MatchingLearner, 24 NERLearner, 25 ObjectDetectionLearner, 26 SemanticSegmentationLearner, 27 ) 28 from .utils import get_dir_ckpt_paths 29 from .utils.problem_types import PROBLEM_TYPES_REG File ~/autogluon/multimodal/src/autogluon/multimodal/learners/__init__.py:1, in ----> 1 from .base import BaseLearner 2 from .ensemble import EnsembleLearner 3 from .few_shot_svm import FewShotSVMLearner File ~/autogluon/multimodal/src/autogluon/multimodal/learners/base.py:71, in 31 from .. import version as ag_version 32 from ..constants import ( 33 BEST, 34 BEST_K_MODELS_FILE, (...) 69 ZERO_SHOT_IMAGE_CLASSIFICATION, 70 ) ---> 71 from ..data import ( 72 BaseDataModule, 73 MultiModalFeaturePreprocessor, 74 create_fusion_data_processors, 75 data_to_df, 76 get_mixup, 77 infer_column_types, 78 infer_dtypes_by_model_names, 79 infer_output_shape, 80 infer_problem_type, 81 infer_scarcity_mode_by_data_size, 82 init_df_preprocessor, 83 is_image_column, 84 split_train_tuning_data, 85 turn_on_off_feature_column_info, 86 ) 87 from ..models import ( 88 create_fusion_model, 89 get_model_postprocess_fn, (...) 92 select_model, 93 ) 94 from ..optim import ( 95 compute_score, 96 get_aug_loss_func, (...) 103 infer_metrics, 104 ) File ~/autogluon/multimodal/src/autogluon/multimodal/data/__init__.py:1, in ----> 1 from .datamodule import BaseDataModule 2 from .dataset import BaseDataset 3 from .dataset_mmlab import MultiImageMixDataset ``` -------------------------------- ### Bash Script Download Progress Example Source: https://auto.gluon.ai/stable/tutorials/multimodal/object_detection/data_preparation/prepare_voc.html This example shows the command-line output when using the Bash script to download VOC datasets, including progress indicators for each download stage. ```bash extract data in current directory Downloading VOC2007 trainval ... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 438M 100 438M 0 0 92.3M 0 0:00:04 0:00:04 --:--:-- 95.5M Downloading VOC2007 test data ... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 430M 100 430M 0 0 96.5M 0 0:00:04 0:00:04 --:--:-- 99.1M Downloading VOC2012 trainval ... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 73 1907M 73 1401M 0 0 108M 0 0:00:17 0:00:12 0:00:05 118M ``` -------------------------------- ### Predict Proba Multi Example Source: https://auto.gluon.ai/dev/api/autogluon.tabular.TabularPredictor.predict_proba_multi.html This example demonstrates how to get prediction probabilities for multiple models using predict_proba_multi. It shows the equivalent logic if predict_proba were called individually for each model. ```python predict_proba_dict = {} for m in models: predict_proba_dict[m] = predictor.predict_proba(data, model=m) ``` -------------------------------- ### bootstrap Source: https://auto.gluon.ai/cloud/dev/_sources/api/setup.rst.txt Initializes the AutoGluon-Cloud environment by setting up necessary AWS resources. ```APIDOC ## bootstrap ### Description Initializes the AutoGluon-Cloud environment by setting up necessary AWS resources. ### Method (Not specified, likely a function call in the SDK) ### Endpoint (Not applicable for SDK functions) ### Parameters (No specific parameters documented in the source) ### Request Example (Not applicable for SDK functions) ### Response (No specific response details documented in the source) ``` -------------------------------- ### Example Iterable Dataset Source: https://auto.gluon.ai/stable/api/autogluon.timeseries.TimeSeriesDataFrame.from_iterable_dataset.html Demonstrates the structure of the iterable dataset required for `TimeSeriesDataFrame.from_iterable_dataset`. Each dictionary must include a 'target' field for the time series values and a 'start' field for the starting timestamp. ```python iterable_dataset = [ {"target": [0, 1, 2], "start": pd.Period("01-01-2019", freq='D')}, {"target": [3, 4, 5], "start": pd.Period("01-01-2019", freq='D')}, {"target": [6, 7, 8], "start": pd.Period("01-01-2019", freq='D')} ] ``` -------------------------------- ### NER Prediction Output Source: https://auto.gluon.ai/dev/tutorials/multimodal/text_prediction/ner.html Example output detailing the predicted entities, their start and end positions, and entity groups for a given sentence. ```python Predicted entities: [{'entity_group': 'PLOT', 'start': np.int32(0), 'end': np.int32(4)}, {'entity_group': 'TITLE', 'start': np.int32(5), 'end': np.int32(15)}, {'entity_group': 'GENRE', 'start': np.int32(22), 'end': np.int32(30)}, {'entity_group': 'GENRE', 'start': np.int32(31), 'end': np.int32(44)}, {'entity_group': 'DIRECTOR', 'start': np.int32(74), 'end': np.int32(87)}] ``` -------------------------------- ### Getting Feature Link Chain Source: https://auto.gluon.ai/dev/_modules/autogluon/features/generators/abstract.html Constructs and returns the chain of feature dependencies, starting from the current generator and including all subsequent post-generators. ```python def get_feature_links_chain(self) -> List[Dict[str, List[str]]]: """Get the feature dependence chain between this generator and all of its post generators.""" features_out_internal = self._feature_metadata_before_post.get_features() generators = [self] + self._post_generators features_in_list = [self.features_in] + [generator.features_in for generator in self._post_generators] features_out_list = [features_out_internal] + [generator.features_out for generator in self._post_generators] feature_links_chain = [] for i in range(len(features_in_list)): generator = generators[i] features_in = features_in_list[i] features_out = features_out_list[i] feature_chain = generator._get_feature_links(features_in=features_in, features_out=features_out) feature_links_chain.append(feature_chain) return feature_links_chain ``` -------------------------------- ### Construct TimeSeriesDataFrame from Iterable Dataset Source: https://auto.gluon.ai/stable/api/autogluon.timeseries.TimeSeriesDataFrame.html This example shows how to construct a TimeSeriesDataFrame from an iterable dataset. Each element in the iterable should be a dictionary containing 'target' and 'start' information. ```python import pandas as pd from autogluon.timeseries import TimeSeriesDataFrame iterable_dataset = [ {"target": [0, 1, 2], "start": pd.Period("01-01-2019", freq='D')}, {"target": [3, 4, 5], "start": pd.Period("01-01-2019", freq='D')}, {"target": [6, 7, 8], "start": pd.Period("01-01-2019", freq='D')} ] tsf = TimeSeriesDataFrame.from_iterable_dataset(iterable_dataset) ``` -------------------------------- ### AutoGluon Training Initialization and System Info Source: https://auto.gluon.ai/stable/tutorials/tabular/advanced/tabular-custom-model.html This snippet displays the initial setup and system information for an AutoGluon training session. It includes the AutoGluon version, Python version, system specs, and recommended presets for optimal performance. ```text No path specified. Models will be saved in: "AutogluonModels/ag-20251219_224600" Verbosity: 2 (Standard Logging) =================== System Info =================== AutoGluon Version: 1.5.0b20251219 Python Version: 3.12.10 Operating System: Linux Platform Machine: x86_64 Platform Version: #1 SMP Wed Mar 12 14:53:59 UTC 2025 CPU Count: 8 Pytorch Version: 2.9.1+cu128 CUDA Version: 12.8 GPU Memory: GPU 0: 14.57/14.57 GB Total GPU Memory: Free: 14.57 GB, Allocated: 0.00 GB, Total: 14.57 GB GPU Count: 1 Memory Avail: 28.44 GB / 30.95 GB (91.9%) Disk Space Avail: 204.87 GB / 255.99 GB (80.0%) =================================================== No presets specified! To achieve strong results with AutoGluon, it is recommended to use the available presets. Defaulting to `'medium'`... Recommended Presets (For more details refer to https://auto.gluon.ai/stable/tutorials/tabular/tabular-essentials.html#presets): presets='extreme' : New in v1.5: The state-of-the-art for tabular data. Massively better than 'best' on datasets <100000 samples by using new Tabular Foundation Models (TFMs) meta-learned on https://tabarena.ai: TabPFNv2, TabICL, Mitra, TabDPT, and TabM. Requires a GPU and `pip install autogluon.tabular[tabarena]` to install TabPFN, TabICL, and TabDPT. presets='best' : Maximize accuracy. Recommended for most users. Use in competitions and benchmarks. presets='best_v150': New in v1.5: Better quality than 'best' and 5x+ faster to train. Give it a try! presets='high' : Strong accuracy with fast inference speed. presets='high_v150': New in v1.5: Better quality than 'high' and 5x+ faster to train. Give it a try! presets='good' : Good accuracy with very fast inference speed. presets='medium' : Fast training time, ideal for initial prototyping. Warning: hyperparameter tuning is currently experimental and may cause the process to hang. Beginning AutoGluon training ... Time limit = 20s AutoGluon will save models to "/home/ci/autogluon/docs/tutorials/tabular/advanced/AutogluonModels/ag-20251219_224600" Train Data Rows: 1000 Train Data Columns: 14 Label Column: class ``` -------------------------------- ### Prepare for Image Display Source: https://auto.gluon.ai/stable/tutorials/multimodal/multimodal_prediction/beginner_multimodal.html Retrieves the image path from the example row and imports necessary modules for displaying images. ```python example_image = example_row[image_col] from IPython.display import Image, display ``` -------------------------------- ### Display Example Image Source: https://auto.gluon.ai/dev/tutorials/multimodal/multimodal_prediction/beginner_multimodal.html Loads and displays the image corresponding to the first example row using IPython.display. Requires the 'example_image' path to be set. ```python example_image = example_row[image_col] from IPython.display import Image, display pil_img = Image(filename=example_image) display(pil_img) ``` -------------------------------- ### ModuleNotFoundError Example Source: https://auto.gluon.ai/dev/tutorials/multimodal/object_detection/advanced/finetune_coco.html This traceback indicates a `ModuleNotFoundError` when importing `MultiModalPredictor`, suggesting that the AutoGluon multimodal package or its dependencies might not be installed correctly or are not accessible in the current Python environment. ```python --------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) Cell In[3], line 1 ----> 1 from autogluon.multimodal import MultiModalPredictor File ~/autogluon/multimodal/src/autogluon/multimodal/__init__.py:8 5 except ImportError: 6 pass ----> 8 from .predictor import MultiModalPredictor File ~/autogluon/multimodal/src/autogluon/multimodal/predictor.py:19 16 from autogluon.core.metrics import Scorer 18 from .constants import ( 19 AUTOMM_TUTORIAL_MODE, FEW_SHOT_CLASSIFICATION, NER, OBJECT_DETECTION, SEMANTIC_SEGMENTATION 20 ) ---> 21 from .learners import ( 22 BaseLearner, 23 EnsembleLearner, 24 FewShotSVMLearner, 25 MatchingLearner, 26 NERLearner, 27 ObjectDetectionLearner, 28 SemanticSegmentationLearner, 29 ) 30 from .utils import get_dir_ckpt_paths 31 from .utils.problem_types import PROBLEM_TYPES_REG File ~/autogluon/multimodal/src/autogluon/multimodal/learners/__init__.py:1 ----> 1 from .base import BaseLearner 2 from .ensemble import EnsembleLearner 3 from .few_shot_svm import FewShotSVMLearner File ~/autogluon/multimodal/src/autogluon/multimodal/learners/base.py:71 31 from .. import version as ag_version 32 from ..constants import ( 33 BEST, 34 BEST_K_MODELS_FILE, (...) 69 ZERO_SHOT_IMAGE_CLASSIFICATION, 70 ) ---> 71 from ..data import ( 72 BaseDataModule, 73 MultiModalFeaturePreprocessor, 74 create_fusion_data_processors, 75 data_to_df, 76 get_mixup, 77 infer_column_types, 78 infer_dtypes_by_model_names, 79 infer_output_shape, 80 infer_problem_type, 81 infer_scarcity_mode_by_data_size, 82 init_df_preprocessor, 83 is_image_column, 84 split_train_tuning_data, 85 turn_on_off_feature_column_info, 86 ) 87 from ..models import ( 88 create_fusion_model, 89 get_model_postprocess_fn, (...) 92 select_model, 93 ) 94 from ..optim import ( 95 compute_score, ``` -------------------------------- ### Get Item Pointers (indptr) from TimeSeriesDataFrame Source: https://auto.gluon.ai/stable/_modules/autogluon/timeseries/dataset/ts_dataframe.html Retrieves a numpy array indicating the start and end indices for each time series within the DataFrame. Assumes the DataFrame is sorted by item_id and timestamp. ```python def get_indptr(self) -> np.ndarray: """[Advanced] Get a numpy array of shape [num_items + 1] that points to the start and end of each time series. This method assumes that the TimeSeriesDataFrame is sorted by [item_id, timestamp]. """ return np.concatenate([[0], np.cumsum(self.num_timesteps_per_item().to_numpy())]).astype(np.int32) ``` -------------------------------- ### AutoGluon-Cloud Setup API Usage Source: https://auto.gluon.ai/cloud/dev/_modules/autogluon/cloud/cloud_setup.html Demonstrates the basic usage of the AutoGluon-Cloud setup API functions for provisioning and managing cloud resources. ```Python from autogluon.cloud import bootstrap, register, status, teardown bootstrap() # deploy CFN + save config register(backend=, role=, bucket=, region=) # save existing resources status() # dict of StatusReport per backend teardown() # delete CFN + config (all backends) ``` -------------------------------- ### Get Index Pointer Array for TimeSeriesDataFrame Source: https://auto.gluon.ai/dev/_modules/autogluon/timeseries/dataset/ts_dataframe.html Retrieves a numpy array indicating the start and end indices for each time series within the DataFrame. Assumes the DataFrame is sorted by item_id and timestamp. ```python def get_indptr(self) -> np.ndarray: """[Advanced] Get a numpy array of shape [num_items + 1] that points to the start and end of each time series. This method assumes that the TimeSeriesDataFrame is sorted by [item_id, timestamp]. """ return np.concatenate([[0], np.cumsum(self.num_timesteps_per_item().to_numpy())]).astype(np.int32) ``` -------------------------------- ### Create TimeSeriesDataFrame from Iterable Dataset Source: https://auto.gluon.ai/dev/api/autogluon.timeseries.TimeSeriesDataFrame.from_iterable_dataset.html Constructs a TimeSeriesDataFrame from an iterable of dictionaries. Each dictionary must include a 'target' list and a 'start' pandas Period. This example demonstrates the expected format for the `iterable_dataset` parameter. ```python import pandas as pd iterable_dataset = [ {"target": [0, 1, 2], "start": pd.Period("01-01-2019", freq='D')}, {"target": [3, 4, 5], "start": pd.Period("01-01-2019", freq='D')}, {"target": [6, 7, 8], "start": pd.Period("01-01-2019", freq='D')} ] ts_df = TimeSeriesDataFrame.from_iterable_dataset(iterable_dataset) ``` -------------------------------- ### Display Dataset Sample Source: https://auto.gluon.ai/dev/_sources/tutorials/multimodal/advanced_topics/model_distillation.ipynb.txt Display a sample of the training split of the loaded QNLI dataset to inspect its structure. ```python dataset['train'] ``` -------------------------------- ### Get Multiclass Classification Properties Source: https://auto.gluon.ai/stable/_sources/tutorials/multimodal/advanced_topics/problem_types_and_metrics.ipynb.txt Retrieves and prints information about multiclass classification problem types, detailing supported input modalities and evaluation metrics. Use this to configure and understand multiclass classification setups. ```python multiclass_props = PROBLEM_TYPES_REG.get(MULTICLASS) print_problem_type_info("Multiclass Classification", multiclass_props) ``` -------------------------------- ### Launch Tensorboard for Monitoring Source: https://auto.gluon.ai/dev/tutorials/multimodal/semantic_matching/image_text_matching.html Launch Tensorboard to track the learning progress of your multimodal model. Ensure Tensorboard is installed and provide the log directory where models are saved. ```shell # Assume you have installed tensorboard tensorboard --logdir /home/ci/autogluon/docs/tutorials/multimodal/semantic_matching/AutogluonModels/ag-20260527_092305 ``` -------------------------------- ### BulkFeatureGenerator Example Source: https://auto.gluon.ai/dev/_modules/autogluon/features/generators/bulk.html Demonstrates a multi-stage feature generation pipeline using BulkFeatureGenerator with various generators like AsTypeFeatureGenerator, FillNaFeatureGenerator, CategoryFeatureGenerator, IdentityFeatureGenerator, and DropDuplicatesFeatureGenerator. This setup handles type conversion, NA filling, category encoding, and duplicate feature removal. ```python from autogluon.tabular import TabularDataset from autogluon.features.generators import AsTypeFeatureGenerator, BulkFeatureGenerator, CategoryFeatureGenerator, DropDuplicatesFeatureGenerator, FillNaFeatureGenerator, IdentityFeatureGenerator # noqa from autogluon.common.features.types import R_INT, R_FLOAT generators = [ [AsTypeFeatureGenerator()], # Convert all input features to the exact same types as they were during fit. [FillNaFeatureGenerator()], # Fill all NA values in the data [ CategoryFeatureGenerator(), # Convert object types to category types and minimize their memory usage # Carry over all features that are not objects and categories (without this, the int features would be dropped). IdentityFeatureGenerator(infer_features_in_args=dict(valid_raw_types=[R_INT, R_FLOAT])), ], # CategoryFeatureGenerator and IdentityFeatureGenerator will have their outputs concatenated together # before being fed into DropDuplicatesFeatureGenerator [DropDuplicatesFeatureGenerator()] # Drops any features which are duplicates of each-other ] ``` -------------------------------- ### Install AutoGluon Source: https://auto.gluon.ai/dev/_sources/tutorials/tabular/advanced/tabular-deployment.ipynb.txt Installs the AutoGluon library with tabular and all extra features. Run this before importing AutoGluon. ```bash !pip install autogluon.tabular[all] ``` -------------------------------- ### Install AutoGluon with UV (GPU) Source: https://auto.gluon.ai/stable/install.html Installs AutoGluon with GPU support using the UV package installer for faster installations. First, install UV, then install AutoGluon. ```bash # Install UV package installer (faster than pip) pip install -U uv # Install AutoGluon with GPU support python -m uv pip install autogluon ``` -------------------------------- ### Load Shopee Dataset and Sample Source: https://auto.gluon.ai/dev/_sources/tutorials/multimodal/advanced_topics/hyperparameter_optimization.ipynb.txt Loads a subset of the Shopee dataset for multimodal tutorial purposes and samples 50% of the training data. Ensure the download directory is specified. ```python import warnings warnings.filterwarnings('ignore') from datetime import datetime from autogluon.multimodal.utils.misc import shopee_dataset download_dir = './ag_automm_tutorial_hpo' train_data, test_data = shopee_dataset(download_dir) train_data = train_data.sample(frac=0.5) print(train_data) ``` -------------------------------- ### Install NeuralForecast Library Source: https://auto.gluon.ai/dev/_sources/tutorials/timeseries/advanced/forecasting-custom-model.ipynb.txt Installs the NeuralForecast library, which is required for the NHITS model implementation used in this tutorial. ```bash pip install -q neuralforecast==2.0 ``` -------------------------------- ### Generate Fold Configurations Source: https://auto.gluon.ai/dev/_modules/autogluon/core/models/ensemble/bagged_ensemble_model.html Generates a list of fold configurations for training bagged models. This function is used internally to manage the distribution of data across different training folds and repeats, ensuring proper cross-validation setup. It calculates the exact folds to be fitted based on start and end parameters for repeats and folds within each repeat. ```python @staticmethod def _generate_fold_configs( *, X: pd.DataFrame, y: pd.Series, cv_splitter: CVSplitter, k_fold_start: int, k_fold_end: int, n_repeat_start: int, n_repeat_end: int, vary_seed_across_folds: bool, random_seed_offset: int, ) -> (list, int, int): """ Generates fold configs given a cv_splitter, k_fold start-end and n_repeat start-end. Fold configs are used by inheritors of FoldFittingStrategy when fitting fold models. Returns a list of fold configs, the number of started repeats, and the number of finished repeats. """ k_fold = cv_splitter.n_splits kfolds = cv_splitter.split(X=X, y=y) fold_start = n_repeat_start * k_fold + k_fold_start fold_end = (n_repeat_end - 1) * k_fold + k_fold_end folds_to_fit = fold_end - fold_start fold_fit_args_list = [] n_repeats_started = 0 n_repeats_finished = 0 for repeat in range(n_repeat_start, n_repeat_end): # For each repeat is_first_set = repeat == n_repeat_start is_last_set = repeat == (n_repeat_end - 1) if (not is_first_set) or (k_fold_start == 0): n_repeats_started += 1 fold_in_set_start = k_fold_start if repeat == n_repeat_start else 0 fold_in_set_end = k_fold_end if is_last_set else k_fold for fold_in_set in range(fold_in_set_start, fold_in_set_end): # For each fold fold = fold_in_set + (repeat * k_fold) fold_ctx = dict( model_name_suffix=f"S{repeat + 1}F{fold_in_set + 1}", # S5F3 = 3rd fold of the 5th repeat set fold=kfolds[fold], is_last_fold=fold == (fold_end - 1), folds_to_fit=folds_to_fit, folds_finished=fold - fold_start, folds_left=fold_end - fold, random_seed=random_seed_offset + fold if vary_seed_across_folds else random_seed_offset, ) fold_fit_args_list.append(fold_ctx) if fold_in_set_end == k_fold: n_repeats_finished += 1 assert len(fold_fit_args_list) == folds_to_fit, "fold_fit_args_list is not the expected length!" return fold_fit_args_list, n_repeats_started, n_repeats_finished ``` -------------------------------- ### Launch Tensorboard for Training Monitoring Source: https://auto.gluon.ai/dev/tutorials/multimodal/multimodal_prediction/beginner_multimodal.html Provides the shell command to launch Tensorboard for monitoring the training progress. This requires Tensorboard to be installed. ```shell # Assume you have installed tensorboard tensorboard --logdir /home/ci/autogluon/docs/tutorials/multimodal/multimodal_prediction/AutogluonModels/ag-20260527_091250 ``` -------------------------------- ### AutoGluon Training Initialization and Configuration Source: https://auto.gluon.ai/stable/tutorials/tabular/advanced/tabular-custom-model.html Illustrates the initial setup and configuration messages printed by AutoGluon during the training process. It includes system information, preset recommendations, and data preprocessing details. ```text No path specified. Models will be saved in: "AutogluonModels/ag-20251219_224624" Verbosity: 2 (Standard Logging) =================== System Info =================== AutoGluon Version: 1.5.0b20251219 Python Version: 3.12.10 Operating System: Linux Platform Machine: x86_64 Platform Version: #1 SMP Wed Mar 12 14:53:59 UTC 2025 CPU Count: 8 Pytorch Version: 2.9.1+cu128 CUDA Version: 12.8 GPU Memory: GPU 0: 14.57/14.57 GB Total GPU Memory: Free: 14.57 GB, Allocated: 0.00 GB, Total: 14.57 GB GPU Count: 1 Memory Avail: 28.42 GB / 30.95 GB (91.8%) Disk Space Avail: 204.77 GB / 255.99 GB (80.0%) =================================================== No presets specified! To achieve strong results with AutoGluon, it is recommended to use the available presets. Defaulting to `'medium'`... Recommended Presets (For more details refer to https://auto.gluon.ai/stable/tutorials/tabular/tabular-essentials.html#presets): presets='extreme' : New in v1.5: The state-of-the-art for tabular data. Massively better than 'best' on datasets <100000 samples by using new Tabular Foundation Models (TFMs) meta-learned on https://tabarena.ai: TabPFNv2, TabICL, Mitra, TabDPT, and TabM. Requires a GPU and `pip install autogluon.tabular[tabarena]` to install TabPFN, TabICL, and TabDPT. presets='best' : Maximize accuracy. Recommended for most users. Use in competitions and benchmarks. presets='best_v150': New in v1.5: Better quality than 'best' and 5x+ faster to train. Give it a try! presets='high' : Strong accuracy with fast inference speed. presets='high_v150': New in v1.5: Better quality than 'high' and 5x+ faster to train. Give it a try! presets='good' : Good accuracy with very fast inference speed. presets='medium' : Fast training time, ideal for initial prototyping. Beginning AutoGluon training ... AutoGluon will save models to "/home/ci/autogluon/docs/tutorials/tabular/advanced/AutogluonModels/ag-20251219_224624" Train Data Rows: 1000 Train Data Columns: 14 Label Column: class AutoGluon infers your prediction problem is: 'binary' (because only two unique label-values observed). 2 unique label values: [' >50K', ' <=50K'] If 'binary' is not the correct problem_type, please manually specify the problem_type parameter during Predictor init (You may specify problem_type as one of: ['binary', 'multiclass', 'regression', 'quantile']) Problem Type: binary Preprocessing data ... Selected class <--> label mapping: class 1 = >50K, class 0 = <=50K Note: For your binary classification, AutoGluon arbitrarily selected which label-value represents positive ( >50K) vs negative ( <=50K) class. To explicitly set the positive_class, either rename classes to 1 and 0, or specify positive_class in Predictor init. Using Feature Generators to preprocess the data ... Fitting AutoMLPipelineFeatureGenerator... Available Memory: 29097.59 MB Train Data (Original) Memory Usage: 0.50 MB (0.0% of available memory) Inferring data type of each feature based on column values. Set feature_metadata_in to manually specify special dtypes of the features. Stage 1 Generators: Fitting AsTypeFeatureGenerator... Note: Converting 1 features to boolean dtype as they only contain 2 unique values. Stage 2 Generators: Fitting FillNaFeatureGenerator... Stage 3 Generators: Fitting IdentityFeatureGenerator... Fitting CategoryFeatureGenerator... Fitting CategoryMemoryMinimizeFeatureGenerator... Stage 4 Generators: Fitting DropUniqueFeatureGenerator... Stage 5 Generators: Fitting DropDuplicatesFeatureGenerator... Types of features in original data (raw dtype, special dtypes): ('int', []) : 6 | ['age', 'fnlwgt', 'education-num', 'capital-gain', 'capital-loss', ...] ('object', []) : 8 | ['workclass', 'education', 'marital-status', 'occupation', 'relationship', ...] Types of features in processed data (raw dtype, special dtypes): ('category', []) : 7 | ['workclass', 'education', 'marital-status', 'occupation', 'relationship', ...] ('int', []) : 6 | ['age', 'fnlwgt', 'education-num', 'capital-gain', 'capital-loss', ...] ('int', ['bool']) : 1 | ['sex'] 0.1s = Fit runtime 14 features in original data used to generate 14 features in processed data. ``` -------------------------------- ### Install UV and AutoGluon (Windows GPU) Source: https://auto.gluon.ai/dev/install.html Installs the UV package installer and then AutoGluon with GPU support. This includes setting up the conda environment with CUDA and installing the appropriate PyTorch version. ```bash # Install UV package installer (faster than pip) pip install -U uv ``` -------------------------------- ### Install AutoGluon-Cloud Source: https://auto.gluon.ai/cloud/dev/_sources/tutorials/setup.md.txt Installs the autogluon-cloud package and CLI. This is the first step before using any AutoGluon-Cloud commands. ```bash pip install -U autogluon.cloud ``` -------------------------------- ### Install AutoGluon Source: https://auto.gluon.ai/dev/_sources/install.md.txt This command is used to install AutoGluon. Refer to the PR page for the most up-to-date installation instructions. ```bash ``` -------------------------------- ### Install and Import Libraries Source: https://auto.gluon.ai/dev/_sources/tutorials/multimodal/semantic_matching/text_semantic_search.ipynb.txt Installs the ir_datasets package and imports necessary libraries like pandas for data manipulation. Sets pandas to display full column width. ```bash %%capture !pip3 install ir_datasets ``` ```python import ir_datasets import pandas as pd pd.set_option('display.max_colwidth', None) ``` -------------------------------- ### Monitor Training with Tensorboard Source: https://auto.gluon.ai/dev/tutorials/multimodal/image_segmentation/beginner_semantic_seg.html Provides instructions on how to launch Tensorboard to monitor the training progress of the AutoGluon multimodal model. Ensure Tensorboard is installed. ```shell # Assume you have installed tensorboard tensorboard --logdir /home/ci/autogluon/docs/tutorials/multimodal/image_segmentation/tmp/d7e15407355041e7b000ab4f738813d7-automm_semantic_seg ``` -------------------------------- ### Install AutoGluon CPU with Conda on macOS Source: https://auto.gluon.ai/dev/install.html Creates a Conda environment, activates it, installs mamba, and then installs AutoGluon on macOS. ```bash conda create -n ag python=3.11 conda activate ag conda install -c conda-forge mamba mamba install -c conda-forge autogluon ``` -------------------------------- ### Install and Import Libraries Source: https://auto.gluon.ai/dev/tutorials/multimodal/semantic_matching/text_semantic_search.html Installs the 'ir_datasets' package and imports necessary libraries like pandas for data manipulation. Sets pandas display option to show full column width. ```python %%capture !pip3 install ir_datasets import ir_datasets import pandas as pd pd.set_option('display.max_colwidth', None) ``` -------------------------------- ### Download Demo Images and Prepare Texts Source: https://auto.gluon.ai/dev/tutorials/multimodal/semantic_matching/zero_shot_img_txt_matching.html Downloads sample images from provided URLs and defines a list of text descriptions. This is the initial data preparation step for image-text matching. ```python from autogluon.multimodal.utils import download texts = [ "A cheetah chases prey on across a field.", "A man is eating a piece of bread.", "The girl is carrying a baby.", "There is an airplane over a car.", "A man is riding a horse.", "Two men pushed carts through the woods.", "There is a carriage in the image.", "A man is riding a white horse on an enclosed ground.", "A monkey is playing drums.", ] urls = ['http://farm4.staticflickr.com/3179/2872917634_f41e6987a8_z.jpg', 'http://farm4.staticflickr.com/3629/3608371042_75f9618851_z.jpg', 'https://farm4.staticflickr.com/3795/9591251800_9c9727e178_z.jpg', 'http://farm8.staticflickr.com/7188/6848765123_252bfca33d_z.jpg', 'https://farm6.staticflickr.com/5251/5548123650_1a69ce1e34_z.jpg'] image_paths = [download(url) for url in urls] ``` -------------------------------- ### Prepare Demo Data for Image-Text Matching Source: https://auto.gluon.ai/dev/_sources/tutorials/multimodal/semantic_matching/zero_shot_img_txt_matching.ipynb.txt Download sample images and define text captions for demonstrating image-text semantic matching. This setup is crucial for testing the model's performance. ```python from autogluon.multimodal.utils import download texts = [ "A cheetah chases prey on across a field.", "A man is eating a piece of bread.", "The girl is carrying a baby.", "There is an airplane over a car.", "A man is riding a horse.", "Two men pushed carts through the woods.", "There is a carriage in the image.", "A man is riding a white horse on an enclosed ground.", "A monkey is playing drums.", ] urls = ['http://farm4.staticflickr.com/3179/2872917634_f41e6987a8_z.jpg', 'http://farm4.staticflickr.com/3629/3608371042_75f9618851_z.jpg', 'https://farm4.staticflickr.com/3795/9591251800_9c9727e178_z.jpg', 'http://farm8.staticflickr.com/7188/6848765123_252bfca33d_z.jpg', 'https://farm6.staticflickr.com/5251/5548123650_1a69ce1e34_z.jpg'] image_paths = [download(url) for url in urls] ``` -------------------------------- ### Install AutoGluon Assistant Source: https://auto.gluon.ai/dev/_sources/whats_new/v1.4.0.md.txt Install the AutoGluon Assistant package using pip. It is recommended to use uv for faster installation. ```bash pip install uv uv pip install autogluon.assistant>=1.0 ```