fix(core): enforce 75th percentile threshold for HITS scoring#61
fix(core): enforce 75th percentile threshold for HITS scoring#61saurabhsharma2u wants to merge 1 commit into
Conversation
- Replaces median-based classification with 75th percentile for 'Authority' and 'Hub' roles - Adds new `hits_precision.test.ts` to verify distribution (~25% high-tier nodes) - Updates `hits.test.ts` to use a slightly larger graph for stable classification - Improves comments in `hits.ts` to match implementation logic This aligns the HITS algorithm with the intended "high-tier" definition, reducing noise in large graphs where median classification was too broad.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR improves the precision of the HITS (Hyperlink-Induced Topic Search) algorithm in
@crawlith/core. Previously, the implementation used a median (50th percentile) threshold to classify nodes as "Authority" or "Hub", which resulted in too many nodes being labeled as high-importance (~50-80%).This change updates the logic to use a strict 75th percentile threshold, targeting the top ~25% of nodes, which better aligns with the concept of "elite" or "high-value" pages in a link graph.
Changes
classifyLinkRolesinplugins/core/src/scoring/hits.tsto uselength * 0.75index.plugins/core/tests/hits_precision.test.tsto verify the statistical distribution of scores.plugins/core/tests/hits.test.tsto use a 20-node graph instead of 11, ensuring the percentile logic has enough data points to function correctly.Verification
pnpm --filter @crawlith/core testpasses.PR created automatically by Jules for task 18227245879883390687 started by @saurabhsharma2u