lale.lib.sklearn.voting_classifier module

class lale.lib.sklearn.voting_classifier.VotingClassifier(*, estimators, voting='hard', weights=None, n_jobs=None, flatten_transform=True, verbose=False)

Bases: PlannedIndividualOp

Voting classifier from scikit-learn for voting ensemble.

This documentation is auto-generated from JSON schemas.

Parameters
  • estimators (array, not for optimizer) –

    List of (string, estimator) tuples. Invoking the fit method on the VotingClassifier will fit clones.

    • items : tuple

      • item 0 : string

      • item 1 : union type

        • operator

        • or ‘drop’

  • voting (‘hard’ or ‘soft’, default ‘hard’) –

    If ‘hard’, uses predicted class labels for majority rule voting.

    See also constraint-1.

  • weights (union type, not for optimizer, default None) –

    Sequence of weights (float or int) to weight the occurrences of

    • array of items : float

    • or None

  • n_jobs (union type, not for optimizer, default None) –

    The number of jobs to run in parallel for fit.

    • integer

    • or None

  • flatten_transform (boolean, not for optimizer, default True) –

    Affects shape of transform output only when voting=’soft’

    See also constraint-1.

  • verbose (boolean, optional, not for optimizer, default False) – If True, the time elapsed while fitting will be printed as it is completed.

Notes

constraint-1 : union type

Parameter: flatten_transform > only when voting=’soft’ if voting=’soft’ and flatten_transform=true

  • voting : ‘soft’

  • or flatten_transform : True

fit(X, y=None, **fit_params)

Train the operator.

Note: The fit method is not available until this operator is trainable.

Once this method is available, it will have the following signature:

Parameters
  • X (array of items : array of items : float) – Training vectors, where n_samples is the number of samples and n_features is the number of features.

  • y (union type) –

    The target values (class labels).

    • array of items : float

    • or array of items : string

    • or array of items : boolean

  • sample_weight (union type, optional) –

    Sample weights. If None, then samples are equally weighted.

    • array of items : float

    • or None

predict(X, **predict_params)

Make predictions.

Note: The predict method is not available until this operator is trained.

Once this method is available, it will have the following signature:

Parameters

X (array, optional of items : array of items : float) – The input samples.

Returns

result – Predicted class labels.

Return type

array of items : float

predict_proba(X)

Probability estimates for all classes.

Note: The predict_proba method is not available until this operator is trained.

Once this method is available, it will have the following signature:

Parameters

X (array, optional of items : array of items : float) – The input samples.

Returns

result – Weighted average probability for each class per sample.

Return type

array of items : array of items : float

transform(X, y=None)

Transform the data.

Note: The transform method is not available until this operator is trained.

Once this method is available, it will have the following signature:

Parameters

X (array, optional of items : array of items : float) – Training vectors, where n_samples is the number of samples and

Returns

result – If voting=’soft’ and flatten_transform=True:

  • items : array

    • items : union type

      • float

      • or array of items : float

Return type

array