Note

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

julearn.transformers.target.JuTransformedTargetModel

class julearn.transformers.target.JuTransformedTargetModel(model, transformer)

Class that provides a model that supports transforming the target.

This _model_ is a wrapper that will transform the target before fitting.

Parameters:
  • model (ModelLike) – The model to be wrapped. Can be a pipeline.

  • transformer (JuTargetPipeline) – The transformer to be used to transform the target.

__init__(model, transformer)
fit(X, y, **fit_params)

Fit the model.

Parameters:
Returns:

The fitted model.

predict(X)

Predict using the model.

Parameters:

X (DataFrame) – The data to predict on.

Returns:

The predictions.

score(X, y)

Score the model.

Parameters:
Returns:

Score for the model.

predict_proba(X)

Compute probabilities of possible outcomes for samples in X.

Parameters:

X (DataFrame) – The data to predict on.

Returns:

Returns the probability of the sample for each class in the model. The columns correspond to the classes in sorted order, as they appear in the attribute classes_.

decision_function(X)

Evaluate the decision function for the samples in X.

Parameters:

X (DataFrame) – The data to obtain the decision function.

Returns:

Returns the decision function of the sample for each class in the model.

transform_target(X, y)

Transform target.

Parameters:
Returns:

The transformed target.

can_inverse_transform()

Check if the target can be inverse transformed.

Returns:

True if the target can be inverse transformed, False otherwise.

property classes_: ndarray

Get the classes of the model.

filter_columns(X)

Get the apply_to columns of a pandas DataFrame.

Parameters:

X (DataFrame) – The DataFrame to filter.

Returns:

The DataFrame with only the apply_to columns.

get_apply_to()

Get the column types the estimator applies to.

Returns:

The column types the estimator applies to.

get_metadata_routing()

Get metadata routing of this object.

Please check User Guide on how the routing mechanism works.

Returns:

A MetadataRequest encapsulating routing information.

get_needed_types()

Get the column types needed by the estimator.

Returns:

The column types needed by the estimator.

get_params(deep=True)

Get parameters for this estimator.

Parameters:

deep (bool, default=True) – If True, will return the parameters for this estimator and contained subobjects that are estimators.

Returns:

Parameter names mapped to their values.

set_params(**params)

Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object.

Parameters:

**params (dict) – Estimator parameters.

Returns:

Estimator instance.