Dear SciKitters,
when running a PCA on a rather small dataset, I end up in the situation
that the first principal component is predominant.
My dataset contains 694 samples with 177 features each.
Here comes my code
"
X = dataDescrs_array
y = dataActs_array
target_names = ['inactive','active']
pca = PCA(n_components=2)
X_r = pca.fit(X).transform(X)
print 'explained variance ratio (first two components):', \
pca.explained_variance_ratio
"
=>
explained variance ratio (first two components): [ 1.00000000e+00
1.22493763e-32]
=> output of X.shape, y.shape, target_names:
X.shape (694, 177)
y.shape (694,)
target_names ['inactive', 'active']
When using different datasets (more samples, again 177 features per
sample), the PCA result is still the same.
I fear that I mixed up my syntax...
Cheers & Thanks,
Paul
This message and any attachment are confidential and may be privileged or
otherwise protected from disclosure. If you are not the intended recipient, you
must not copy this message or attachment or disclose the contents to any other
person. If you have received this transmission in error, please notify the
sender immediately and delete the message and any attachment from your system.
Merck KGaA, Darmstadt, Germany and any of its subsidiaries do not accept
liability for any omissions or errors in this message which may arise as a
result of E-Mail-transmission or for damages resulting from any unauthorized
changes of the content of this message and any attachment thereto. Merck KGaA,
Darmstadt, Germany and any of its subsidiaries do not guarantee that this
message is free of viruses and does not accept liability for any damages caused
by any virus transmitted therewith.
Click http://www.merckgroup.com/disclaimer to access the German, French,
Spanish and Portuguese versions of this disclaimer.
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general