quantiles.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-2024, NVIDIA CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include <cudf/scalar/scalar.hpp>
22 #include <cudf/types.hpp>
23 #include <cudf/utilities/export.hpp>
25 
26 namespace CUDF_EXPORT cudf {
56 std::unique_ptr<column> quantile(
57  column_view const& input,
58  std::vector<double> const& q,
59  interpolation interp = interpolation::LINEAR,
60  column_view const& ordered_indices = {},
61  bool exact = true,
63 
94 std::unique_ptr<table> quantiles(
95  table_view const& input,
96  std::vector<double> const& q,
97  interpolation interp = interpolation::NEAREST,
98  cudf::sorted is_input_sorted = sorted::NO,
99  std::vector<order> const& column_order = {},
100  std::vector<null_order> const& null_precedence = {},
102 
125 std::unique_ptr<column> percentile_approx(
126  tdigest::tdigest_column_view const& input,
127  column_view const& percentiles,
129  // end of group
131 } // 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:200
Given a column_view containing tdigest data, an instance of this class provides a wrapper on the comp...
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::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
Computes quantiles with interpolation.
std::unique_ptr< column > percentile_approx(tdigest::tdigest_column_view const &input, column_view const &percentiles, rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
Calculate approximate percentiles on an input tdigest column.
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::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
Returns the rows of the input corresponding to the requested quantiles.
rmm::device_async_resource_ref get_current_device_resource_ref()
Get the current device memory resource reference.
cuda::mr::async_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:192
sorted
Indicates whether a collection of values is known to be sorted.
Definition: types.hpp:167
cuDF interfaces
Definition: aggregation.hpp:35
Class definitions for cudf::scalar.
Class definitions for (mutable)_table_view
tdigest data APIs
Type declarations for libcudf.