def fit(self, X, y, **kwargs):
        """
        Fits the estimator to calculate feature correlation to
        dependent variable.

        Parameters
        ----------
        X : ndarray or DataFrame of shape n x m
            A matrix of n instances with m features

        y : ndarray or Series of length n
            An array or series of target or class values

        kwargs : dict
            Keyword arguments passed to the fit method of the estimator.

        Returns
        -------
        self : visualizer
            The fit method must always return self to support pipelines.
        """
        self._create_labels_for_features(X)

        self._select_features_to_plot(X)

        # Calculate Features correlation with target variable
        if self.method == "pearson":
            self.scores_ = np.array(
                [pearsonr(x, y, **kwargs)[0] for x in np.asarray(X).T]
            )
        else:
            self.scores_ = np.array(
                self.correlation_methods[self.method](X, y, **kwargs)
        )

        # If feature indices are given, plot only the given features
        if self.feature_index:
            self.scores_ = self.scores_[self.feature_index]
            self.features_ = self.features_[self.feature_index]

        # Sort features by correlation
        if self.sort:
            sort_idx = np.argsort(self.scores_)
            self.scores_ = self.scores_[sort_idx]
            self.features_ = self.features_[sort_idx]

        self.draw()
        return self
Fits the estimator to calculate feature correlation to
        dependent variable.

        Parameters
        ----------
        X : ndarray or DataFrame of shape n x m
            A matrix of n instances with m features

        y : ndarray or Series of length n
            An array or series of target or class values

        kwargs : dict
            Keyword arguments passed to the fit method of the estimator.

        Returns
        -------
        self : visualizer
            The fit method must always return self to support pipelines.