Note

This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the What you really need to know section for the big picture.

julearn.prepare.prepare_input_data#

julearn.prepare.prepare_input_data(X, y, df, pos_labels, groups, X_types)#

Prepare the input data and variables for the pipeline.

Parameters:
Xstr, list(str)

The features to use. See Data for details.

ystr

The targets to predict. See Data for details.

dfpandas.DataFrame with the data.

See Data for details.

pos_labelsstr, int, float or list | None

The labels to interpret as positive. If not None, every element from y will be converted to 1 if is equal or in pos_labels and to 0 if not.

groupsstr | None

The grouping labels in case a Group CV is used. See Data for details.

X_typesdict | None

A dictionary containing keys with column type as a str and the columns of this column type as a list of str.

Returns:
df_Xpandas.DataFrame

A dataframe with the features for each sample.

df_ypandas.Series

A series with the y variable (target) for each sample.

df_groupspandas.Series

A series with the grouping variable for each sample (if specified in the groups parameter).

Raises:
ValueError

If there is any error on the input data and parameters validation.

Warns:
RuntimeWarning

If the input data and parameters might have inconsistencies.