Skip to content

chore(ml): update to the latest version of the reading level model#2365

Merged
jo-elimu merged 2 commits intomainfrom
1920-reading-level-model
Apr 5, 2026
Merged

chore(ml): update to the latest version of the reading level model#2365
jo-elimu merged 2 commits intomainfrom
1920-reading-level-model

Conversation

@jo-elimu
Copy link
Copy Markdown
Member

@jo-elimu jo-elimu commented Apr 5, 2026

#1920

Issue Number

  • Resolves #

Purpose

Technical Details

Testing Instructions

Screenshots


Format Checks

Note

Files in PRs are automatically checked for format violations with mvn spotless:check.

If this PR contains files with format violations, run mvn spotless:apply to fix them.

@jo-elimu jo-elimu self-assigned this Apr 5, 2026
@jo-elimu jo-elimu requested a review from a team as a code owner April 5, 2026 15:16
@jo-elimu jo-elimu requested review from jpatel3, shiv810 and vrudas and removed request for a team April 5, 2026 15:16
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 27b1e193-7a45-4662-8e87-ed05fe842d06

📥 Commits

Reviewing files that changed from the base of the PR and between db5a02e and 885dcce.

📒 Files selected for processing (1)
  • src/test/java/ai/elimu/util/ml/ReadingLevelUtilTest.java
✅ Files skipped from review due to trivial changes (1)
  • src/test/java/ai/elimu/util/ml/ReadingLevelUtilTest.java

Walkthrough

Dependency artifact version bumped for the webapp module; PMML decision-tree model metadata and topology were updated (SkLearn2PMML version and timestamps, thresholds and branches changed); unit tests simplified to inline arguments and removed intermediate variables/assertion messages.

Changes

Cohort / File(s) Summary
Dependency Management
pom-dependency-tree.txt
Webapp module artifact version bumped from ai.elimu:webapp:war:2.6.150-SNAPSHOT to ai.elimu:webapp:war:2.6.151-SNAPSHOT.
ML Model
src/main/resources/ai/elimu/util/ml/step2_2_model.pmml
PMML model header updated (SkLearn2PMML 0.110.00.126.0, timestamp), and decision-tree topology changed: split thresholds and predicates for word_count, chapter_count, and paragraph_count were modified, branches restructured, and leaf regression scores rearranged.
Tests
src/test/java/ai/elimu/util/ml/ReadingLevelUtilTest.java
Tests refactored to use inline numeric arguments in predictReadingLevel(...), removed intermediate local variables and assertion message strings, and added class-level Javadoc.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description follows the template structure but lacks critical content: Purpose, Technical Details, Testing Instructions, and Screenshots sections are all empty, and the Issue Number field is incomplete. Complete the Issue Number field (replace '# Resolves #' with 'Resolves #1920'), and fill in Purpose, Technical Details, and Testing Instructions sections with relevant information about the model update.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: updating the reading level model to a newer version, which aligns with the model file update and version bump changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 1920-reading-level-model

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/main/resources/ai/elimu/util/ml/step2_2_model.pmml`:
- Around line 31-102: The tests in ReadingLevelUtilTest.java (methods
testPredictReadingLevel_Level1, testPredictReadingLevel_Level2,
testPredictReadingLevel_Level3, testPredictReadingLevel_Level4) are asserting
expected levels that no longer match the updated PMML decision tree in
step2_2_model.pmml; update the test inputs or expected assertions so they
reflect the model's actual outputs (e.g., trace the decision nodes using
double(word_count), double(paragraph_count), double(chapter_count) thresholds in
the PMML to determine the correct level for each test case) — modify the input
values passed to ReadingLevelUtil.predictReadingLevel (or change the expected
LEVEL constants) in those test methods so the assertions match the model's
current decisions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: f38a44fc-ba9d-439d-a8f4-12b73f2601b2

📥 Commits

Reviewing files that changed from the base of the PR and between 5304ba4 and db5a02e.

📒 Files selected for processing (2)
  • pom-dependency-tree.txt
  • src/main/resources/ai/elimu/util/ml/step2_2_model.pmml

Co-Authored-By: Aryant Tripathi <60316716+Aryant-Tripathi@users.noreply.github.com>

#1825
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 16.78%. Comparing base (8737885) to head (885dcce).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #2365   +/-   ##
=========================================
  Coverage     16.78%   16.78%           
  Complexity      464      464           
=========================================
  Files           264      264           
  Lines          7846     7846           
  Branches        899      899           
=========================================
  Hits           1317     1317           
  Misses         6455     6455           
  Partials         74       74           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jo-elimu jo-elimu requested a review from Aryant-Tripathi April 5, 2026 18:08
@jo-elimu jo-elimu merged commit 7ba2d9d into main Apr 5, 2026
18 of 20 checks passed
@jo-elimu jo-elimu deleted the 1920-reading-level-model branch April 5, 2026 18:15
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