Skip to content

fix(core): update HITS classification to use 75th percentile#50

Draft
saurabhsharma2u wants to merge 1 commit intomainfrom
fix/hits-75th-percentile-9057382431427311962
Draft

fix(core): update HITS classification to use 75th percentile#50
saurabhsharma2u wants to merge 1 commit intomainfrom
fix/hits-75th-percentile-9057382431427311962

Conversation

@saurabhsharma2u
Copy link
Contributor

This PR updates the HITS algorithm in @crawlith/core to use the 75th percentile (instead of the median) when classifying nodes as "High" Authority or Hub. This aligns the implementation with the intended logic described in code comments.

Changes:

  • Modified plugins/core/src/scoring/hits.ts to calculate highAuth and highHub using the 75th percentile.
  • Exported classifyLinkRoles for easier testing.
  • Updated plugins/core/tests/hits.test.ts to use a robust Reciprocal Star Topology for verifying "Power" node classification, which is more stable than ad-hoc graphs.
  • Added plugins/core/tests/hits_classification.test.ts to unit test the classification logic specifically.

Tests:

  • Verified with pnpm --filter @crawlith/core test tests/hits.test.ts and tests/hits_classification.test.ts.
  • Verified no regressions in tests/metrics.test.ts and tests/pagerank.test.ts.

PR created automatically by Jules for task 9057382431427311962 started by @saurabhsharma2u

Updates the HITS `classifyLinkRoles` function to use the 75th percentile as the threshold for "High" Authority/Hub scores, aligning with the architectural intent and code comments.
Refactors `classifyLinkRoles` to be exported for direct testing.
Updates `hits.test.ts` with a robust reciprocal star topology test case to guarantee Power node classification.
Adds `hits_classification.test.ts` for granular unit testing of the classification logic.
@google-labs-jules
Copy link

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant