Xtra-Computing / thundersvm

ThunderSVM: A Fast SVM Library on GPUs and CPUs
Apache License 2.0
1.55k stars 215 forks source link

Using Point2D data, do i need to scale? #218

Closed antithing closed 4 years ago

antithing commented 4 years ago

Hi, i am trying to train using Point2D data (from facial landmarks). I am saving the data to file for training as:

index 1:point1.x 2:point1.y 3:point2.x 4:point2.y.... Each line of my data looks like:

0 1:59 2:117 3:70 4:109 5:84 6:108 7:97 8:109 9:111 10:112 11:147 12:112 13:161 14:106 15:176 16:104 17:191 18:107 19:202 20:116 21:128 22:134 23:128 24:150 25:128 26:167 27:127 28:183 29:110 30:197 31:117 32:199 33:127 34:201 35:137 36:199 37:146 38:197 39:69 40:138 41:81 42:132 43:95 44:133 45:105 46:142 47:94 48:144 49:80 50:144 51:151 52:143 53:162 54:133 55:175 56:132 57:187 58:138 59:177 60:143 61:164 62:144 63:91 64:219 65:103 66:217 67:115 68:216 69:127 70:218 71:140 72:215 73:151 74:216 75:164 76:219 77:152 78:228 79:141 80:235 81:127 82:238 83:112 84:237 85:100 86:230 87:111 88:223 89:128 90:226 91:143 92:223 93:143 94:224 95:127 96:227 97:110 98:226

Do i need to scale this data before I train? How should I be scaling this kind of data?

Thank you!

antithing commented 4 years ago

I have scaled the data using the following:

for (int i = 0; i < faceMarkers.size(); i++)
        {
            faceMarkers[i].x = (faceMarkers[i].x / image.cols);
            faceMarkers[i].y = (faceMarkers[i].y / image.rows);
        }