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.base.JuBaseEstimator#
- class julearn.base.JuBaseEstimator(apply_to, needed_types=None)#
Base class for julearn estimators.
Every julearn estimator is aware of the column types of the data. Thus, they should be able to provide the column types they need and the column types they apply to.
The main difference between this class and
sklearn.base.BaseEstimator
is that this class knows which columns to use from the data for its purpose. That is, the apply_to and needed_types attributes.- Parameters:
- apply_tostr or list of str or set of str or ColumnTypes
The column types to apply the estimator to.
- needed_typesstr or list of str or set of str or ColumnTypes
The column types needed by the estimator. If None, there are no needed types (default is None)
- __init__(apply_to, needed_types=None)#
- get_needed_types()#
Get the column types needed by the estimator.
- Returns:
- ColumnTypes
The column types needed by the estimator.
- get_apply_to()#
Get the column types the estimator applies to.
- Returns:
- ColumnTypes
The column types the estimator applies to.
- filter_columns(X)#
Get the apply_to columns of a pandas DataFrame.
- Parameters:
- Xpd.DataFrame
The DataFrame to filter.
- Returns:
- pd.DataFrame
The DataFrame with only the apply_to columns.
- get_metadata_routing()#
Get metadata routing of this object.
Please check User Guide on how the routing mechanism works.
- Returns:
- routingMetadataRequest
A
MetadataRequest
encapsulating routing information.
- get_params(deep=True)#
Get parameters for this estimator.
- Parameters:
- deepbool, default=True
If True, will return the parameters for this estimator and contained subobjects that are estimators.
- Returns:
- paramsdict
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:
- **paramsdict
Estimator parameters.
- Returns:
- selfestimator instance
Estimator instance.