quantiles.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-2020, 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>
21 #include <cudf/tdigest/tdigest_column_view.cuh>
22 #include <cudf/types.hpp>
23 
24 namespace cudf {
54 std::unique_ptr<column> quantile(
55  column_view const& input,
56  std::vector<double> const& q,
57  interpolation interp = interpolation::LINEAR,
58  column_view const& ordered_indices = {},
59  bool exact = true,
60  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
61 
92 std::unique_ptr<table> quantiles(
93  table_view const& input,
94  std::vector<double> const& q,
96  cudf::sorted is_input_sorted = sorted::NO,
97  std::vector<order> const& column_order = {},
98  std::vector<null_order> const& null_precedence = {},
99  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
100 
123 std::unique_ptr<column> percentile_approx(
124  tdigest::tdigest_column_view const& input,
125  column_view const& percentiles,
126  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
127  // end of group
129 } // namespace cudf
table_view.hpp
Class definitions for (mutable)_table_view
cudf::quantiles
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::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Returns the rows of the input corresponding to the requested quantiles.
cudf::tdigest::tdigest_column_view
Given a column_view containing tdigest data, an instance of this class provides a wrapper on the comp...
Definition: tdigest_column_view.cuh:59
cudf::interpolation::LINEAR
@ LINEAR
Linear interpolation between i and j.
scalar.hpp
Class definitions for cudf::scalar.
cudf::column_view
A non-owning, immutable view of device data as a column of elements, some of which may be null as ind...
Definition: column_view.hpp:300
types.hpp
Type declarations for libcudf.
cudf::interpolation
interpolation
Interpolation method to use when the desired quantile lies between two data points i and j.
Definition: types.hpp:189
cudf::quantile
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::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Computes quantiles with interpolation.
cudf::table_view
A set of cudf::column_view's of the same size.
Definition: table_view.hpp:154
cudf
cuDF interfaces
Definition: aggregation.hpp:34
cudf::sorted
sorted
Indicates whether a collection of values is known to be sorted.
Definition: types.hpp:164
rmm::mr::device_memory_resource
cudf::percentile_approx
std::unique_ptr< column > percentile_approx(tdigest::tdigest_column_view const &input, column_view const &percentiles, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Calculate approximate percentiles on an input tdigest column.