You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The PCADecomposition visualizer should generate a 3D plot when passed proj_dim=3; however, it currently needs to be explicitly passed a matplotlib 3D axis in order to render correctly. For instance, the following code will return a 2D plot despite the proj_dim parameter being set to 3.
from yellowbrick.datasets import load_credit
from yellowbrick.features import PCADecomposition
X, y = load_credit()
visualizer = PCADecomposition(scale=True, proj_dim=3)
visualizer.fit_transform(X, y)
visualizer.show()
However, a 3D plot will be returned when explicitly passed a 3D axis, as in this example:
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from yellowbrick.datasets import load_credit
from yellowbrick.features import PCADecomposition
X, y = load_credit()
# Create a figure and add a 3D axis
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
visualizer = PCADecomposition(scale=True, proj_dim=3, ax=ax)
visualizer.fit_transform(X, y)
visualizer.show()
The text was updated successfully, but these errors were encountered:
The
PCADecomposition
visualizer should generate a 3D plot when passedproj_dim=3
; however, it currently needs to be explicitly passed amatplotlib
3D axis in order to render correctly. For instance, the following code will return a 2D plot despite theproj_dim
parameter being set to3
.However, a 3D plot will be returned when explicitly passed a 3D axis, as in this example:
The text was updated successfully, but these errors were encountered: