[deploy] Add alternate comment-oriented feed algos (#8042)
This commit is contained in:
parent
c42fd3461e
commit
cd18d2f436
4 changed files with 40 additions and 2 deletions
|
|
@ -11,6 +11,8 @@ class Stories::FeedsController < ApplicationController
|
|||
"more_tag_weight_randomized_at_end_experiment" => :more_tag_weight_randomized_at_end_experiment,
|
||||
"more_experience_level_weight_randomized_at_end_experiment" => :more_experience_level_weight_randomized_at_end_experiment,
|
||||
"more_comments_randomized_at_end_experiment" => :more_comments_randomized_at_end_experiment,
|
||||
"more_comments_medium_weight_randomized_at_end_experiment" => :more_comments_medium_weight_randomized_at_end_experiment,
|
||||
"more_comments_minimal_weight_randomized_at_end_experiment" => :more_comments_minimal_weight_randomized_at_end_experiment,
|
||||
"mix_of_everything_experiment" => :mix_of_everything_experiment
|
||||
}.freeze
|
||||
|
||||
|
|
|
|||
|
|
@ -93,6 +93,20 @@ module Articles
|
|||
stories
|
||||
end
|
||||
|
||||
# Test variation: the more comments a post has, the higher it's rated!
|
||||
def more_comments_medium_weight_experiment
|
||||
@comment_weight = 0.5
|
||||
_featured_story, stories = default_home_feed_and_featured_story(user_signed_in: true)
|
||||
stories
|
||||
end
|
||||
|
||||
# Test variation: the more comments a post has, the higher it's rated!
|
||||
def more_comments_minimal_weight_experiment
|
||||
@comment_weight = 0.2
|
||||
_featured_story, stories = default_home_feed_and_featured_story(user_signed_in: true)
|
||||
stories
|
||||
end
|
||||
|
||||
def more_experience_level_weight_experiment
|
||||
@experience_level_weight = 3
|
||||
_featured_story, stories = default_home_feed_and_featured_story(user_signed_in: true)
|
||||
|
|
@ -100,7 +114,7 @@ module Articles
|
|||
end
|
||||
|
||||
def mix_of_everything_experiment
|
||||
case rand(10)
|
||||
case rand(12)
|
||||
when 0
|
||||
default_home_feed(user_signed_in: true)
|
||||
when 1
|
||||
|
|
@ -121,6 +135,10 @@ module Articles
|
|||
more_experience_level_weight_randomized_at_end_experiment
|
||||
when 9
|
||||
more_comments_randomized_at_end_experiment
|
||||
when 10
|
||||
more_comments_medium_weight_randomized_at_end_experiment
|
||||
when 11
|
||||
more_comments_minimal_weight_randomized_at_end_experiment
|
||||
else
|
||||
default_home_feed(user_signed_in: true)
|
||||
end
|
||||
|
|
@ -149,6 +167,18 @@ module Articles
|
|||
first_half(results).shuffle + last_half(results)
|
||||
end
|
||||
|
||||
def more_comments_medium_weight_randomized_at_end_experiment
|
||||
@randomness = 0
|
||||
results = more_comments_medium_weight_experiment
|
||||
first_half(results).shuffle + last_half(results)
|
||||
end
|
||||
|
||||
def more_comments_minimal_weight_randomized_at_end_experiment
|
||||
@randomness = 0
|
||||
results = more_comments_minimal_weight_experiment
|
||||
first_half(results).shuffle + last_half(results)
|
||||
end
|
||||
|
||||
def rank_and_sort_articles(articles)
|
||||
ranked_articles = articles.each_with_object({}) do |article, result|
|
||||
article_points = score_single_article(article)
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ experiments:
|
|||
- more_tag_weight_randomized_at_end_experiment
|
||||
- more_experience_level_weight_randomized_at_end_experiment
|
||||
- more_comments_randomized_at_end_experiment
|
||||
- more_comments_medium_weight_randomized_at_end_experiment
|
||||
- more_comments_minimal_weight_randomized_at_end_experiment
|
||||
weights:
|
||||
- 5
|
||||
- 5
|
||||
|
|
@ -23,7 +25,9 @@ experiments:
|
|||
- 10
|
||||
- 10
|
||||
- 5
|
||||
- 35
|
||||
- 25
|
||||
- 5
|
||||
- 5
|
||||
goals:
|
||||
- user_creates_comment
|
||||
- user_creates_reaction
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ NON_DEFAULT_EXPERIMENTS = %i[
|
|||
more_tag_weight_randomized_at_end_experiment
|
||||
more_experience_level_weight_randomized_at_end_experiment
|
||||
more_comments_randomized_at_end_experiment
|
||||
more_comments_medium_weight_randomized_at_end_experiment
|
||||
more_comments_minimal_weight_randomized_at_end_experiment
|
||||
mix_of_everything_experiment
|
||||
].freeze
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue