文件 | 枚举 | 函数
Bin 标记

文件

文件  label_bins.hpp
 用于按 bin 标记值的 API。
 

枚举

枚举类  cudf::inclusive { YES , NO }
 用于定义 bin 是否包含其边界点的枚举。
 

函数

std::unique_ptr< columncudf::label_bins (column_view const &input, column_view const &left_edges, inclusive left_inclusive, column_view const &right_edges, inclusive right_inclusive, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
 根据指定 bin 的成员身份标记元素。 更多...
 

详细描述

函数文档

◆ label_bins()

std::unique_ptr<column> cudf::label_bins ( column_view const &  input,
column_view const &  left_edges,
inclusive  left_inclusive,
column_view const &  right_edges,
inclusive  right_inclusive,
rmm::cuda_stream_view  stream = cudf::get_default_stream(),
rmm::device_async_resource_ref  mr = cudf::get_current_device_resource_ref() 
)

根据指定 bin 的成员身份标记元素。

Bin ileft_edges[i], right_edges[i] 定义。边界是否包含取决于 left_inclusiveright_inclusive

如果 input[j] 的值包含在范围 left_edges[i], right_edges[i] 内(具有指定的包含性),则属于 bin i,其对应标记为 i。如果 input[j] 不属于任何 bin,则其对应标记为 NULL。

注意

  • 如果提供了空的边界集合,则 input 中的所有元素都将被标记为 NULL。
  • input 中的 NULL 元素不属于任何 bin,其对应标记为 NULL。
  • input 中的 NaN 元素不属于任何 bin,其对应标记为 NULL。
  • Bin 必须按单调递增顺序提供,否则行为未定义。
  • 如果两个或多个 bin 重叠,行为未定义。
异常
cudf::logic_error如果违反了 input.type() == left_edges.type() == right_edges.type()
cudf::logic_error如果 left_edges.size() != right_edges.size()
cudf::logic_error如果 left_edges.has_nulls()right_edges.has_nulls()
参数
input根据指定的 bin 进行标记的输入元素。
left_edges每个 bin 的左边界值。
left_inclusive左边界是否包含。
right_edges每个 bin 的右边界值。
right_inclusive右边界是否包含。
stream用于设备内存操作和内核启动的 CUDA stream
mr用于分配返回列的设备内存资源。
返回值
根据指定 bin 对 input 中元素的整数标记。