classification


Feature selection priority (Matlab)


I classify some data based on libsvm classifier. I used K-fold technique to evaluate the performance. Is this correct that I use Feature Selection technique in K-fold loop? I wrote a matlab code, I am feeling the priority of FS is wrong and it should be removed from this loop.
Please answer me. Thanks
for i=1:NumKfold
train_data=train{i}(:,1:end-1);
train_p_target=train{i}(:,end);
test_data=test{i}(:,1:end-1);
test_target=test{i}(:,end);
%======================Selecting Best Features=======================
------Feature Selection Based on Evolutionally Algorithm----
ind0=output; % The index of best features
str= '-c 1 -g 2 -b 1';
svmStruct = svmtrain(train_p_target, train_data(:,ind0) , str);
[predicted_label, accuracy, decision_values] = svmpredict(test_target,
C=confusionmat(test_target,predicted_label);
acc_Selected_LibSvm(i)=sum(diag(C))/sum(C(:));
end
No! You must select feature in out of K-fold loop. In fact, first select subset of feature by your Evolutionary Algorithm and then evaluate this subset. For evaluate any subset, pass this selected subset too your classifier and return average of accuracy on the k fold of your data. for example, if k = 10, your classifier run 10 time and average of this 10 run accuracy is fitness of input subset.

Related Links

SVM-pref package from Cornell university
Text classification using Weka
different results by SMO, NaiveBayes, and BayesNet classifiers in weka
Dicompose LinSVM model into binary classifiers
weigh group of features as one with Weka
How to specify strings in Weka file?
Evaluating Test set using Weka
Need help interpret weka results
Different results in Weka GUI and Weka via Java code
imbalanced data classification with boosting algorithms
How to create ARFF file for 2D data points?
How to use weighted vote for classification using weka
Convert Web page to ARFF File for Weka classification
Liblinear bias greater than 2 improving accuracy?
Weka: Does training helps if test run is followed by training run?
Difference between logistic regression with binary output and classification

Categories

HOME
grizzly
postgresql-9.3
python-requests
gaussian
terminal
aggregation-framework
powerquery
collision-detection
python-3.4
aspectj
ng2-charts
fastreport
openstack-horizon
tag-cloud
virtuemart
summernote
android-wifi
turn.js
typedef
hololens
rvm
my.cnf
smart-device
multiple-inheritance
foxpro
exacttarget
contextmenustrip
odp.net
nsdateformatter
mixed-models
socketcluster
autodesk-data-management
php-mongodb
scrapinghub
gridgain
amazon-fire-tv
android-doze-and-standby
sharpssh
blackberry
scanf
msiexec
zsh-completion
glade
konakart
instaparse
dcast
ooad
apache2-module
sqldataadapter
dday
encode
ios8-share-extension
windows-kernel
transbase
persian
traminer
dcg
vectordrawable
radgrid
maven-archetype
bungeecord
firebase-tools
nexusdb
google-experiments
iphone-6
register-allocation
enquire.js
xps
azure-scheduler
pudb
magicsuggest
linqdatasource
configurationsection
cryptarithmetic-puzzle
openafs
big-endian
mvcmailer
clgeocoder
mscorlib
httppostedfilebase
recess
functional-specifications
quazip
javah
simultaneous
google-local-search
wtsapi32
paperless

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App