English 中文(简体)
社会网络评级
原标题:Social Network Ranking Algorithm

我正试图根据类似数目、评论和接收和时间的重新定位,为社会网络制定一个简单的排名算法。 我阅读了正文使用的对等等级算法,试图做类似的事情,但我不能正确。

算法现在应显示公众职位。

这里是我尝试的:

let nComments = (from c in db.Comments where c.postid == r.pageOwner.PostId select c).Count()

let nReposts = (from s in db.Posts where s.RepostedFrom_postid == r.pageOwner.PostId select s).Count()

let nLikes = (from u in db.UserPageRelations where u.Post_id == r.pageOwner.PostId select u).Sum(s => s.Rate)

let TimeDecayFactor = ignoretime ? 1 : Math.Exp(-(DateTime.Now - Post.Date).TotalHours)

let TotalEdge = (1 * nComments + 3 * nLikes + 2 * nReposts + 1) * TimeDecayFactor

 orderby (TotalEdge) descending

是否有更好的解决办法?

最佳回答

您可使用PageRank算法,向每个人开放。 这一算法旨在利用网站之间的链接对网站进行排名,但可以使用评论、复信和类似(有不同的系数)而不是链接。

如果您认为第1页太困难,难以执行(因为数据规模大),那么你可以使用>opic算法,该计算结果相同,但记忆却要少得多。

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签