Skip to content

Error from simple_random on dashboard #272

Closed

Description

@jdanielnd

I'm getting this error message when I try to access "/split":

RuntimeError - Alpha and beta parameters must be positive. Received a = 22 and b = -9.:

From:

simple-random/simple_random.rb:96:in `beta'

Activity

  1. jdanielnd commented on Oct 13, 2014

    @jdanielnd
    Author

    It seems the problem is with this line: https://github.com/andrew/split/blob/f767cb79eb0ccc6d26a9b06a0dfe36a7bdc9cf68/lib/split/experiment.rb#L377

    Maybe the user is getting to conversion from a direct path and then conversions is bigger than participants? This would lead to negative parameter...

  2. jdanielnd commented on Oct 13, 2014

    @jdanielnd
    Author

    This fixes the error, but I'm not sure the validity of the solution.

    jdanielnd@954f186

    The point is: my user is getting through the target action more then once, without starting a new experiment. So Beta parameter b was negative. This fix limits the conversions maximum at the participants number of the alternative.

    I believe a better approach would be warn the user that this is happening and telling him to reconsider his experiment so as user cannot hit conversion more then once before restarting the experiment.

    What do you guys thing? If this is the way I can do this :)

  3. andrew commented on Oct 14, 2014

    @andrew
    Member

    @caser do you have any thoughts on this?

  4. johnknapp commented on Oct 23, 2014

    @johnknapp

    I got same error on a dev env ON MY SECOND PROJECT using split gem with the default redis config.
    I eliminated the error by specifying a db name in config/initializers/redis.rb thus:
    $redis = Redis.new(db: 2) # default config uses localhost:6379

    I hope this helps.

  5. skwp commented on Nov 10, 2014

    @skwp

    Same problem here, upgraded from 0.6.0 to latest 1.0 gem

  6. yagudaev commented on Feb 25, 2015

    @yagudaev

    Just hit the same problem. I use forcing a parameter with the URL override option. It initially worked fine and completed the experiment with the actual selection and not the override. But then I hit this after I restarted my server and went through the process again.

    In other words, I finished the experiment twice I believe, one with the override parameter and another time after that (also with the override). I got

    Alpha and beta parameters must be positive. Received a = 2 and b = -1
    

    I can also verify that you can increase the alpha by finishing the same experiment without the override option on (removed from URL).

  7. robquesada commented on Mar 11, 2015

    @robquesada

    Same error here. Not resolved yet.

  8. igor-brishkoski commented on Apr 15, 2015

    @igor-brishkoski

    Same thing.

  9. robquesada commented on Apr 15, 2015

    @robquesada

    Just to let you know, my error was that in the code wasn't clear when the test started and when it finishes. Sometimes it wasn't starting but finishes, so the error triggered.

    What I did to avoid it was to change the name of the metrics, so the alfa and beta counters start again (a=0, b=0), and then I analyze the code to be sure that the start/finish of the a/b test was logically correct.

  10. igor-brishkoski commented on Apr 15, 2015

    @igor-brishkoski

    Thanks @robquesada. That worked. So the issue is that I finish the experiment more times than I start the experiment?

  11. robquesada commented on Apr 15, 2015

    @robquesada

    Yeah, that it seems to be.

  12. yagudaev commented on Apr 15, 2015

    @yagudaev

    Shouldn't the gem detect this? There is a user session associated with the finish action. A user should not be able to finish the same experiment more than once. Also if the experiment hasn't started, the user should not be able to finish it.

  13. b264 commented on Aug 19, 2015

    @b264

    I had this same error. Somehow in making a new feature my staging environment's data became invalid, causing the error at the top of this issue. After much investigation, I ended up being able to fix it in the console, it was not a (current version) code problem. I thought I'd share what fixed it. The first three commands get information and the last one fixed the problem because completed_count was bigger than participant_count for one experiment.

    Split.redis.keys
    Split.redis.hget("your_experiment:1", 'participant_count')
    Split.redis.hget("your_experiment:1", 'completed_count')
    
    Split.redis.hset("your_experiment:1", 'completed_count', 3)
    
  14. derricklannaman commented on Sep 18, 2015

    @derricklannaman

    @theB264 That worked for me. Thanks!

  15. alexander-bal commented on Jun 7, 2016

    @alexander-bal
    Contributor

    the fix is in the master

  16. andrew commented on Jun 13, 2016

    @andrew
    Member

    Fixed by #408

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions