1

Normalizing features

This commit is contained in:
Alex Yatskov 2014-09-19 09:58:30 +09:00
parent 8d345fcd11
commit 0d7e19b882

View File

@ -43,6 +43,12 @@ function combine(dict, params) {
result = add(values, result); result = add(values, result);
} }
for (var key in result) {
var value = result[key];
value = Math.min(1.0, Math.max(-1.0, value));
result[key] = value;
}
return result; return result;
} }
@ -57,6 +63,8 @@ function walkRecords(data, searchParams, minScore, callback) {
callback(record, score); callback(record, score);
} }
} }
return features;
} }
function countRecords(data, searchParams, minScore) { function countRecords(data, searchParams, minScore) {