In [3]:
# Using Factor Analysis we can reduce the dimensionality of a
# dataset. Factor Analysis makes assumptions that PCA does not.
# Factor Analysis assumes there are implicit features that 
# represent all the features of a dataset.

from sklearn.decomposition import FactorAnalysis
from sklearn import datasets

In [4]:
iris = datasets.load_iris()

fa = FactorAnalysis(n_components=2)
iris_two_dim = fa.fit_transform(iris.data)
iris_two_dim[:5]


Out[4]:
array([[-1.33125848,  0.55846779],
       [-1.33914102, -0.00509715],
       [-1.40258715, -0.307983  ],
       [-1.29839497, -0.71854288],
       [-1.33587575,  0.36533259]])

In [ ]: