-
Notifications
You must be signed in to change notification settings - Fork 126
Comparing changes
Open a pull request
base repository: cardmagic/classifier
base: v2.2.0
head repository: cardmagic/classifier
compare: v2.3.0
- 5 commits
- 20 files changed
- 3 contributors
Commits on Dec 29, 2025
-
docs: fix README examples and broken links (#113)
* docs: fix README examples and broken links Update Quick Start examples for all 5 classifiers to produce accurate outputs that match the documented comments. The previous examples used minimal training data that resulted in incorrect classifications. Also fix API Reference link to point to rubydoc.info and correct 3 broken documentation links that were returning 404 errors. * docs: update README examples to use keyword argument syntax Update training examples to use the modern hash-based API (e.g., `train(spam: "text")`) instead of positional arguments. Also demonstrates array syntax for batch training multiple items in a single call.
Configuration menu - View commit details
-
Copy full SHA for 254486b - Browse repository at this point
Copy the full SHA 254486bView commit details
Commits on Dec 30, 2025
-
ci: add Dependabot for automated dependency updates (#115)
* ci: add Dependabot for automated dependency updates Configure Dependabot to check bundler dependencies weekly, keeping Ruby gem dependencies up to date automatically. * Update .github/dependabot.yml Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for ec8094b - Browse repository at this point
Copy the full SHA ec8094bView commit details -
chore(deps): bump matrix from 0.4.2 to 0.4.3 (#117)
Bumps [matrix](https://github.com/ruby/matrix) from 0.4.2 to 0.4.3. - [Release notes](https://github.com/ruby/matrix/releases) - [Changelog](https://github.com/ruby/matrix/blob/master/CHANGELOG.md) - [Commits](ruby/matrix@v0.4.2...v0.4.3) --- updated-dependencies: - dependency-name: matrix dependency-version: 0.4.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 17bfc1e - Browse repository at this point
Copy the full SHA 17bfc1eView commit details -
chore(deps-dev): bump rdoc from 6.5.1.1 to 7.0.3 (#116)
Bumps [rdoc](https://github.com/ruby/rdoc) from 6.5.1.1 to 7.0.3. - [Release notes](https://github.com/ruby/rdoc/releases) - [Changelog](https://github.com/ruby/rdoc/blob/master/History.rdoc) - [Commits](ruby/rdoc@v6.5.1.1...v7.0.3) --- updated-dependencies: - dependency-name: rdoc dependency-version: 7.0.3 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 3cb257a - Browse repository at this point
Copy the full SHA 3cb257aView commit details
Commits on Dec 31, 2025
-
Add CLI executable with model registry support (#127)
* feat: add CLI executable for training and classification Implements issue #119 with a full-featured command-line interface: - Default action is classification (no subcommand needed) - Supports Bayes, LSI, KNN, and Logistic Regression models - Commands: train, info, fit (LR only), search (LSI), related (LSI) - Flags: -f (file), -m (model type), -p (probabilities), -k (KNN neighbors) - Reads from stdin when no text argument provided - Sensible defaults: ./classifier.json, bayes model type Also: - Add Classifier::VERSION as single source of truth - LR now requires explicit fit() before classification - Add add_category() method to LR for dynamic category creation Closes #119 * feat(cli): show getting started guide when no model exists Instead of showing "Error: model not found" when running `classifier` with no arguments and no model file, show a friendly getting started guide with examples for training, classifying, and LSI semantic search. * feat(cli): show model usage when no input provided When a model exists but classifier is run without any text to classify, show the model info and usage hints instead of silently exiting. * feat(cli): output JSON from info command for jq filtering The info command now outputs pretty-printed JSON with detailed stats: - file: model path - type: classifier type - categories: list of categories - category_stats: per-category word counts (Bayes) - documents: document count (LSI, KNN) - items: list of items (LSI) - fitted: fit status (LR) * feat(cli): improve getting started examples for copy-paste - LSI examples now use stdin training like Bayes examples - Use separate lsi.json file to avoid conflicts - All examples can be copy-pasted and run immediately * feat(cli): show defaults for all numeric options in help - Add defaults for --learning-rate (0.1), --regularization (0.01), --max-iterations (100) - Remove -f lsi.json from LSI examples for simpler copy-paste * fix: resolve RuboCop and Steep CI failures - Refactor build_model_info into smaller methods to reduce complexity - Fix Minitest assertion style (refute/assert vs assert_equal) - Add JSON.pretty_generate to vendor RBS * fix: resolve remaining CI lint and typecheck failures - Fix file permissions on generated RBS files (644 instead of 600) - Refactor restore_state to reduce ABC complexity - Regenerate RBS files for logistic_regression * fix: add VERSION constant to manual RBS file for Steep * refactor(cli): address PR review feedback - Refactor nested conditionals to use guard clauses in command_train - Refactor nested conditionals to use guard clauses in command_classify - Remove redundant comments that restate what code already shows * feat(cli): add model registry for pre-trained models Enable downloading and using pre-trained models from GitHub repositories similar to Homebrew taps. This makes it easy to share and reuse classifier models without training from scratch. New commands: - `models` - list available models in a registry - `pull` - download models to local cache - `push` - show instructions for contributing models New options: - `-r/--remote MODEL` - classify using a remote model directly - `-o/--output FILE` - specify download location for pull Features: - Default registry: cardmagic/classifier-models - Custom registries: @user/repo:model syntax - Local caching in ~/.classifier/models/ - Automatic fallback from main to master branch - Environment variables for configuration Closes #119 * fix: add stdlib dependencies for CLI type checking Steep was failing because the CLI uses stdlib classes (FileUtils, URI, Net::HTTP, JSON::ParserError) that weren't declared in the Steepfile. Also fixes nil safety issue with spec[1..] which returns String? in Ruby's type system - now uses fallback to empty string. * feat(cli): add --local flag to list cached models The 'models' command now supports --local to list models that have been downloaded to the local cache (~/.classifier/models/) instead of fetching the registry index from GitHub. Shows model name, type, and human-readable file size. Custom registry models display with their full @user/repo:name format. * style: fix RuboCop offenses in CLI code Use idiomatic Ruby patterns to satisfy linter: - Replace each+append with map for building arrays - Use annotated format tokens (%<name>s) over positional ones - Use %r{} for regex containing slashes * chore: bump version to 2.3.0 * chore: update Gemfile.lock for 2.3.0
Configuration menu - View commit details
-
Copy full SHA for 4972dc3 - Browse repository at this point
Copy the full SHA 4972dc3View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine: git diff v2.2.0...v2.3.0