我有一个网站,人们可以在其中评估某些主题。这是比例[1-4]。
但是,我可能在总体评级的可读性方面遇到问题。网络中最常见的比例是 [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/