Skip to content

Instantly share code, notes, and snippets.

View loicbertron's full-sized avatar

Loïc Bertron loicbertron

View GitHub Profile
@loicbertron
loicbertron / How to identify recurring patterns in this set of transactional data
Created March 19, 2020 19:45
How to identify recurring patterns in this set of transactional data
I'm working on a dataset of banking transactions and would like to find recurrent transactions.
I've been mapping transactions per merchant in timeseries, and tried to use acf from statsmodels.tsa.stattools to calculate the autocorrelation function but i'm not getting the expected results:
`r = acf(ts, fft=False)`
For example this set of transaction (ASSURANCE DESJ) is getting an acf score of 0.3159 when it's obviously a recurring transaction (same amount, same frequency).
[![enter image description here][1]][1]
Another example of recurring transactions with acf=0.22775:
function showthemess()
{
$.ajax({
type: 'GET',
url: '/tweets/'+ id,
data: {'last_tweet' : lasttweet},
success: function(data){
lasttweet = data.last_tweet;
$(function () {
$("#tweetspanel")
@loicbertron
loicbertron / RTMP From AMS
Created July 12, 2013 19:22
RTMP VOD Pull error from AMS Server v5 with RTMP-Nginx. RTMP Live Pull works !
rtmpdump -i "rtmp://ams.server.com/vod playpath=mp4:myfolder/myfile.mp4" -o ~/test.flv
RTMPDump v2.4
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
Connecting ...
WARNING: HandShake: client signature does not match!
INFO: Connected...
Starting download at: 0.000 kB
INFO: Metadata:
INFO: duration 3299.36
INFO: moovPosition 254621187.00
@loicbertron
loicbertron / Faceted Query per user
Created December 12, 2012 17:43
Apache logs and Faceted query
curl -XGET http://127.0.0.1:19200/logstash-2012.12.12/apache/_search?pretty=1 -d '{
"query" : { "match" : {"@fields.username" : "user1"}},
"facets" : { "ip" : { "terms" : {"field" : "client"} } }
}'
@loicbertron
loicbertron / gist:4048019
Created November 9, 2012 20:27
Twitter Mapping
{
"tweet" : {
"_source" : {
"compress" : true
},
"properties" : {
"contributors" : {
"type" : "long",
"ignore_malformed" : false
},