quantiles.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 
6 #pragma once
7 
8 #include <cudf/scalar/scalar.hpp>
11 #include <cudf/types.hpp>
12 #include <cudf/utilities/export.hpp>
14 
15 namespace CUDF_EXPORT cudf {
47 std::unique_ptr<column> quantile(
48  column_view const& input,
49  std::vector<double> const& q,
50  interpolation interp = interpolation::LINEAR,
51  column_view const& ordered_indices = {},
52  bool exact = true,
55 
87 std::unique_ptr<table> quantiles(
88  table_view const& input,
89  std::vector<double> const& q,
90  interpolation interp = interpolation::NEAREST,
91  cudf::sorted is_input_sorted = sorted::NO,
92  std::vector<order> const& column_order = {},
93  std::vector<null_order> const& null_precedence = {},
96 
120 std::unique_ptr<column> percentile_approx(
121  tdigest::tdigest_column_view const& input,
122  column_view const& percentiles,
125  // end of group
127 } // namespace CUDF_EXPORT cudf
A non-owning, immutable view of device data as a column of elements, some of which may be null as ind...
A set of cudf::column_view's of the same size.
Definition: table_view.hpp:189
Given a column_view containing tdigest data, an instance of this class provides a wrapper on the comp...
std::unique_ptr< column > percentile_approx(tdigest::tdigest_column_view const &input, column_view const &percentiles, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
Calculate approximate percentiles on an input tdigest column.
std::unique_ptr< column > quantile(column_view const &input, std::vector< double > const &q, interpolation interp=interpolation::LINEAR, column_view const &ordered_indices={}, bool exact=true, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
Computes quantiles with interpolation.
std::unique_ptr< table > quantiles(table_view const &input, std::vector< double > const &q, interpolation interp=interpolation::NEAREST, cudf::sorted is_input_sorted=sorted::NO, std::vector< order > const &column_order={}, std::vector< null_order > const &null_precedence={}, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
Returns the rows of the input corresponding to the requested quantiles.
rmm::cuda_stream_view const get_default_stream()
Get the current default stream.
rmm::device_async_resource_ref get_current_device_resource_ref()
Get the current device memory resource reference.
cuda::mr::resource_ref< cuda::mr::device_accessible > device_async_resource_ref
interpolation
Interpolation method to use when the desired quantile lies between two data points i and j.
Definition: types.hpp:182
sorted
Indicates whether a collection of values is known to be sorted.
Definition: types.hpp:157
APIs for getting and setting the current device memory resource.
cuDF interfaces
Definition: host_udf.hpp:26
Class definitions for cudf::scalar.
Class definitions for (mutable)_table_view
tdigest data APIs
Type declarations for libcudf.