0
私はthisが本当によく説明された計算を見つけましたが、それが正しいかどうか本当にわかりません。WilsonスコアはC#の1-5の評価で
私は、次の double posf = model.stars == 1 ? 0 :
model.stars == 2 ? 0.25 :
model.stars == 3 ? 0.5 :
model.stars == 4 ? 0.75 :
model.stars == 5 ? 1 : 0;
double negf = model.stars == 1 ? 1 :
model.stars == 2 ? 0.75 :
model.stars == 3 ? 0.5 :
model.stars == 4 ? 0.25 :
model.stars == 5 ? 0 : 0;
rating.positif += posf;
rating.negatif += negf;
rating.ratingcount += 1;
rating.ratingavg = Math.Round((((rating.positif/rating.ratingcount) * 4) + 1) * 2, 0)/2;
rating.calcSort = ((rating.positif + 1.9208)/(rating.positif + rating.negatif) - 1.96 * Math.Sqrt((rating.positif * rating.negatif)/(rating.positif + rating.negatif) + 0.9604)/(rating.positif + rating.negatif))/(1 + 3.8416/(rating.positif + rating.negatif));
としてのC#に変換
Stars Negative Positive Total
0 0 0 0
1 1 0 1
2 0.75 0.25 1
3 0.5 0.5 1
4 0.25 0.75 1
5 0 1 1
SET new.total = new.positive + new.negative,
new.stars = ROUND((((new.positive/new.total) * 4) + 1) * 2, 0)/2,
new.lower_bound = ((new.positive + 1.9208)/(new.positive + new.negative) - 1.96 * SQRT((new.positive * new.negative)/(new.positive + new.negative) + 0.9604)/(new.positive + new.negative))/(1 + 3.8416/(new.positive + new.negative))
:私は5
のために最も重要な部分はこれで1つの計算を見て、私はhaventは件名に記事をたくさん見てきました
このコーディングが正しい変換であり、SQLバージョンが実際に正しい場合は、誰かが助けてくれますか?
いただきありがとうございます。数学と数式はURLで正しいのですか?それは実際にもっと重要です。 – drewex