Skip to content

Commit

Permalink
fix: debuffed season and day scores (#141)
Browse files Browse the repository at this point in the history
* fix: debuffed season and day scores

* fix: staging teardown variable update
  • Loading branch information
rak3rman authored Jan 21, 2025
1 parent 5247158 commit 15a6211
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/staging_teardown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:
NEON_API_TOKEN: ${{ secrets.NEON_API_TOKEN }}
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
CF_ACCOUNT_ID: 287572e2291030d8c5e360fcc593a16b
GH_ENV_APP_ID: ${{ secrets.GH_ENV_APP_ID }}
GH_ENV_APP_ID: ${{ variables.GH_ENV_APP_ID }}
GH_ENV_APP_PRIVATE_KEY: ${{ secrets.GH_ENV_APP_PRIVATE_KEY }}
NEXT_PAGES_PROJECT_NAME: shafa-next
HONO_DEPLOY_TAG: shafa-hono-stage-${{ github.event.number }}
Expand Down
8 changes: 4 additions & 4 deletions hono/src/services/outfits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ app.get('/suggest', zValidator('query', suggestionsValidation), injectDB, async
// Score based on previous wear patterns for this day of week
const calculateDayOfWeekScore = (sameDayCount: number) => {
const dayOfWeekConfidence = Math.min(sameDayCount / 3, 1) // Caps at 3 same-day wears
return sameDayCount > 0 ? 15 * dayOfWeekConfidence : 0
return sameDayCount > 0 ? 10 * dayOfWeekConfidence : 0
}

const calculateScores = (outfit: (typeof outfitsWithScores)[0]) => {
Expand All @@ -366,13 +366,13 @@ app.get('/suggest', zValidator('query', suggestionsValidation), injectDB, async
// 4. Frequency Score (0-20)
const frequency_score = Math.trunc(calculateFrequencyScore(outfit.wearCount as number))

// 5. Day of Week Score (0-15)
// 5. Day of Week Score (0-10)
const day_of_week_score = Math.trunc(
calculateDayOfWeekScore(outfit.sameDayOfWeekCount as number)
)

// 6. Seasonal Score (0-15)
const seasonal_score = Math.trunc((outfit.seasonalRelevance as number) * 15)
// 6. Seasonal Score (0-8)
const seasonal_score = Math.trunc((outfit.seasonalRelevance as number) * 8)

return {
base_score,
Expand Down

0 comments on commit 15a6211

Please sign in to comment.