sketchgraphs.pipeline.numerical_parameters¶
This module implements functionality to handle numerical parameters in the sketch.
Functions
-
sketchgraphs.pipeline.numerical_parameters.
make_quantization
(values, num_points, scheme)¶ Find optimal centers for parameter via either uniform, K-means, or CDF-based K-means.
Obtains a quantization scheme for the given values, according to a given strategy. Several schemes are supported, although we prefer the ‘cdf’ scheme, a hybrid which avoids some issues with large outliers in the datasets faced by other schemes.
- Parameters
- Returns
Array of quantization codes
- Return type
np.array
-
sketchgraphs.pipeline.numerical_parameters.
make_unique_cdf
(arr)¶ Return ‘collapsed’ cdf of arr (identical/close arr vals all have same cdf point).
- Parameters
arr (array of parameter values) –
- Returns
sorted_arr (sorted copy of arr.)
cdf (collapsed cdf of arr.)
-
sketchgraphs.pipeline.numerical_parameters.
normalize_expression
(expression, parameter_id)¶ Converts a numerical expression into a normalized form.