Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "contradiction index" metric #274

Closed
stepagrus opened this issue Feb 8, 2019 · 4 comments
Closed

Add "contradiction index" metric #274

stepagrus opened this issue Feb 8, 2019 · 4 comments

Comments

@stepagrus
Copy link

stepagrus commented Feb 8, 2019

Already we have one metric: difference between "voted for" and "voted against".

It would be interesting to have another metric: "contradiction index".

The calculation formula may be as follows:

difference = abs( voted_for - voted_against )
contradiction_index = ( voted_for + voted_against ) / ( difference == 0 ? 0.1 : difference )

@umputun
Copy link
Owner

umputun commented Feb 10, 2019

I have added a new field controversy to the Comment struct and controversy sorting key for rest /find.

Now we need UI support for this thing. I think all we need is:

  • show the value of controversy somehow (hover on scores?)
  • add a new sorting mode "controversial" to "sort by" dropdown

@umputun
Copy link
Owner

umputun commented Feb 10, 2019

controversy value calculated differently, similar to Reddit's version

func (s *DataStore) controversy(ups, downs int) float64 {

	if downs <= 0 || ups <= 0 {
		return 0
	}

	magnitude := ups + downs
	balance := float64(downs) / float64(ups)
	if ups <= downs {
		balance = float64(ups) / float64(downs)
	}
	return math.Pow(float64(magnitude), balance)
}

@vosi
Copy link

vosi commented Feb 12, 2019

@vosi
Copy link

vosi commented Feb 12, 2019

ааа... присмотрелся, вы и так в ту сторону копнули

@umputun umputun closed this as completed Feb 18, 2019
@umputun umputun added this to the v1.3 milestone Apr 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants