尝试创建隐藏的马尔可夫模型,以在此交易json中查找定期付款: https://pastebin.com/tzRaqMxk
我创建了一个相似度分数,用于估算交易日期,金额和名称的可能性,这是经常性交易。
nn = require('nearest-neighbor');
const items = https://pastebin.com/tzRaqMxk //pastebin json here
var query = { amount: 89.4, name: "SparkFun", date: "2017-05-28"};
var fields = [
{ name: "name", measure: nn.comparisonMethods.word },
{ name: "amount", measure: nn.comparisonMethods.number, max: 100 },
{ name: "date", measure: nn.comparisonMethods.date, max: 31 }
];
nn.findMostSimilar(query, items, fields, function(nearestNeighbor, probability) {
console.log(query);
console.log(nearestNeighbor);
console.log(probability);
});
如果经常性交易不是在该月的同一天,那么第一个挑战是该怎么办?通常发生在18号,但由于18号星期六下降,付款直到20日才清除。我用什么统计方法来确定类似得分几乎相同,但不是1的概率。
然后,在我拥有这个数据数组后,如何将其输入隐藏的马尔可夫模型?