n8 / cohort_me Goto Github PK
View Code? Open in Web Editor NEWProvides tools to Ruby and Rails developers to perform cohort analysis.
License: MIT License
Provides tools to Ruby and Rails developers to perform cohort analysis.
License: MIT License
I tried using this with my app that uses Mongoid and got the following error:
>> CohortMe.analyze(activation_class: Hackathon)
NoMethodError: private method `select' called for Hackathon:Class
from /Users/theycallmeswift/.rvm/gems/ruby-1.9.3-p194/gems/cohort_me-0.0.1/lib/cohort_me.rb:34:in `analyze'
from (irb):2
from /Users/theycallmeswift/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.12/lib/rails/commands/console.rb:47:in `start'
from /Users/theycallmeswift/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.12/lib/rails/commands/console.rb:8:in `start'
from /Users/theycallmeswift/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.12/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Hey Cohort Me Team,
Love the idea of this tool! Curious, is it still working? Or too outdated at this point for a more modern rails app? e.g. rails 5+
Thanks again for this useful idea!
CohortMe.analyze(period: 'months', activation_class: Transfer.unscoped)
results in this query
SELECT DISTINCT transfers.user_id, transfers.created_at, cohort_date, FLOOR(extract(epoch from (transfers.created_at - cohort_date))/2592000) as periods_out FROM "transfers" JOIN (SELECT transfers.user_id, MIN(transfers.created_at) as cohort_date FROM "transfers" WHERE (created_at > '2014-04-18 11:31:53.062696') GROUP BY "transfers"."user_id") AS cohorts ON transfers.user_id = cohorts.user_id WHERE (created_at > '2014-04-18 11:31:53.062696')
If I make couple of transfers as a user in a cohort, then the count will increase by the number of transfers (activations) instead of just 1. That is, starting with this [2, 0, 0, 0, 0, 0, 0, 0, 0, 0]
and then after multiple transfer by the same user results in [2, 0, 0, 0, 0, 0, 0, 0, 2, 0]
instead of [2, 0, 0, 0, 0, 0, 0, 0, 1, 0]
.
I'm using Rails 4.2.1 and Postgresql 9.4.1. Please advice!
steps to reproduce:
CohortMe.analyze(period: "months", ...)
produces:
419 users 100% 16% 17% 55% 0% 0% 0% 0% 0%
when there should be no 0% results.
The problem lies with TIMEDIFF. From http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_timediff
The result returned by TIMEDIFF() is limited to the range allowed for TIME values.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.