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 https://juaml.github.io/julearn/input.html for details.

ystr

The targets to predict. See https://juaml.github.io/julearn/input.html for details.

dfpandas.DataFrame with the data.

See https://juaml.github.io/julearn/input.html 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 https://juaml.github.io/julearn/input.html 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.