handwriting_features.data.descriptors package
Submodules
handwriting_features.data.descriptors.statistics module
- class handwriting_features.data.descriptors.statistics.Statistics[source]
Bases:
objectClass implementing statistics computation interface
- classmethod compute(array, statistical_function)[source]
Computes the <statistical_function> of an input <array>.
- Parameters
array (numpy.ndarray) – input array
statistical_function (str) – statistical function name
- Returns
computed statistics
- Return type
numpy.float
- mapping = {'cv_nonparametric': <function cv_nonparametric>, 'cv_parametric': <function cv_parametric>, 'iqr': <function iqr>, 'mean': <function mean>, 'median': <function median>, 'percentile_5': <function percentile_5>, 'percentile_95': <function percentile_95>, 'quartile_1': <function quartile_1>, 'quartile_3': <function quartile_3>, 'slope_of_linear_regression': <function slope_of_linear_regression>, 'std': <function std>}
- handwriting_features.data.descriptors.statistics.cv_nonparametric(array, as_percentage=False)[source]
Computes non-parametric cv of an input array (ignoring NaNs).
- Parameters
array (numpy.ndarray) – input array
as_percentage (bool, optional) – percentage computation flag, defaults to False
- Returns
non-parametric cv value
- Return type
numpy.float
- handwriting_features.data.descriptors.statistics.cv_parametric(array, as_percentage=False)[source]
Computes parametric cv of an input array (ignoring NaNs).
- Parameters
array (numpy.ndarray) – input array
as_percentage (bool, optional) – percentage computation flag, defaults to False
- Returns
parametric cv value
- Return type
numpy.float
- handwriting_features.data.descriptors.statistics.iqr(array)[source]
Computes iqr of an input array (ignoring NaNs).
- Parameters
array (numpy.ndarray) – input array
- Returns
iqr value
- Return type
numpy.float
- handwriting_features.data.descriptors.statistics.mean(array)[source]
Computes mean of an input array (ignoring NaNs).
- Parameters
array (numpy.ndarray) – input array
- Returns
mean value
- Return type
numpy.float
- handwriting_features.data.descriptors.statistics.median(array)[source]
Computes median of an input array (ignoring NaNs).
- Parameters
array (numpy.ndarray) – input array
- Returns
median value
- Return type
numpy.float
- handwriting_features.data.descriptors.statistics.percentile_5(array)[source]
Computes 5th percentile of an input array (ignoring NaNs).
- Parameters
array (numpy.ndarray) – input array
- Returns
5th percentile value
- Return type
numpy.float
- handwriting_features.data.descriptors.statistics.percentile_95(array)[source]
Computes 95th percentile of an input array (ignoring NaNs).
- Parameters
array (numpy.ndarray) – input array
- Returns
95th percentile value
- Return type
numpy.float
- handwriting_features.data.descriptors.statistics.quartile_1(array)[source]
Computes 1st quartile of an input array (ignoring NaNs).
- Parameters
array (numpy.ndarray) – input array
- Returns
1st quartile value
- Return type
numpy.float
- handwriting_features.data.descriptors.statistics.quartile_3(array)[source]
Computes 3rd quartile of an input array (ignoring NaNs).
- Parameters
array (numpy.ndarray) – input array
- Returns
3rd quartile value
- Return type
numpy.float
- handwriting_features.data.descriptors.statistics.slope_of_linear_regression(array, window_size=5, min_samples=3, center=True, threshold=3)[source]
Computes slope of linear regression of an input array (ignoring NaNs).
- Parameters
array (numpy.ndarray) – input array
window_size (int, optional) – size of the moving window, defaults to 5
min_samples (int, optional) – minimum number of samples in a window, defaults to 3
center (bool, optional) – labels at the center of the window flag, defaults to True
threshold (int, optional) – outlier removal threshold, defaults to 3
- Returns
slope of linear regression value
- Return type
numpy.float