Module Expr Str ImportFrom alias ImportFrom alias alias Assign NameStore ListLoad Str ClassDef bases NameLoad NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad kwarg body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Dict Expr Call AttributeLoad NameLoad attr NameLoad decorator_list Call NameLoad Str Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Dict Str Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults kwarg body Expr Str Assign NameStore Call AttributeLoad NameLoad attr For NameStore ListLoad Str Str body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body Expr Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareIsNot AttributeLoad NameLoad attr NameLoad body If AttributeLoad NameLoad attr body Return ListComp Call AttributeLoad NameLoad attr Call NameLoad BinOpAdd Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad Call AttributeLoad Dict AttributeLoad NameLoad attr NameLoad attr comprehension NameStore NameLoad orelse Return Call AttributeLoad NameLoad attr Call NameLoad BinOpAdd Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad Call AttributeLoad Dict AttributeLoad NameLoad attr NameLoad attr orelse If AttributeLoad NameLoad attr body Return ListComp Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr comprehension NameStore NameLoad orelse Return Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr decorator_list decorator_list
N/A N/A scikit-learn feature extraction integration decorators deprecated sklearn.base BaseEstimator TransformerMixin N/A __all__ N/A FeatureExtractor FeatureExtractor N/A BaseEstimator TransformerMixin N/A N/A Sci-kit learn wrapper class for feature extraction methods.

    This class acts as a bridge between feature extraction functions
    and scikit-learn pipelines.

    .. warning:: The `FeatureExtractor` object is deprecated as of 0.4.2, and will be
                 removed in 0.5.
                 Instead, use `sklearn.preprocessing.FunctionTransformer`.

    Attributes
    ----------
    function : function
        The feature extraction function to wrap.

        Example: `librosa.feature.melspectrogram`

    target : str or None
        If `None`, then `function` is called with the input
        data as the first positional argument.

        If `str`, then `function` is called with the input
        data as a keyword argument with key `target`.

    iterate : bool
        If `True`, then `function` is applied iteratively to each
        item of the input.

        If `False`, then `function` is applied to the entire data
        stream simultaneously.  This is useful for things like aggregation
        and stacking.

    kwargs : additional keyword arguments
        Parameters to be passed through to `function`

    Examples
    --------
    >>> import sklearn.pipeline
    >>> # Build a mel-spectrogram extractor
    >>> MS = librosa.util.FeatureExtractor(librosa.feature.melspectrogram,
    ...                                    sr=22050, n_fft=2048,
    ...                                    n_mels=128, fmax=8000)
    >>> # And a log-amplitude extractor
    >>> LA = librosa.util.FeatureExtractor(librosa.logamplitude,
    ...                                    ref_power=np.max)
    >>> # Chain them into a pipeline
    >>> Features = sklearn.pipeline.Pipeline([('MelSpectrogram', MS),
    ...                                       ('LogAmplitude', LA)])
    >>> # Load an audio file
    >>> y, sr = librosa.load(librosa.util.example_audio_file())
    >>> # Apply the transformation to y
    >>> F = Features.transform([y])
     __init__ N/A N/A self function target iterate N/A None True kwargs N/A N/A FeatureExtractor constructor

         N/A N/A self function function N/A N/A self target target N/A N/A self iterate iterate N/A N/A self kwargs N/A N/A N/A N/A self set_params kwargs N/A N/A deprecated 0.4.2 0.5 _get_param_names N/A N/A self N/A N/A N/A Returns the parameters of the feature extractor as a dictionary. N/A temp_params N/A function target N/A self function N/A self target N/A N/A N/A temp_params update N/A self kwargs N/A temp_params N/A set_params N/A N/A self N/A kwargs N/A N/A Update the parameters of the feature extractor. N/A params N/A N/A kwargs copy N/A k N/A function target N/A N/A N/A N/A params pop k None N/A N/A N/A N/A self kwargs update params N/A N/A N/A BaseEstimator set_params self kwargs N/A fit N/A N/A self N/A args kwargs N/A N/A This function does nothing, and is provided for interface compatibility.

        .. note:: Since most `TransformerMixin` classes implement some
            statistical modeling (e.g., PCA), the `fit()` method is
            required.

            For the `FeatureExtraction` class, all parameters are fixed
            ahead of time, and no statistical estimation takes place.
         N/A self N/A transform N/A N/A self X N/A N/A N/A Applies the feature transformation to an array of input data.

        Parameters
        ----------
        X : iterable
            Array or list of input data

        Returns
        -------
        X_transform : list
            In positional argument mode (`target=None`), then
            `X_transform[i] = function(X[i], [feature parameters])`

            If the `target` parameter was given, then
            `X_transform[i] = function(target=X[i], [feature parameters])`
         N/A N/A N/A self target None N/A N/A N/A self iterate N/A N/A N/A N/A N/A self function N/A dict N/A N/A list N/A N/A N/A self kwargs items N/A list N/A N/A N/A N/A self target i items N/A i X N/A N/A N/A N/A self function N/A dict N/A N/A list N/A N/A N/A self kwargs items N/A list N/A N/A N/A N/A self target X items N/A N/A N/A self iterate N/A N/A N/A N/A N/A self function i N/A self kwargs N/A i X N/A N/A N/A N/A self function X N/A self kwargs N/A N/A