Skip to content

Track and persist training history per class #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 24, 2025
Merged

Track and persist training history per class #47

merged 7 commits into from
Jul 24, 2025

Conversation

codelion
Copy link
Owner

Adds a training_history dictionary to AdaptiveClassifier to track the cumulative number of training examples per class. Updates prediction logic to use training_history for weighting, ensures training_history is saved/loaded with backward compatibility, and includes tests for confidence consistency, continuous learning, backward compatibility, and new class detection. Also adds a GitHub Actions workflow for running tests and coverage.

Adds a training_history dictionary to AdaptiveClassifier to track the cumulative number of training examples per class. Updates prediction logic to use training_history for weighting, ensures training_history is saved/loaded with backward compatibility, and includes tests for confidence consistency, continuous learning, backward compatibility, and new class detection. Also adds a GitHub Actions workflow for running tests and coverage.
@codelion
Copy link
Owner Author

This will fix #44

codelion added 3 commits July 24, 2025 10:26
Ensures the FAISS index is rebuilt after new examples are added to maintain up-to-date nearest neighbor search. Test assertions for confidence thresholds are relaxed to account for lower confidence scores due to prototype normalization, improving test robustness.
Bump package version to 0.0.15 in setup.py. Add CHANGELOG.md documenting recent changes and fixes. Update GitHub Actions workflow to test only with Python 3.12 instead of a matrix of versions.
Added tests to verify that prediction confidence remains consistent before and after saving/loading AdaptiveClassifier, especially for single-example-per-class cases. Updated test_memory.py to skip memory efficiency test if psutil is unavailable. Updated GitHub Actions workflow to install psutil for testing.
codelion added 3 commits July 24, 2025 12:27
Label IDs are now assigned in alphabetical order when new classes are added, ensuring consistent mappings regardless of input order. Updated the README to document order dependency in online learning and added comprehensive tests to verify order independence and label assignment behavior.
Removed unnecessary sorting and reordering of input texts in the _get_embeddings method. The function now directly processes the input texts and returns embeddings in the original order, improving code clarity.
@codelion codelion merged commit 0ae37c5 into main Jul 24, 2025
2 checks passed
@codelion codelion deleted the fix-bugs branch July 24, 2025 06:31
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