OpenNN
Open-source neural networks library
Loading...
Searching...
No Matches
statistics.h File Reference
#include "pch.h"

Go to the source code of this file.

Classes

struct  opennn::Descriptives
 Summary statistics (minimum, maximum, mean, standard deviation) for one variable. More...
 
struct  opennn::BoxPlot
 Five-number summary (minimum, Q1, median, Q3, maximum) used to draw a box plot. More...
 
struct  opennn::Histogram
 Frequency histogram with per-bin minimums, maximums, centers, and counts. More...
 

Namespaces

namespace  opennn
 

Functions

float opennn::minimum (const MatrixR &)
 Returns the smallest finite element of a matrix.
 
float opennn::minimum (const VectorR &)
 Returns the smallest finite element of a vector.
 
float opennn::minimum (const VectorR &, const vector< Index > &)
 Returns the smallest finite element of the selected rows of a vector.
 
VectorR opennn::column_minimums (const Tensor2 &, const vector< Index > &={}, const vector< Index > &={})
 Per-column minimums of a 2D tensor.
 
float opennn::maximum (const MatrixR &)
 Returns the largest finite element of a matrix.
 
float opennn::maximum (const VectorR &)
 Returns the largest finite element of a vector.
 
float opennn::maximum (const VectorR &, const vector< Index > &)
 Returns the largest finite element of the selected rows of a vector.
 
VectorR opennn::column_maximums (const Tensor2 &, const vector< Index > &={}, const vector< Index > &={})
 Per-column maximums of a 2D tensor, optionally restricted to a row/column subset.
 
float opennn::range (const VectorR &)
 Returns the maximum minus the minimum of a vector.
 
float opennn::mean (const VectorR &)
 Arithmetic mean of a vector, ignoring NaNs.
 
float opennn::mean (const MatrixR &, Index)
 Arithmetic mean of a matrix column, ignoring NaNs.
 
VectorR opennn::mean (const MatrixR &)
 Column-wise arithmetic means of a matrix.
 
VectorR opennn::mean (const MatrixR &, const vector< Index > &, const vector< Index > &)
 Column-wise means of a matrix restricted to the given rows and columns.
 
float opennn::median (const VectorR &)
 Median of a vector.
 
float opennn::median (const MatrixR &, Index)
 Median of a single matrix column.
 
VectorR opennn::median (const MatrixR &)
 Column-wise medians of a matrix.
 
VectorR opennn::median (const MatrixR &, const vector< Index > &)
 Column-wise medians of the selected columns.
 
VectorR opennn::median (const MatrixR &, const vector< Index > &, const vector< Index > &)
 Column-wise medians restricted to the given rows and columns.
 
float opennn::variance (const VectorR &)
 Sample variance of a vector.
 
float opennn::variance (const VectorR &, const VectorI &)
 Sample variance of the selected entries of a vector.
 
float opennn::standard_deviation (const VectorR &)
 Sample standard deviation of a vector.
 
VectorR opennn::standard_deviation (const VectorR &, Index)
 Rolling standard deviation of a vector over a window of the given size.
 
VectorR opennn::quartiles (const VectorR &)
 Returns [Q1, Q2, Q3] of a vector.
 
VectorR opennn::quartiles (const VectorR &, const vector< Index > &)
 Returns [Q1, Q2, Q3] of the selected entries of a vector.
 
BoxPlot opennn::box_plot (const VectorR &)
 Five-number summary (box plot) of a vector.
 
BoxPlot opennn::box_plot (const VectorR &, const vector< Index > &)
 Five-number summary (box plot) of the selected entries of a vector.
 
Descriptives opennn::vector_descriptives (const VectorR &)
 Returns the (min, max, mean, std) descriptives of a vector.
 
vector< Descriptivesopennn::descriptives (const MatrixR &)
 Returns the per-column descriptives of a matrix.
 
vector< Descriptivesopennn::descriptives (const MatrixR &, const vector< Index > &, const vector< Index > &)
 Returns per-column descriptives restricted to the given rows and columns.
 
Histogram opennn::histogram (const VectorR &, Index=10)
 Builds an equal-width histogram of a vector.
 
Histogram opennn::histogram_centered (const VectorR &, float=0.0f, Index=10)
 Builds a histogram with one bin centered on the given value.
 
Histogram opennn::histogram (const VectorB &)
 Builds a two-bin histogram counting false/true entries.
 
Histogram opennn::histogram (const VectorI &, Index=10)
 Builds an equal-width histogram of an integer vector.
 
vector< Histogramopennn::histograms (const MatrixR &, Index=10)
 Builds one histogram per matrix column.
 
VectorI opennn::total_frequencies (const vector< Histogram > &)
 Sums the per-bin frequencies across a collection of histograms.
 
Index opennn::minimal_index (const VectorR &)
 Index of the smallest element in a vector.
 
VectorI opennn::minimal_indices (const VectorR &, Index)
 Indices of the n smallest elements of a vector.
 
VectorI opennn::minimal_indices (const MatrixR &)
 Row/column coordinates of the smallest element of a matrix.
 
Index opennn::maximal_index (const VectorR &)
 Index of the largest element in a vector.
 
VectorI opennn::maximal_indices (const VectorR &, Index)
 Indices of the n largest elements of a vector.
 
VectorI opennn::maximal_indices (const MatrixR &)
 Row/column coordinates of the largest element of a matrix.
 
bool opennn::row_finite (const VectorR &values, Index i)
 Returns true if the i-th entry of the vector is finite.
 
bool opennn::row_finite (const MatrixR &matrix, Index i)
 Returns true if every entry in row i of the matrix is finite.
 
VectorR opennn::slice_rows (const VectorR &values, const vector< Index > &indices)
 Returns a copy of the vector containing only the entries at the given indices.
 
MatrixR opennn::slice_rows (const MatrixR &matrix, const vector< Index > &indices)
 Returns a copy of the matrix containing only the rows at the given indices.
 
VectorR opennn::filter_missing_values (const VectorR &)
 Returns a copy of the vector with NaN entries removed.
 
template<typename X, typename Y>
pair< X, Y > opennn::filter_missing_values (const X &x, const Y &y)
 Returns x and y restricted to rows where both are finite (row counts must match).
 
bool opennn::is_contiguous (const vector< Index > &indices)
 Returns true if the sorted indices form a contiguous run (each entry equals the previous plus one).
 
template<typename T>
bool opennn::is_binary (const T &tensor)
 Returns true if every non-NaN entry of the tensor is exactly 0.0 or 1.0.
 
MatrixR opennn::append_rows (const MatrixR &, const MatrixR &)
 Returns the row-wise concatenation of two matrices with matching column counts.
 
template<typename T>
vector< T > opennn::gather_by_index (const vector< T > &data, const vector< Index > &indices)
 Returns the elements of data at the given indices.
 
vector< Index > opennn::build_feasible_rows_mask (const MatrixR &outputs, const VectorR &minimums, const VectorR &maximums)
 Returns the indices of the rows of outputs that lie within the per-column bounds.
 
template<typename T>
bool opennn::is_constant (const T &tensor)
 Returns true if every non-NaN entry of the tensor equals the first finite entry.
 
vector< Index > opennn::get_true_indices (const VectorB &flags)
 Returns the positions of the true entries in a boolean vector.
 
VectorI opennn::calculate_rank (const VectorR &, bool ascending=true)
 Returns the rank of each element (1-based), ascending by default.
 
vector< Index > opennn::get_elements_greater_than (const vector< Index > &, Index)
 Returns the entries of indices that are strictly greater than the given threshold.
 
VectorI opennn::get_nearest_points (const MatrixR &, const VectorR &, int=1)
 Finds the n rows of the matrix closest to the given point by Euclidean distance.
 
void opennn::fill_tensor_data (const MatrixR &, const vector< Index > &, const vector< Index > &, float *, bool=true, int contiguous=-1)
 Copies the selected sub-matrix into a flat float buffer.
 
VectorR opennn::perform_Householder_QR_decomposition (const MatrixR &, const VectorR &)
 Solves a linear least-squares problem via Householder QR decomposition.
 
VectorMap opennn::vector_map (const MatrixR &, Index)
 Returns an Eigen VectorMap that views a single column of a matrix without copying.