Commit graph

45 commits

Author SHA1 Message Date
Ben Halpern
097057a8dc
New a/b tests for Feb 14 (#20632) 2024-02-14 15:57:41 -05:00
Ben Halpern
e26b27c7fa
New a/b test for Feb 5 (and add a variable too a hardcoded value) (#20588)
* Fix AudienceSegmentRefreshAllWorker args issue

* New a/b test for Feb 5 (and add a variable too a hardcoded value)
2024-02-05 15:46:03 +00:00
Ben Halpern
6d669c8a5c
Add new feed experiment for Jan 26 (#20563)
* Add a/b tests for Jan 26

* Fix feed lever

* Update config/field_test.yml

* Update config/field_test.yml

* Update app/models/articles/feeds.rb
2024-01-26 16:53:26 -05:00
Ben Halpern
108d753d68
Add articles clickbait_score as factor in final feed ordering (#20493)
* Add articles clickbait_score

* Add attributes

* Fix field test config
2024-01-05 09:37:53 -05:00
Ben Halpern
8a299c88a6
Feed experiment for Dec 5 (#20427) 2023-12-06 16:05:50 -05:00
Ben Halpern
6c45945b11
Add recommended articles to feed experiment (Nov 27 experiment) (#20399)
* Add recommended articles to feed experiment

* remove changes to initial copy

* Adjust query to account for null
2023-11-29 18:22:18 +00:00
Ben Halpern
da59622c29
New Feed experiment for Nov 8 (#20328) 2023-11-08 13:33:26 -05:00
Ben Halpern
549a7bd9d0
New AB test for October 23 (#20274) 2023-10-23 10:30:12 -04:00
Ben Halpern
ade6bf5f1f
Add feed test for oct 17 (#20252) 2023-10-17 11:33:49 -04:00
Ben Halpern
b67d5c4358
Add new feed experiment for 10-1 (#20194)
* Add new feed experiment for 10-1

* Fix field test config

* Adjust field test config
2023-10-01 13:52:33 +07:00
Ben Halpern
f753df3226
Add new feed experiments (#20171) 2023-09-27 08:21:21 -04:00
Ben Halpern
4f8f828a44
New feed experiments for 9/18 (#20130) 2023-09-18 14:40:09 -07:00
Ben Halpern
5c92f886ce
Add feed experiment for Aug 14 (#19937)
* New feed variant for Aug 14

* Update config/field_test.yml

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

---------

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2023-08-15 10:01:08 -04:00
Ben Halpern
f853b95ccd
Add feed experiment for 5/11 (#19458)
* Add feed experiment for 5/11

* Change number of articles
2023-05-12 12:17:25 -04:00
Ben Halpern
59d6816c47
Add feed experiment for 4/30 (#19406) 2023-05-02 07:05:12 -04:00
Ben Halpern
dda0e1d41d
Add feed experiment for 04/24 (#19388) 2023-04-25 07:49:06 -04:00
Ben Halpern
17db5988cd
Feed experiment for 01-11-2023 (#18949)
* Feed experiment for 01-11-2023

* Add winner to yml file
2023-01-11 17:03:29 -05:00
Ben Halpern
38d95857c5
Feed experiment for 12-15-2022 (#18866) 2022-12-16 10:15:01 -05:00
Ben Halpern
a3564a9d67
Feed experiment for 11-22-2022 (#18769)
* Feed experiment for 11-22-2022

* Fix typo

* Update config/field_test.yml

Co-authored-by: Fernando Valverde <fernando@fdo.cr>

Co-authored-by: Fernando Valverde <fernando@fdo.cr>
2022-11-23 14:18:26 -05:00
Ben Halpern
43c522b58a
Feed experiment for 11-07-2022 (#18702) 2022-11-08 13:06:58 -05:00
Ben Halpern
f72f6bb1c7
Feed experiment for 10-31-2022 (#18670) 2022-11-02 09:00:59 -04:00
Ben Halpern
d66dbe5e72
Feed experiment for 10-25-2022 (#18628)
* Feed experiment for 10-25-2022

* Add winner to field_test config
2022-10-25 16:16:28 -04:00
Ben Halpern
950a090c22
Feed experiment for 10-18-2022 (#18600) 2022-10-19 10:43:52 -04:00
Ben Halpern
ef63738454
Feed experiment for 10-11-2022 (#18566) 2022-10-11 08:56:49 -06:00
Ben Halpern
42efb86dca
Feed experiment for 10-04-2022 (#18533) 2022-10-05 06:41:51 -04:00
Ben Halpern
cd5c86c760
Feed experiment for 09-26-2022 (#18501)
* Feed experiment for 09-26-2022

* Fix variant

* Add proper tests
2022-09-27 08:48:15 -06:00
Ben Halpern
828d568443
Feed experiment for 09-20-2022 (#18475)
* Feed experiment for 09-20-2022

* Fix yaml indentation

* Fix typo in config
2022-09-21 12:19:38 -04:00
Josh Puetz
55c716da6e
Feed experiment for 09-15-2022 (#18463) 2022-09-16 11:27:42 -05:00
Josh Puetz
abbb4d2015
Feed experiment for 09-07-2022 (#18437) 2022-09-09 08:17:00 -05:00
Josh Puetz
9ac1d11960
Feed experiment for week of Aug 29, 2022 (#18395) 2022-08-31 09:28:27 -05:00
Josh Puetz
6bb523f480
Feed experiment for 08-23-2022 (#18371) 2022-08-26 10:30:01 -05:00
Joshua Wehner
cf11b020e5
Feed experiment for 2022-08-01 (#18269)
Co-authored-by: Josh Puetz <hi@joshpuetz.com>
2022-08-04 11:06:58 -04:00
Josh Puetz
76bb397137
Feed experiment for 2022-07-26 (#18227) 2022-07-27 08:19:32 -05:00
Jeremy Friesen
510d85dc74
Adding 2022-07-19 variant (#18156)
Diff between `20220617-variant-a` and `20220719-variant-a` (e.g. the new
incumbent with minor tweaks):

```
3c3
<   "description": "Blend of 20220603-variant-b and 20220603-variant-a",
---
>   "description": "Copy of 20220617-variant-a with tweak to negative privileged user",
84,85c84,85
<       "negative_reaction_threshold": -10,
<       "positive_reaction_threshold": 10
---
>       "negative_reaction_threshold": -9,
>       "positive_reaction_threshold": 4
```

**Note**: In the above I'm adjusting the `negative_reaction_threshold`
and `positive_reaction_threshold` to reflect the value of the privileged
user reaction points:

```ruby
class Reaction < ApplicationRecord
  BASE_POINTS = {
    "vomit" => -50.0,
    "thumbsup" => 5.0,
    "thumbsdown" => -10.0
  }.freeze
```

See the [current state of app/models/reaction.rb](817db3e6f8/app/models/reaction.rb (L1-L6))

Further, the thresholds are exclusive (e.g. `<` or `>` not `<=` or `>=`).

Diff between `20220719-variant-a` (e.g. the new incumbent) and
`20220719-variant-b` (e.g. the challenger)

```
3c3
<   "description": "Copy of 20220617-variant-a with tweak to negative privileged user",
---
>   "description": "Copy of 20220619-variant-a with tweak to comments range",
37,46c37,54
<         [0, 0.8],
<         [1, 0.82],
<         [2, 0.84],
<         [3, 0.86],
<         [4, 0.88],
<         [5, 0.9],
<         [6, 0.92],
<         [7, 0.94],
<         [8, 0.96],
<         [9, 0.98]
---
>         [0, 0.5],
>         [1, 0.6],
>         [2, 0.66],
>         [3, 0.7],
>         [4, 0.75],
>         [5, 0.8],
>         [6, 0.85],
>         [7, 0.88],
>         [8, 0.9],
>         [9, 0.92],
>         [12, 1.0],
>         [18, 1.0],
>         [22, 1.0],
>         [25, 1.0],
>         [30, 1.0],
>         [35, 1.0],
>         [40, 1.0],
>         [45, 1.0]
48c56
<       "fallback": 1
---
>       "fallback": 0.98
```

Closes forem/forem#18155
Related to forem/forem-internal-eng#453
2022-07-19 14:59:53 -04:00
Jeremy Friesen
8fa5c31cb8
Starting 2022-07-12 Experiment (#18083)
This involves declaring the 20220603-variant-a the winner of the past
experiment; note in the past experiment there was not a statistically
significant winner.

This new experiment adds a variant that deviates from the new
incumbentby way of reintroducing the follows an author and adjusting the
tag follow weights.

Closes forem/forem#18082

```shell
$ diff config/feed-variants/20220617-variant-a.json \
  config/feed-variants/20220712-variant.json
```

Results in:

```shell
3c3
<   "description": "Blend of 20220603-variant-b and 20220603-variant-a",
---
>   "description": "Builds from 20220617-variant-a (see https://github.com/forem/forem/issues/18082)",
50a51,57
>     "following_author": {
>       "cases": [
>         [0, 0.8],
>         [1, 1]
>       ],
>       "fallback": 0.8
>     },
70,73c77,80
<         [0, 0.5],
<         [1, 0.85],
<         [2, 0.9],
<         [3, 0.95],
---
>         [0, 0.3],
>         [1, 0.9],
>         [2, 0.95],
>         [3, 0.98],
```
2022-07-12 14:51:47 -04:00
Jeremy Friesen
8b7d724012
Adding 2022-06-17 feed variant (#17950)
Dependent on forem/forem#17942
Closes forem/forem#17949
2022-06-16 15:32:38 -04:00
Jeremy Friesen
7a4dd3286d
Adding VariantQuery reseed randomization option (#17942)
Prior to this change, we setup our feed variant query to have a cached
randomization seed.  For a given user this seed is cached for 15
minutes.  The goal of this is to provide mostly consistent sort orders
on the feed articles during that 15 minute window.

With this change, we allow for a feed variant to say ignore the cached
seed and generate a new one for this call.

I have also added explicit settings to each of the feed variants to
reflect our desired intentions for those features.

Relates to

- forem/forem#17833
- forem/forem#17826

Closes forem/forem#17940
2022-06-16 15:04:08 -04:00
Jeremy Friesen
3118f27197
Adding feed experiment for 2022-06-03 (#17824)
This commit contains two separate but related changes:

1. A check-list for creating a new experiment.
2. A new experiment along with declaring a winner for the previous experiment.

Below are the diffs of the two new variants versus the incumbent for the
experiment:

```
❯ diff config/feed-variants/20220603-variant-b.json config/feed-variants/20220518-variant.json
3,4c3
<   "description": "As 202205518-variant but with modificiation to `order_by` lever.",
<   "order_by": "final_order_by_random_weighted_to_score",
---
>   "order_by": "relevancy_score_and_publication_date",
```

```
❯ diff config/feed-variants/20220603-variant-a.json config/feed-variants/20220518-variant.json
3d2
<   "description": "As 202205518-variant but with modificiation to `matching_positive_tags_intersection_count`.",
69c68
<         [0, 0.5],
---
>         [0, 0.7],
```

Closes forem/forem#17822
2022-06-03 13:45:10 -04:00
Mac Siri
b10343b53f
Implement feed variant 20220525 (#17778) 2022-05-27 08:12:58 -04:00
Dwight Scott
f19fa13215
new feed variant 20220518 (#17722)
* new feed variant 20220518

* source code in favor of the spreadsheet

* remove following_org and follow_author in favor of query performance
2022-05-18 18:09:05 -04:00
Jeremy Friesen
27b82996ce
Adding new relevancy lever for privileged reactions (#17598)
* Adding new relevancy lever for privileged reactions

This PR includes four changes:

1. Renaming the variant to remove Jennie's name
2. Starting a new experiment
3. Adding a new relevancy lever
4. Adding a new variant that uses the relevancy lever

1 and 2 is somewhat straight-forward.

For 3, we're looking at having a total of 5 "slots" for privileged user
reactions.  Hence the four boundary values.

For 4, we're configuring the granular levers with the following:

- `[-∞..-5)` should have a 0.05
- `[-5..0)` should have a 0.5
- `[0..5)` should have a 0.9
- `[5..10)` should have a 0.98
- `[10..∞)` should have a 1.0

The 20220509-variant.json is a copy of 20220422-variant.json but
replaces the `privileged_user_reaction` lever with the
`privileged_user_reaction_granular` lever.

Below is the diff to highlight the similarities and differences between
the two variants.

```shell
❯ diff config/feed-variants/20220509-variant.json config/feed-variants/20220422-variant.json
90c90
<     "privileged_user_reaction_granular": {
---
>     "privileged_user_reaction": {
92,96c92,93
<         [-2, 0.05],
<         [-1, 0.5],
<         [0, 0.9],
<         [1, 0.98],
<         [2, 1]
---
>         [-1, 0.2],
>         [1, 1]
98,102c95,97
<       "fallback": 0.9,
<       "very_negative_reaction_threshold": -5,
<       "negative_reaction_threshold": 0,
<       "positive_reaction_threshold": 5,
<       "very_positive_reaction_threshold": 10
---
>       "fallback": 0.95,
>       "negative_reaction_threshold": -10,
>       "positive_reaction_threshold": 10
```

Closes forem/forem#17584

* Update app/models/articles/feeds.rb

Co-authored-by: Josh Puetz <josh@dev.to>

* Adjusting testing logic to reflect latest experiment

* Adjusting negative threshold

Co-authored-by: Josh Puetz <josh@dev.to>
2022-05-09 11:32:57 -04:00
Jeremy Friesen
38ee9ef309
Refactoring so relevancy levers define expected variables (#17591)
Prior to this commit, the SQL fragments included variables that were set
configured at a global level.

With this commit, we're now saying that each lever "knows" what variable
it needs; and providing the means at lever declaration time to "say"
what those variable names are.  (e.g. `Articles::Feeds::LEVER_CATALOG`).

Then as part of the variant configuration (in the
`./config/feed-variants/*.json` files) we now include the expected value
of those parameters; which by convention (and coercion) are integers.

This relates to forem/forem#17584 because we want to move from a
privileged user reaction that has two values (`negative` and `positive`)
into four values (`very_negative`, `negative`, `positive`, and
`very_positive`).  To do that, we'll create a new lever; but that's for
another pull request.
2022-05-06 13:54:33 -04:00
Mac Siri
8d45c7377c
Create new feed-variant 20220422 (#17406) 2022-04-25 09:55:33 -04:00
Jeremy Friesen
0d0464be2f
Allowing VariantQuery for Feed Generation (#17382)
* Allowing VariantQuery for Feed Generation

Apologies for the breadth of this pull request, I had considered many
small commits, but felt that would've been more effort for the value
provided.

This commit includes the following:

- Documentation updates to the feed variant (though not the final pass)
- Renaming and adding RelevancyLevers that help differentiate
- Adding RelevancyLever#range to provide documentation
- Reducing redundent controller logic by making a
  `Articles::Feeds.feed_for` method.
- Adding some configuration validation for RelevancyLevers
- Adding constants for better clarification
- Testing unhappy paths for feed configuration
- Adjusting the module namespace of some objects
- Exposing top-level configurations for variants (along with their
  defaults)
- Creating the VariantyQuery that at present inherits from the
  `Articles::Feeds::WeightedQueryStrategy`

As implemented, we can deploy this code to production without using the
new VariantQuery.  Once we toggle on the
`:feed_uses_variant_query_feature` FeatureFlag, it will switch to using
the VariantQuery.  The VariantQuery's two variants and the
internal configuration of `Articles::Feeds::WeightedQueryStrategy`
produce the same query.

The goal of this factor is to allow for a quick on and off toggle of the
feed query; to ensure that what we introduce remains performant.

- Closes forem/forem#17272
- Closes forem/forem#17276
- Closes forem/forem#17216

In addition, I will be recording a code-walkthrough and linking that
recording to the pull request.

* Apply suggestions from code review

Co-authored-by: Mac Siri <krairit.siri@gmail.com>

Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2022-04-21 11:07:09 -04:00
Jeremy Friesen
034ec6e3fe
Introducing the Articles::Feeds configurations (#17314)
**tl;dr** This PR is looking to provide a means to programmatically
assemble, from system configurations, what is currently the
[Articles::Feeds::WeightedQueryStrategy::SCORING_METHOD_CONFIGURATIONS][1].
Once we merge this PR, instead of having that constant, we'll initialize
the Articles::Feeds::WeightedQueryStrategy with the variant
configuration that we've assembled.

**Introduction**

This pull request has quite a bit going on, but as of now the production
code does not use any of it.

*Note: None of this code is bleeding into production code paths.*

Put your Ruby hat on and let's go for a ride.  And apologizes for not
making this a smaller pull request.  As I built this, I made many small
commits, but this became the smallest commit that provided the most
context without integrating into production code.

Before we get started, you may want to familiarize yourself with where
we're going.  The `./app/models/articles/feeds/README.md` provides
further guidance; but fair warning reader, I have not reconciled the
README's language with what emerged as I wrote this pull request.

Those of you who are part of Forem Core team, you can read the
[Refinements to Our Present Feed Configuration][2]
to provide some insight into what's happening.

**Why not reconcile?** *Because I want to have all of the language and
thoughts available for you to help consider how best to name and model
this.*

**On to the Review**

The purpose of this pull request is to provide a mechanism for
engineering to provide a series of variant query levers.  And to allow
us to easily configure those available query levers into a variant
query.

*Why the mix of Ruby configuration and JSON?*

The Ruby levers are meant to indicate that this is code we don't want to
expose in text based configuration because it might create SQL inject
points.  (More on that when we integrate the code of this PR into the
production implementation)

The JSON levers are meant to indicate that "anyone" can pick the
appropriate/available levers and configure how they are set.  In other
words, these values do not create SQL injection issues.

**What I Need from You**

I am putting this forward as a draft so you can read this code ahead of
time.  I'm then going to schedule a synchronous code review where we
record our collective walk through of the implementation.

Closes:

- forem/forem#17268
- forem/forem#17269
- forem/forem#17270
- forem/forem#17271
- forem/forem#17273

Relates to:

- forem/forem#17308
- forem/forem#17245

[1]:6818ef3ed0/app/services/articles/feeds/weighted_query_strategy.rb (L84-L231)
[2]:https://forem.team/jeremy/refinements-to-our-present-feed-configuration-1p0c
2022-04-19 16:51:18 -04:00