Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix pca import problem #773

Merged
merged 1 commit into from
Feb 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions mlxtend/plotting/tests/test_pca_corr_graph.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import pytest
from mlxtend.plotting import plot_pca_correlation_graph
from mlxtend.data import iris_data
from sklearn.decomposition.pca import PCA

from distutils.version import LooseVersion as Version
from sklearn import __version__ as sklearn_version

if Version(sklearn_version) < '0.22':
from sklearn.decomposition.pca import PCA
else:
from sklearn.decomposition import PCA


def test_pass_pca_corr():
Expand Down Expand Up @@ -62,4 +69,3 @@ def test_not_enough_components():
plot_pca_correlation_graph(X, variables_names=['1', '2', '3', '4'],
X_pca=X_pca,
explained_variance=eigen[:-1])