flexcv.plot
This module provides functions for plotting and logging plots to neptune.
flexcv.plot.permutation_importance(model, model_name, X, y, features)
Calculates and plots the permutation importance of a model. Args: model (object): The model to calculate the permutation importance for. model_name (str): The name of the model. X (array-like): The features. y (array-like): The target. features (array-like | list): The feature names.
Returns:
Type | Description |
---|---|
tuple[Figure, DataFrame]
|
A tuple containing the figure and the permutation importance dataframe. |
Source code in flexcv/plot.py
flexcv.plot.plot_merf_training_stats(run, model, model_name, num_clusters_to_plot=5)
- Generalized log-likelihood across iterations
- trace and determinant of Sigma_b across iterations
- sigma_e across iterations
- bi for num_clusters_to_plot across iterations
- a histogram of the final learned bi
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model |
MERF
|
trained MERF model |
required |
num_clusters_to_plot |
int
|
number of example bi's to plot across iterations |
5
|
meta_string |
string
|
A string for use as additional info in filename. |
required |
Returns:
Type | Description |
---|---|
fig
|
figure. Also draws to display. |
Source code in flexcv/plot.py
flexcv.plot.plot_qq(y, yhat, run=None, model_name='LM', log_destination='LM_Plots/QQ/')
Creates QQ plot and logs it to a Neptune Run.
Source code in flexcv/plot.py
flexcv.plot.plot_shap(shap_values, X, run=None, log_destination='SHAP/', dependency=True, k_features=None)
Creates SHAP summary beeswarm and dependency plots (if set to True) and logs them to a Neptune Run.