Skip to content

Commit

Permalink
Increase frequency of rank calculation, increase random weight in ran…
Browse files Browse the repository at this point in the history
…k, remove separate random ordering option
  • Loading branch information
julianweng committed Oct 11, 2024
1 parent 9ebd5da commit 5699d39
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
4 changes: 2 additions & 2 deletions backend/clubs/management/commands/rank.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,11 @@ def rank(self):
if num_testimonials >= 3:
ranking += 5

# random number, mostly shuffles similar clubs with average of 15 points
# random number, mostly shuffles similar clubs with average of 25 points
# but with long right tail to periodically feature less popular clubs
# given ~700 active clubs, multiplier c, expected # clubs with rand > cd
# is 257, 95, 35, 13, 5, 2, 1 for c = 1, 2, 3, 4, 5, 6, 7
ranking += np.random.standard_exponential() * 15
ranking += np.random.standard_exponential() * 25

club.rank = floor(ranking)
club.skip_history_when_saving = True
Expand Down
7 changes: 1 addition & 6 deletions frontend/components/OrderInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { Icon } from './common'
const ORDERINGS = [
{
key: 'featured',
name: 'Featured',
name: 'Default',
icon: 'star',
},
{
Expand All @@ -32,11 +32,6 @@ const ORDERINGS = [
name: 'Bookmarks',
icon: 'bookmark',
},
{
key: 'random',
name: 'Random',
icon: 'shuffle',
},
]

const OrderingWrapper = styled.div`
Expand Down
2 changes: 1 addition & 1 deletion frontend/pages/rank.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ const Rank = (): ReactElement => (
description: `A random factor is applied periodically in order to ensure that students see new ${OBJECT_NAME_PLURAL} when they visit ${SITE_NAME}.`,
points: [
[
15,
25,
'Standard exponential random number scaled to average this number, updated daily',
],
],
Expand Down
2 changes: 1 addition & 1 deletion k8s/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class MyChart extends PennLabsChart {

/** Cronjobs **/
new CronJob(this, 'rank-clubs', {
schedule: cronTime.everyDayAt(8),
schedule: cronTime.everyDayAt(6, 18),
image: backendImage,
secret: clubsSecret,
cmd: ['python', 'manage.py', 'rank'],
Expand Down

0 comments on commit 5699d39

Please sign in to comment.