Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #49657 > unrolled thread
| Started by | Surya Kasturi <suryak@ieee.org> |
|---|---|
| First post | 2013-07-02 23:43 +0200 |
| Last post | 2013-07-03 10:26 +1000 |
| Articles | 7 — 6 participants |
Back to article view | Back to comp.lang.python
how to calculate reputation Surya Kasturi <suryak@ieee.org> - 2013-07-02 23:43 +0200
Re: how to calculate reputation Tobiah <toby@tobiah.org> - 2013-07-02 14:59 -0700
Re: how to calculate reputation Surya Kasturi <suryak@ieee.org> - 2013-07-03 00:19 +0200
Re: how to calculate reputation Ian Kelly <ian.g.kelly@gmail.com> - 2013-07-02 16:29 -0600
Re: how to calculate reputation Joshua Landau <joshua.landau.ws@gmail.com> - 2013-07-02 23:27 +0100
Re: how to calculate reputation Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-07-03 00:18 +0000
Re: how to calculate reputation Chris Angelico <rosuav@gmail.com> - 2013-07-03 10:26 +1000
| From | Surya Kasturi <suryak@ieee.org> |
|---|---|
| Date | 2013-07-02 23:43 +0200 |
| Subject | how to calculate reputation |
| Message-ID | <mailman.4127.1372801460.3114.python-list@python.org> |
[Multipart message — attachments visible in raw view] — view raw
Hi all, this seems to be quite stupid question but I am "confused".. We set the initial value to 0, +1 for up-vote and -1 for down-vote! nice. I have a list of bool values True, False (True for up vote, False for down-vote).. submitted by users. [True, False, False, True....] Now to calculate the total reputation should I take True = +1, False=0 [or] True = +1, False=-1 ?? for adding all. I am missing something here.. and that's clear.. anyone please help me on it? Thanks
[toc] | [next] | [standalone]
| From | Tobiah <toby@tobiah.org> |
|---|---|
| Date | 2013-07-02 14:59 -0700 |
| Message-ID | <T2IAt.5266$Jk4.4110@newsfe09.iad> |
| In reply to | #49657 |
On 07/02/2013 02:43 PM, Surya Kasturi wrote: > Hi all, this seems to be quite stupid question but I am "confused".. > We set the initial value to 0, +1 for up-vote and -1 for down-vote! nice. > > I have a list of bool values True, False (True for up vote, False for down-vote).. submitted by users. > > [True, False, False, True....] > > Now to calculate the total reputation > > should I take True = +1, False=0 [or] True = +1, False=-1 ?? for adding all. > > I am missing something here.. and that's clear.. anyone please help me on it? > > Thanks > > > for vote in bool_votes: reputation += 2 * vote - 1 Tobiah
[toc] | [prev] | [next] | [standalone]
| From | Surya Kasturi <suryak@ieee.org> |
|---|---|
| Date | 2013-07-03 00:19 +0200 |
| Message-ID | <mailman.4130.1372803626.3114.python-list@python.org> |
| In reply to | #49658 |
[Multipart message — attachments visible in raw view] — view raw
On Tue, Jul 2, 2013 at 11:59 PM, Tobiah <toby@tobiah.org> wrote: > On 07/02/2013 02:43 PM, Surya Kasturi wrote: > >> Hi all, this seems to be quite stupid question but I am "confused".. >> We set the initial value to 0, +1 for up-vote and -1 for down-vote! nice. >> >> I have a list of bool values True, False (True for up vote, False for >> down-vote).. submitted by users. >> >> [True, False, False, True....] >> >> Now to calculate the total reputation >> >> should I take True = +1, False=0 [or] True = +1, False=-1 ?? for adding >> all. >> >> I am missing something here.. and that's clear.. anyone please help me on >> it? >> >> Thanks >> >> >> >> > for vote in bool_votes: > > reputation += 2 * vote - 1 > > > Tobiah > -- > http://mail.python.org/**mailman/listinfo/python-list<http://mail.python.org/mailman/listinfo/python-list> > I think I didnt explain it clearly.. let me make it clear.. 1. The database we are using is having BooleanField for it!! so, cant do anything 2. I am not looking for sorting algorithms .. just simple math :) It sounds crazy but let me describe my confusion lets have 3 users with [null, null, null] reputation = 0 [T, - - ] rept = 1 [T T T] rept = 3 [T T F] rept = 1 (its jumping from 3 to 1 -->but generally, we observe only decrease in 1 right?) [T T F] rept = 3 (its jumping from 1 to 3) These jumpings are common? or my logic is going any wrong?
[toc] | [prev] | [next] | [standalone]
| From | Ian Kelly <ian.g.kelly@gmail.com> |
|---|---|
| Date | 2013-07-02 16:29 -0600 |
| Message-ID | <mailman.4131.1372804228.3114.python-list@python.org> |
| In reply to | #49658 |
On Tue, Jul 2, 2013 at 4:19 PM, Surya Kasturi <suryak@ieee.org> wrote: > I think I didnt explain it clearly.. let me make it clear.. > > 1. The database we are using is having BooleanField for it!! so, cant do > anything > 2. I am not looking for sorting algorithms .. just simple math :) It sounds > crazy but let me describe my confusion Nobody has suggested a *sorting* algorithm. > lets have 3 users with > > [null, null, null] > reputation = 0 > > [T, - - ] > rept = 1 > > [T T T] > rept = 3 > > [T T F] > rept = 1 (its jumping from 3 to 1 -->but generally, we observe only decrease > in 1 right?) I'm with you so far. You see the reputation drop by 2 here because you have both removed an up-vote and added a down-vote. Each of these things individually will cause the sum to drop by 1. > [T T F] > rept = 3 (its jumping from 1 to 3) > > These jumpings are common? or my logic is going any wrong? This is the same scenario as the previous one, so I don't understand why you identify the reputation sum as 3 here.
[toc] | [prev] | [next] | [standalone]
| From | Joshua Landau <joshua.landau.ws@gmail.com> |
|---|---|
| Date | 2013-07-02 23:27 +0100 |
| Message-ID | <mailman.4149.1372835487.3114.python-list@python.org> |
| In reply to | #49658 |
On 2 July 2013 23:19, Surya Kasturi <suryak@ieee.org> wrote: > > I think I didnt explain it clearly.. let me make it clear.. Yeah... I don't get it.
[toc] | [prev] | [next] | [standalone]
| From | Steven D'Aprano <steve+comp.lang.python@pearwood.info> |
|---|---|
| Date | 2013-07-03 00:18 +0000 |
| Message-ID | <51d36dd2$0$29999$c3e8da3$5496439d@news.astraweb.com> |
| In reply to | #49657 |
On Tue, 02 Jul 2013 23:43:51 +0200, Surya Kasturi wrote: > Hi all, this seems to be quite stupid question but I am "confused".. We > set the initial value to 0, +1 for up-vote and -1 for down-vote! nice. > > I have a list of bool values True, False (True for up vote, False for > down-vote).. submitted by users. > > [True, False, False, True....] > > Now to calculate the total reputation > > should I take True = +1, False=0 [or] True = +1, False=-1 ?? for adding > all. You can work this out for yourself by doing a couple of tests. Suppose you have somebody who gets one Upvote and five Downvotes: [True, False, False, False, False, False] What reputation would you expect them to have? We can't answer that, only you can answer that. With True=+1 and False=0, the sum is +1. With True=+1 and False=-1, the sum is -4. Upvotes and downvotes don't have to be weighted the same: With True=+5 and False=-1, the sum is 0. With True=+1 and False=-5, the sum is -24. *You* have to decide how you want the reputation system to work, then program it to work that way. For a real web app, you almost certainly do not want something this simple. Perhaps new accounts with low reputation themselves should be weighted less than old, established accounts with high reputation. There is no standard for counting reputation, and so every web site that does something like this does it differently, and most get it wrong, including some really big, well-known sites like Amazon. It's very easy to come up with lousy algorithms for calculating reputation, much harder to come up with good algorithms. I second Joshua Landau's recommendation that you read: http://www.evanmiller.org/how-not-to-sort-by-average-rating.html and I bring to your attention that this doesn't necessarily have anything to do with *sorting*. The Ruby function given returns a number between 0 and 1. You don't have to sort on that number, you can use that as your reputation. -- Steven
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2013-07-03 10:26 +1000 |
| Message-ID | <mailman.4150.1372835488.3114.python-list@python.org> |
| In reply to | #49675 |
On Wed, Jul 3, 2013 at 10:18 AM, Steven D'Aprano <steve+comp.lang.python@pearwood.info> wrote: > It's very easy to come up with lousy algorithms for calculating > reputation, much harder to come up with good algorithms. Yes. Reminder: Don't just average your users' ratings. http://xkcd.com/937/ In fact, mere upvotes and downvotes mightn't be that useful regardless of algorithm, depending on what you're doing. ChrisA
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web