Class: FeatureUnion

Concatenates results of multiple transformer objects.

This estimator applies a list of transformer objects in parallel to the input data, then concatenates the results. This is useful to combine several feature extraction mechanisms into a single transformer.

Parameters of the transformers may be set using its name and the parameter name separated by a ‘__’. A transformer may be replaced entirely by setting the parameter with its name to another transformer, removed by setting to ‘drop’ or disabled by setting to ‘passthrough’ (features are passed without transformation).

Read more in the User Guide.

Python Reference

Constructors

new FeatureUnion()

new FeatureUnion(opts?): FeatureUnion

Parameters

ParameterTypeDescription
opts?object-
opts.n_jobs?numberNumber of jobs to run in parallel. undefined means 1 unless in a joblib.parallel_backend context. \-1 means using all processors. See Glossary for more details.
opts.transformer_list?anyList of transformer objects to be applied to the data. The first half of each tuple is the name of the transformer. The transformer can be ‘drop’ for it to be ignored or can be ‘passthrough’ for features to be passed unchanged.
opts.transformer_weights?anyMultiplicative weights for features per transformer. Keys are transformer names, values the weights. Raises ValueError if key not present in transformer_list.
opts.verbose?booleanIf true, the time elapsed while fitting each transformer will be printed as it is completed.
opts.verbose_feature_names_out?booleanIf true, get_feature_names_out will prefix all feature names with the name of the transformer that generated that feature. If false, get_feature_names_out will not prefix any feature names and will error if feature names are not unique.

Returns FeatureUnion

Defined in generated/pipeline/FeatureUnion.ts:27

Properties

PropertyTypeDefault valueDefined in
_isDisposedbooleanfalsegenerated/pipeline/FeatureUnion.ts:25
_isInitializedbooleanfalsegenerated/pipeline/FeatureUnion.ts:24
_pyPythonBridgeundefinedgenerated/pipeline/FeatureUnion.ts:23
idstringundefinedgenerated/pipeline/FeatureUnion.ts:20
optsanyundefinedgenerated/pipeline/FeatureUnion.ts:21

Accessors

named_transformers

Get Signature

get named_transformers(): Promise<any>

Dictionary-like object, with the following attributes. Read-only attribute to access any transformer parameter by user given name. Keys are transformer names and values are transformer parameters.

Returns Promise<any>

Defined in generated/pipeline/FeatureUnion.ts:355


py

Get Signature

get py(): PythonBridge

Returns PythonBridge

Set Signature

set py(pythonBridge): void

Parameters

ParameterType
pythonBridgePythonBridge

Returns void

Defined in generated/pipeline/FeatureUnion.ts:61

Methods

dispose()

dispose(): Promise<void>

Disposes of the underlying Python resources.

Once dispose() is called, the instance is no longer usable.

Returns Promise<void>

Defined in generated/pipeline/FeatureUnion.ts:113


fit()

fit(opts): Promise<any>

Fit all transformers using X.

Parameters

ParameterTypeDescription
optsobject-
opts.fit_params?anyIf enable_metadata_routing=False (default): Parameters directly passed to the fit methods of the sub-transformers.
opts.X?ArrayLikeInput data, used to fit transformers.
opts.y?ArrayLike[]Targets for supervised learning.

Returns Promise<any>

Defined in generated/pipeline/FeatureUnion.ts:130


fit_transform()

fit_transform(opts): Promise<ArrayLike>

Fit all transformers, transform the data and concatenate results.

Parameters

ParameterTypeDescription
optsobject-
opts.params?anyIf enable_metadata_routing=False (default): Parameters directly passed to the fit methods of the sub-transformers.
opts.X?ArrayLikeInput data to be transformed.
opts.y?ArrayLike[]Targets for supervised learning.

Returns Promise<ArrayLike>

Defined in generated/pipeline/FeatureUnion.ts:172


get_feature_names_out()

get_feature_names_out(opts): Promise<any>

Get output feature names for transformation.

Parameters

ParameterTypeDescription
optsobject-
opts.input_features?anyInput features.

Returns Promise<any>

Defined in generated/pipeline/FeatureUnion.ts:214


get_metadata_routing()

get_metadata_routing(opts): Promise<any>

Get metadata routing of this object.

Please check User Guide on how the routing mechanism works.

Parameters

ParameterTypeDescription
optsobject-
opts.routing?anyA MetadataRouter encapsulating routing information.

Returns Promise<any>

Defined in generated/pipeline/FeatureUnion.ts:250


init()

init(py): Promise<void>

Initializes the underlying Python resources.

This instance is not usable until the Promise returned by init() resolves.

Parameters

ParameterType
pyPythonBridge

Returns Promise<void>

Defined in generated/pipeline/FeatureUnion.ts:74


set_output()

set_output(opts): Promise<any>

Set the output container when "transform" and "fit_transform" are called.

set_output will set the output of all estimators in transformer_list.

Parameters

ParameterTypeDescription
optsobject-
opts.transform?"default" | "pandas" | "polars"Configure output of transform and fit_transform.

Returns Promise<any>

Defined in generated/pipeline/FeatureUnion.ts:286


transform()

transform(opts): Promise<ArrayLike>

Transform X separately by each transformer, concatenate results.

Parameters

ParameterTypeDescription
optsobject-
opts.params?anyParameters routed to the transform method of the sub-transformers via the metadata routing API. See Metadata Routing User Guide for more details.
opts.X?ArrayLikeInput data to be transformed.

Returns Promise<ArrayLike>

Defined in generated/pipeline/FeatureUnion.ts:318

Last updated on