algorithm - 转换评级量表

标签 algorithm math scale rating

我有一个网站,人们可以在其中评估某些主题。这是比例[1-4]

enter image description here

但是,我可能在总体评级的可读性方面遇到问题。网络中最常见的比例是 [1-5]。

目前我正在使用1.5/4

谷歌说:

不使用 5 分制的评分:默认情况下,Google 假定您的网站使用 5 分制,其中 5 是最好的评分,1 是最差的评分,但您可以使用任何其他规模。如果这样做,您可以标记最好和最差的评分,Google 会将其扩展到丰富摘要中使用的 5 星级系统。

如何进行这种从 4 到 5 的转换?

最佳答案

如果你想在你的一端进行缩放,明显的线性变换是

oneToFive = (oneToFour - 1.0) * (4.0/3.0) + 1.0

健全性检查:

(1 - 1.0) * (4.0/3.0) + 1.0 == 1.0
(4 - 1.0) * (4.0/3.0) + 1.0 == 5.0

如果您想让 Google 做到这一点,请继续阅读 the instructions page 。您只需要设置几个值:

reviewRating.bestRating Text*
The highest value allowed in this rating system.
* Required if the rating system is not on a 5-point scale. If bestRating > is omitted, 5 is assumed.

reviewRating.worstRating Text*
The lowest value allowed in this rating system.
* Required if the rating system is not on a 5-point scale. If worstRating > is omitted, 1 is assumed.

关于algorithm - 转换评级量表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40668071/

相关文章:

java - Java BigInteger 的按位非是负数

cross-browser - 不同浏览器中的背景大小

android - 如何以原始比例设置自定义单选按钮android的背景图像?

java - 中位数java实现的中位数

algorithm - 麻省理工学院讲座错了吗?散列中的开放寻址分析

java - 如何在android中将透视变换应用于ImageProxy或Bitmap

html - 变换比例动画从错误的位置开始

c++ - 贝塞尔 handle 如何工作?

algorithm - 如何确定笛卡尔积中单个单元格的值

algorithm - Delaunay 三角剖分的 Voronoi 站点点