(self, modelinstance, filter_classes=None, ascending=True, ax=None, progressbar=True,
                                n_jobs=-1, n_samples=5000, method='prediction-variance', scorer_type='default',
                                use_scaling=False)
return f, ax
Computes feature importance of all features related to a model instance,
        then plots the results. Supports classification, multi-class classification, and regression.

        Parameters
        ----------
        modelinstance: skater.model.model.Model subtype
            estimator "prediction" function to explain the predictive model. Could be probability scores
            or target values
        filter_classes: array type
            The classes to run partial dependence on. Default None invokes all classes.
            Only used in classification models.
        ascending: boolean, default True
            Helps with ordering Ascending vs Descending
        ax: matplotlib.axes._subplots.AxesSubplot
            existing subplot on which to plot feature importance. If none is provided,
            one will be created.
        progressbar: bool
            Whether to display progress. This affects which function we use to operate on the pool
            of processes, where including the progress bar results in 10-20% slowdowns.
        n_jobs: int
            How many concurrent processes to use. Defaults -1, which grabs as many as are available.
            Use 1 to avoid multiprocessing altogether.
        n_samples: int
            How many samples to use when computing importance.
        method: string
            How to compute feature importance. 'model-scoring' requires Interpretation.training_labels
            prediction-variance: mean absolute value of changes in predictions, given perturbations.
            model-scoring: difference in log_loss or MAE of training_labels given perturbations.
            Note this vary rarely makes any significant differences
        scorer_type: string
            only used when method='model-scoring', and in this case defines which scoring function to use.
            Default value is 'default', which evaluates to:
                regressors: mean absolute error
                classifiers with probabilities: cross entropy
                classifiers without probabilities: f1 score
            See Skater.model.scorers for details.
        use_scaling: bool
            Whether to weight the importance values by the strength of the perturbations.
            Generally doesn't effect results unless n_samples is very small.


        Returns
        -------
        f: figure instance
        ax: matplotlib.axes._subplots.AxesSubplot
            could be used to for further modification to the plots

        Examples
        --------
            >>> from skater.model import InMemoryModel
            >>> from skater.core.explanations import Interpretation
            >>> from sklearn.ensemble import RandomForestClassifier
            >>> rf = RandomForestClassifier()
            >>> rf.fit(X,y)
            >>> model = InMemoryModel(rf.predict_proba, examples = X)
            >>> interpreter = Interpretation()
            >>> interpreter.load_data(X)
            >>> interpreter.feature_importance.plot_feature_importance(model, ascending=True, ax=ax)
Computes feature importance of all features related to a model instance,
        then plots the results. Supports classification, multi-class classification, and regression.
Computes feature importance of all features related to a model instance then plots the results . Supports classification multi - class classification and regression .
def plot_feature_importance(self, modelinstance, filter_classes=None, ascending=True, ax=None, progressbar=True,
                                n_jobs=-1, n_samples=5000, method='prediction-variance', scorer_type='default',
                                use_scaling=False):

        """Computes feature importance of all features related to a model instance,
        then plots the results. Supports classification, multi-class classification, and regression.

        Parameters
        ----------
        modelinstance: skater.model.model.Model subtype
            estimator "prediction" function to explain the predictive model. Could be probability scores
            or target values
        filter_classes: array type
            The classes to run partial dependence on. Default None invokes all classes.
            Only used in classification models.
        ascending: boolean, default True
            Helps with ordering Ascending vs Descending
        ax: matplotlib.axes._subplots.AxesSubplot
            existing subplot on which to plot feature importance. If none is provided,
            one will be created.
        progressbar: bool
            Whether to display progress. This affects which function we use to operate on the pool
            of processes, where including the progress bar results in 10-20% slowdowns.
        n_jobs: int
            How many concurrent processes to use. Defaults -1, which grabs as many as are available.
            Use 1 to avoid multiprocessing altogether.
        n_samples: int
            How many samples to use when computing importance.
        method: string
            How to compute feature importance. 'model-scoring' requires Interpretation.training_labels
            prediction-variance: mean absolute value of changes in predictions, given perturbations.
            model-scoring: difference in log_loss or MAE of training_labels given perturbations.
            Note this vary rarely makes any significant differences
        scorer_type: string
            only used when method='model-scoring', and in this case defines which scoring function to use.
            Default value is 'default', which evaluates to:
                regressors: mean absolute error
                classifiers with probabilities: cross entropy
                classifiers without probabilities: f1 score
            See Skater.model.scorers for details.
        use_scaling: bool
            Whether to weight the importance values by the strength of the perturbations.
            Generally doesn't effect results unless n_samples is very small.


        Returns
        -------
        f: figure instance
        ax: matplotlib.axes._subplots.AxesSubplot
            could be used to for further modification to the plots

        Examples
        --------
            >>> from skater.model import InMemoryModel
            >>> from skater.core.explanations import Interpretation
            >>> from sklearn.ensemble import RandomForestClassifier
            >>> rf = RandomForestClassifier()
            >>> rf.fit(X,y)
            >>> model = InMemoryModel(rf.predict_proba, examples = X)
            >>> interpreter = Interpretation()
            >>> interpreter.load_data(X)
            >>> interpreter.feature_importance.plot_feature_importance(model, ascending=True, ax=ax)
            """
        try:
            global pyplot
            from matplotlib import pyplot
        except ImportError:
            raise (MatplotlibUnavailableError("Matplotlib is required but unavailable on your system."))
        except RuntimeError:
            raise (MatplotlibDisplayError("Matplotlib unable to open display"))

        importances = self.feature_importance(modelinstance,
                                              filter_classes=filter_classes,
                                              progressbar=progressbar,
                                              n_samples=n_samples,
                                              n_jobs=n_jobs,
                                              method=method,
                                              scorer_type=scorer_type,
                                              use_scaling=use_scaling)

        if ax is None:
            f, ax = pyplot.subplots(1)
        else:
            f = ax.figure

        colors = cycle(COLORS)
        color = next(colors)
        importances.sort_values(ascending=ascending).plot(kind='barh', ax=ax, color=color)
        return f, ax
def plot_feature_importance ( self , modelinstance , filter_classes = None , ascending = True , ax = None , progressbar = True , n_jobs = - 1 , n_samples = 5000 , method = 'prediction-variance' , scorer_type = 'default' , use_scaling = False ) : try : global pyplot from matplotlib import pyplot except ImportError : raise ( MatplotlibUnavailableError ( "Matplotlib is required but unavailable on your system." ) ) except RuntimeError : raise ( MatplotlibDisplayError ( "Matplotlib unable to open display" ) ) importances = self . feature_importance ( modelinstance , filter_classes = filter_classes , progressbar = progressbar , n_samples = n_samples , n_jobs = n_jobs , method = method , scorer_type = scorer_type , use_scaling = use_scaling ) if ax is None : f , ax = pyplot . subplots ( 1 ) else : f = ax . figure colors = cycle ( COLORS ) color = next ( colors ) importances . sort_values ( ascending = ascending ) . plot ( kind = 'barh' , ax = ax , color = color ) return f , ax