src.utils.preds.pred_reduce_strategy
Classes
|
- class src.utils.preds.pred_reduce_strategy.PredReduceStrategy(**kwargs)
- Author:
Alberto M. Esmoris Pena
Interface for reduce operations on predictions.
See
PredictionReducer.- __init__(**kwargs)
Initialize/instantiate a prediction reduction strategy.
- Parameters:
kwargs – The attributes for the PredReduceStrategy.
- abstractmethod reduce(reducer, npoints, nvals, Z, I)
The method that provides the logic to reduce potentially more predictions than points such that there is at most one prediction per point. It must be overridden by any concrete implementation of a prediction reduction strategy.
- Parameters:
reducer (
PredictionReducer) – The prediction reducer that is doing the reduction.Z (list of
np.ndarray) – List of arrays. There is one array per input neighborhood, each array is a matrix where the rows represent the points and the columns the class-wise likelihoods.I (list of list of int) – The indices representing the neighborhoods. There are as many lists as input neighborhoods. Each list contains the indices representing the points in the original point cloud. For example, the j-th element of the i-th list I[i][j] is the index of the j-th point in the i-th input neighborhood in the original point cloud.
- Variables:
npoints (int) – The number of points to which the predictions must be reduced to.
nvals (int) – How many point-wise values must be considered for each point (classes for classification tasks, reference values for regression tasks).
- Returns:
The reduced predictions as a matrix \(\pmb{Z} \in \mathbb{R}^{m \times n_v}\) where the \(m\) rows represent the points (I[i][j] will point to a row) and the \(n_v\) columns represent the likelihood for each of the predicted classes (classification) or the reference point-wise values (regression).
- Return type:
np.ndarray