mlquantify.utils.general#

convert_columns_to_arrays

Converts specified columns in a DataFrame from strings of arrays to NumPy arrays.

generate_artificial_indexes

Generate indexes for a stratified sample based on the prevalence of each class.

generate_artificial_prevalences

Generates n artificial prevalences with n dimensions.

get_real_prev

Get the real prevalence of each class in the target array.

load_quantifier

Load a quantifier from a file.

make_prevs

Generate a list of n_dim values uniformly distributed between 0 and 1 that sum exactly to 1.

normalize_prevalence

Normalize the prevalence of each class to sum to 1.

parallel

Run a function in parallel on a list of elements.

round_protocol_df

Round the columns of a protocol dataframe to a specified number of decimal places.

get_measure

Get the measure from the evaluation module.

get_method

Get the method from the methods module.