Algorithm to calculate a page importance based on its views / comments

前端 未结 6 587
别跟我提以往
别跟我提以往 2021-01-31 12:02

I need an algorithm that allows me to determine an appropriate field for my website\'s sitemap based on the page\'s views and comments count.

6条回答
  •  滥情空心
    2021-01-31 12:59

    What several posters have essentially advocated without conceptual clarification is that you use linear regression to determine a weighting function of webpage view and comment counts to establish priority.

    This technique is pretty easy to implement for your problem, and the basic concept is described well in this Wikipedia article on linear regression models.

    A quick summary of how to apply it to your problem is:

    1. Determine the parameters of the line which best fits the view and comment count data for all your site's webpages, i.e., use linear regression.
    2. Use the line parameters to derive your priority function for the view/count parameters.

    Code examples for basic linear regression should not be hard to track down if you don't want to implement it from scratch from basic math formulas (use the web, Numerical Recipes, etc.). Also, any general math software package like Matlab, R, etc., comes with linear regression functions.

提交回复
热议问题