MCPcopy Create free account
hub / github.com/audeering/opensmile / buildFtSelMap

Method buildFtSelMap

src/classifiers/svmSink.cpp:769–806  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

767}
768
769int smileSvmModel::buildFtSelMap(int n, const char * name)
770{
771 if (name == NULL || n < 0) {
772 return -1;
773 }
774 if (ftSelMap == NULL) {
775 ftSelMap = (int *)malloc(sizeof(int) * vectorDim);
776 for (int i = 0; i < vectorDim; i++) {
777 ftSelMap[i] = -1;
778 }
779 }
780 int i = n;
781 int j = n - 1;
782 if (j >= vectorDim) {
783 j = vectorDim - 1;
784 }
785 do {
786 if (i < vectorDim) {
787 if (!strcmp(name, attributeNames[i])) {
788 ftSelMap[i] = n;
789 return i;
790 }
791 i++;
792 } else {
793 if (j < 0) { return -1; }
794 }
795 if (j >= 0) {
796 if (!strcmp(name, attributeNames[j])) {
797 ftSelMap[j] = n;
798 return j;
799 }
800 j--;
801 } else {
802 if (i >= vectorDim) { return -1; }
803 }
804 } while(1);
805 return -1;
806}
807
808// Checks the feature selection map for missing features,
809// after it has been fully built.

Callers 1

myFinaliseInstanceMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected