These changes primarily focus on enhancing the Latent Semantic Indexing (LSI) classification capabilities. The main modifications include:
Adding a new classify_with_confidence method to the LSI class.
Introducing a vote method to calculate category votes.
Updating the README to showcase the new functionality.
Adding corresponding unit tests for the new features.
Reason for Changes
The changes aim to provide more detailed classification results by including a confidence score alongside the category prediction. This allows users to make more informed decisions based on the classifier's certainty.
Detailed Description
New classify_with_confidence Method - This method extends the existing classify functionality by returning both the predicted category and a confidence score. This enables users to set custom thresholds for accepting or rejecting classifications based on the confidence level.
Introduction of vote Method - The vote method has been extracted from the classify method to calculate category votes. This refactoring improves code reusability and allows both classify and classify_with_confidence to use the same voting logic.
README Update - The README has been updated to include an example of using the new classify_with_confidence method, helping users understand and adopt the new feature.
New Unit Tests - Comprehensive unit tests have been added to ensure the correct functionality of the new classify_with_confidence method across various scenarios.
Changes Overview
These changes primarily focus on enhancing the Latent Semantic Indexing (LSI) classification capabilities. The main modifications include:
classify_with_confidence
method to the LSI class.vote
method to calculate category votes.Reason for Changes
The changes aim to provide more detailed classification results by including a confidence score alongside the category prediction. This allows users to make more informed decisions based on the classifier's certainty.
Detailed Description
New
classify_with_confidence
Method - This method extends the existingclassify
functionality by returning both the predicted category and a confidence score. This enables users to set custom thresholds for accepting or rejecting classifications based on the confidence level.Introduction of
vote
Method - Thevote
method has been extracted from theclassify
method to calculate category votes. This refactoring improves code reusability and allows bothclassify
andclassify_with_confidence
to use the same voting logic.README Update - The README has been updated to include an example of using the new
classify_with_confidence
method, helping users understand and adopt the new feature.New Unit Tests - Comprehensive unit tests have been added to ensure the correct functionality of the new
classify_with_confidence
method across various scenarios.