Plotting
This module contains functions for plotting the results of the FACSIMILE procedure.
plotting
Functions:
-
plot_predictions
–Plot predicted scores against true scores.
-
plot_weights
–Plot a heatmap of a dataframe representing classifier weights.
plot_predictions
plot_predictions(true: ArrayLike, pred: ArrayLike, target_names: List[str] = None, scale: float = 1.0, fname: str = None, palette: List[str] = None, scatter_kws: Optional[Dict] = None, line_kws: Optional[Dict] = None, figure_kws: Optional[Dict] = None, ax: Axes = None)
Plot predicted scores against true scores.
Parameters:
-
true
ArrayLike
) –True target variable scores.
-
pred
ArrayLike
) –Predicted target variable scores.
-
target_names
List[str]
, default:None
) –List of target variable names. Defaults to
None
. -
scale
float
, default:1.0
) –Scale of the plot. Defaults to
1.0
. -
fname
str
, default:None
) –Filename to save the plot to. Defaults to
None
. -
palette
List[str]
, default:None
) –List of colours to use for each target. Defaults to
None
. -
scatter_kws
Optional[Dict]
, default:None
) –Keyword arguments to pass to the scatter plot. Defaults to
None
. -
line_kws
Optional[Dict]
, default:None
) –Keyword arguments to pass to the regression line. Defaults to
None
. -
figure_kws
Optional[Dict]
, default:None
) –Keyword arguments to pass to the figure. Defaults to
None
. -
ax
Axes
, default:None
) –Axis to plot on. Defaults to
None
.
Source code in facsimile/plotting.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
|
plot_weights
plot_weights(data: DataFrame, cmap: str = 'RdBu', colorbar_shrink: float = 1, colorbar_aspect: int = 5, figsize: tuple = None, vmin: float = None, vmax: float = None) -> None
Plot a heatmap of a dataframe representing classifier weights.
Parameters:
-
data
DataFrame
) –The dataframe to plot.
-
cmap
str
, default:'RdBu'
) –The colormap to use for the heatmap. Defaults to 'viridis'.
-
colorbar_shrink
float
, default:1
) –The size of the colorbar. Defaults to 1.
-
colorbar_aspect
int
, default:5
) –Aspect ratio of the colorbar. Defaults to 20.
-
figsize
tuple
, default:None
) –Figure size as (width, height). If None, a default size is determined based on the shape of the dataframe. Defaults to None.
-
vmin
float
, default:None
) –Minimum value for the colormap. Defaults to None.
-
vmax
float
, default:None
) –Maximum value for the colormap. Defaults to None.
Source code in facsimile/plotting.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
|