nimble.calculate¶
Functions that perform calculations on Nimble-defined objects.
This includes functions that can be used as performance functions in the Nimble testing and cross-validation API. Some similar functionality may be available as methods off of data objects; the versions here are functions, and take any inputs as arguments.
Binary¶
Metrics available for binary classification.
|
Accurracy measure accounting for imbalances in the label counts. |
|
The harmonic mean of precision and recall. |
|
Number of predicted negative values that were known to be positive. |
|
Number of predicted positive values that were known to be negative. |
|
The ratio of true positive values to predicted positive values. |
|
The ratio of true positive values to known positive values. |
|
The ratio of true negative values to known negative values. |
|
Number of predicted positive values that were known to be positive. |
|
Number of predicted negative values that were known to be negative. |
Confidence¶
Confidence Intervals for error metrics.
|
Estimate a confidence interval for the root mean square error. |
|
Estimate a confidence interval for the mean absolute error. |
|
Estimate a confidence interval for the fraction incorrect. |
Linear Algebra¶
Linear algebra functions that can be used with nimble base objects.
|
Compute least-squares solution to equation A x = b. |
|
Compute the (multiplicative) inverse of a nimble Base object. |
|
Compute the (Moore-Penrose) pseudo-inverse of a nimble Base object. |
|
Solves the linear equation set A x = b for the unknown vector x. |
Loss¶
Definitions for functions that can be used as performance functions by nimble. Specifically, this only contains those functions that measure loss; or in other words, those where smaller values indicate a higher level of correctness in the predicted values.
|
Compute the proportion of incorrect predictions within a set of instances. |
|
Compute mean absolute error. |
For 2d prediction data, compute the RMSE of each feature, then average the results. |
|
|
Compute the root mean square error. |
|
Calculate the how much variance has not been correctly predicted in the predicted values. |
Matrix¶
Matrix calculations.
|
Perform element wise multiplication of two provided nimble Base objects with the result being returned in a separate nimble Base object. |
|
Perform an element-wise power operation, with the values in the left object as the bases and the values in the right object as exponents. |
Normalize¶
Normalize
|
Subtract the vector mean from each element. |
|
Subtract the mean and divide by standard deviation for each element. |
|
Convert values to range of 0 to 1. |
|
Convert elements to a percentile. |
Similarity¶
Similarity calculations.
|
Calculate the Pearson correlation coefficients between points in X. |
|
Calculate the cosine similarity between known and predicted values. |
|
Generate a confusion matrix for known and predicted label values. |
|
Calculate the covariance between points in X. |
|
Calculate how many values in predictedValues are equal to the values in the corresponding positions in knownValues. |
|
Calculate the r-squared (or coefficient of determination) of the predictedValues given the knownValues. |
Statistic¶
Statistics calculations.
|
The number of values in the vector. |
|
The maximum value in a vector. |
|
The mean of the values in a vector. |
|
The median of the values in a vector. |
|
The median absolute deviation of the values in a vector. |
|
The minimum value in a vector. |
|
The mode of the values in a vector. |
|
The proportion of values in the vector that are missing. |
|
The proportion of values in the vector that are equal to zero. |
|
A vector's lower quartile, the median, and the upper quartile. |
|
Calculate the residuals by a linear regression model. |
|
The standard deviation of the values in a vector. |
|
The sum of the values in the vector. |
|
The number of unique values in the vector. |
|
The variance of the values in a vector. |
Utility¶
Functions (and their helpers) used to analyze arbitrary performance functions.
|
Decorator factory for Nimble performance functions. |
|
Determine if higher or lower values are optimal for the function. |