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

KNN giving highest accuracy with K=1?
Ensemble classifier for different features
getting paragraph representation for unseen paragraphs in doc2vec
Does Weka setClassIndex and setAttributeIndices start attribute from different rage?
Criteria to classify retail customers as churn Y or N
How to quantify similarity of tree models? (XGB, Random Forest, Gradient Boosting, etc.)
Logistic Regression(Classification Technique) on Time-dependent Predictors/variables Data
High Relative absolute error and Root relative squared error in classification
voting with average of probabilities in weka
Weka : how to use cross validation in code
Decision Tree relevent classification for this task?
Accuracy of a naive bayes classifier
Weka library java: how to get the prospect of a classification?
Multilabel Text Classification NLTK
Loss function for class imbalanced binary classifier in Tensor flow
can we use GMDH for two or three class classiication

Categories

HOME
classification
excel-formula
algolia
grizzly
grpc
watson-iot
data-modeling
query-string
terminal
browser-cache
opacity
sequence
open-search-server
jquery-select2
rethinkdb
ejb-3.0
theory
core-data
osclass
oxid
reportlab
wallet
indri
single-page-application
mattermost
matlab-gui
quality-center
knapsack-problem
orgchart
libxml2
spock
units-of-measurement
recreate
2checkout
tikz
blockly
kubectl
circle
tunnel
sampling
outlook-2010
scip
mongoid5
jibx
origami
ngrok
compiled-query
collation
java-5
autodesk-data-management
cakephp-3.2
codepen
g77
xamarin-test-cloud
senti-wordnet
reloaddata
was
scrollmagic
indoor-positioning-system
hdr
rowname
syslog4j
window.location
bbedit
cexception
salesforce-service-cloud
video-embedding
music-player
firefox-os
newlib
exchange-server-2007
sparkcore
vensim
p4python
pdcurses
clearquest
glog
log-analysis
radgrid
maven-archetype
douglas-peucker
nsurlrequest
powershell-v1.0
pyalgotrade
power-management
elixir-framework
pthreads-win32
windows-phone-store
code-complete
google-mirror-api
randomaccessfile
mencoder
myrrix
grape-api
nsnumber
reference-manual
urlfetch
zepto
yii-components
correctness
erlide
nsundomanager
cherokee
zipstream
designated-initializer
http-response-codes
rollover
qprocess
appointment
dynamic-scope
html-help-workshop
unauthorized
high-load
hotfix

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