Intelligent Feature Selection (with SVM or PCA)

Ok, here’s the much simplified and tidied code. You feed it a fluid.dataset~ and it does the rest. (in my case I have a coll with the column labels.


----------begin_max5_patcher----------
4350.3oc0ck8iaajl+Y6+JHDlGlcQaM08w7TNlMYWr1yDrwKBFDLnAaopaSa
JRARp11Yv3+1mupJJ15fGkjptcm7PmJ7npuie02U8Qk+4KewraJ+jodVxeN4
WSdwK9mu7EuvcI6EdQ6+8KlsJ8SKxSqcO1rByGKu48ytxeqFymZbWtJ4ilr6
dWS816TtoI2zz740F+rOaVx+n8VqSaV7trh6ttxrnweWLBglitJQhmi26eXW
kvk16PHyQcyPwlUYEvz6HIzCWzuntqhauZ1RG8Az7qvjY1q8ud4Ks+4pupLL
iglyer4WbD425C42dXJoFaIcERMmS4BLRo4XMBqz.WoGmqv8xUni4J04vTqL
00o2YNVKZRWdtHVMwwQT1bshRHDrjQnZMGTqT53LKITUnLhZvklaMU4ke773
WIwwSRhXN2xjbpfJHbkh.5V14na6gcEwje+s7j6pJ2rN4a9sb34qy9MSBk.F
ZFV.b0TBAO.WJjy4BIWQwDMCoPTPmi4hyQoS5QJHhqTndypGAYPe.ALSEKY.
KhxfljkaVsN4ljEk4Cau19LVt+lzh6r+a2COljfP71zj74fcNBSCXADAqERq
MvyYKA8XAAUGSmVvZYRtMqooJsn91xpUmONXK2ef8OoB1Kn0QBFPwQm6G2j+
TbMlysrFFC7FrSfpTRgRSIVzufFItFKioONPcm7pW8JmJOyTzLu.z6o4fofy
yS.Abka8wgEy0XMQJkHtBwv18+Tdjb7w0QVDzg32SVDUAyVrAGvALIVHDLB3
kfABKBSFKAiHlBl0UYEMmYDrJWDrTHbUXS.EwAVlqDDIDBKkDKtkFw8+2luI
a47koMo0llubpp9stEtMuLsYR6DakNZ0bE3hjRITIUnXDv2.VKijyAlH5hmN
AwWFTRjmU2DtjX6tBMDjHFRG.x7Qw3RAhB9InwxKoJhBh2m0L2gLVWVOLd.d
pqWk1Tk8oIEAbE2BF3D7bIWy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5ovu+yomNAhHZtu0KjRJk326PvPPIwm.+wJi4LnPmzqqlZ
XgMZy3SbuArrUzjdxjmhgDBe09DHrv4QQJzXMO9z3+mY4ISextX2vc46fZ8X
Da56uaxyK+3oKBIbe6EIUXkKfSDWy6qi41uep3ZDR8Xv.jeOx.tiu3GKyOCH
RWIj3PjPbemdsqKsnPfq2Tsd7xjdTvoLjOtFBGIzNLLQwEDUfQnI65cSFlCl
Mb11rVOh5VyJyBS18iexc8gY5xT9AhCsaihFGhymhhEVbBR9IAD8lvLCrCpa
8eHa6scXSfNpdRpMEKqet4A4Agb7260a+8hjXjzeVSLAR29YDHwQE6zjt9Dp
R3qSaJSdsMKzYQa8qaL2tIOuYxCX4vddUw4XeYsE1e7y7ifcWicfW1u0Eo6Q
Ecg3aqfPW6nFUl5j4IhRp7wYP6PxThlpUQHU8uhxCS8yquWfOZqlymOAf+eI
qp4yI+W2UNUYwwZ6OL0s14YsG5sv9+HM2uikGze1I7oE7fngJl7DuPVEsK8W
Zq9ErK0d.Smol1+sy4NAOqnpdcqJz8CW2K+Wu7eibe7Jh
-----------end_max5_patcher-----------

edit:
It will crash Max if you open a dataset with 0 range though.