xy
plot_y_vs_X(X, y, nrows=5, ncols=2, figsize=(30, 20), ylabel='y', feature_names=None)
¶
Plots y versus each feature in X.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X |
ndarray
|
2D array of input features. |
required |
y |
ndarray
|
1D array of target values. |
required |
nrows |
int
|
Number of rows in the subplot grid. Defaults to 5. |
5
|
ncols |
int
|
Number of columns in the subplot grid. Defaults to 2. |
2
|
figsize |
tuple
|
Size of the entire figure. Defaults to (30, 20). |
(30, 20)
|
ylabel |
str
|
Label for the y-axis. Defaults to ‘y’. |
'y'
|
feature_names |
list of str
|
List of feature names. Defaults to None. If None, generates feature names as x0, x1, etc. |
None
|
Examples:
>>> from sklearn.datasets import load_diabetes
>>> from spotpython.plot.xy import plot_y_vs_X
>>> data = load_diabetes()
>>> X, y = data.data, data.target
>>> plot_y_vs_X(X, y, nrows=5, ncols=2, figsize=(20, 15))
Source code in spotpython/plot/xy.py
5 6 7 8 9 10 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 |
|