Normalizing features
This commit is contained in:
parent
8d345fcd11
commit
0d7e19b882
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user