﻿# cuML output types: keep estimator, context and global settings visible at the consumer boundary

Design cuML prediction and fitted-attribute output types for their consumers, with explicit configuration scope and deliberate GPU-to-host representation choices.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-cuml-output-type-scope-consumer/
Language: en

## Begin with the next consumer's requirements

A clustering pipeline feeds its labels into a GPU feature calculation in one environment and a pandas report in another. Both routes may use the same trained estimator while needing different output representations. The [cuML output-configuration reference](https://docs.nvidia.com/cuml/latest/api/generated/cuml.set_global_output_type/) lists array and dataframe output choices. Determine which representation the next consumer actually accepts before relying on whatever type happens to appear in an interactive notebook.

## Make the configuration scope visible

The global setting affects function and estimator outputs, including fitted attributes. The [context configuration reference](https://docs.nvidia.com/cuml/latest/api/generated/cuml.using_output_type/) provides a scoped alternative. Use a scope that matches the intended interface and verify the installed behavior when combining settings. A utility that changes a global preference can affect later consumers that did not request the change. Preserve the surrounding configuration rather than assuming a notebook is always started from a clean state.

## Inspect the estimator's own contract

The [KMeans reference](https://docs.nvidia.com/cuml/latest/api/generated/cuml.cluster.KMeans/) documents an estimator-level output_type parameter and the use of module configuration when that value is not specified. Check the relevant estimator and method rather than generalizing from a different object. Include fitted attributes in the review: a consumer may read them after training under a different context. Successful fitting does not establish the representation later returned through every attribute access or prediction method.

## Account for representation changes deliberately

The output-configuration notes distinguish device-array choices from NumPy or pandas choices that require host-device transfer. Select CPU output when its consumer needs it, and keep a GPU-compatible route on a compatible device representation when appropriate. Do not use output type as evidence that the underlying learning algorithm changed. It describes the interface and may introduce conversion work, but model quality and numerical correctness still require their own validation.

## Check type and meaning at the handoff

A pilot should verify output type, shape, ordering and association with the original examples. Repeat the check with the actual scoped and estimator settings used by the service. The guides on [CPU-GPU pipeline splitting](/journal/cpu-gpu-hybrid-architecture/) and [logical feature contracts](/journal/data-guide-frictionless-table-schema/) explain related boundaries. A reliable handoff makes representation an intentional choice while preserving which prediction or fitted quantity each value represents.
