Trying to create a hidden markov model to find recurring payments in this transactions json: https://pastebin.com/tzRaqMxk
I created a similarity score, to estimate the likely hood of a transaction date, amount, and name being a recurring transaction.
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);
});
The first challenge is what to do if the recurring transaction is not on the same day of the month I.e. usually happens on the 18th, but because the 18th fell on a Saturday, the payment doesn't clear until the 20th. What statistical measure to I used to identify a similar score as nearly the same, but not a probability of 1.
Then after I have this array of data, how can I feed that into a hidden markov model?
via user1093111
No comments:
Post a Comment