Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: cardmagic/classifier
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.2.0
Choose a base ref
...
head repository: cardmagic/classifier
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.3.0
Choose a head ref
  • 5 commits
  • 20 files changed
  • 3 contributors

Commits on Dec 29, 2025

  1. 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.
    cardmagic authored Dec 29, 2025
    Configuration menu
    Copy the full SHA
    254486b View commit details
    Browse the repository at this point in the history

Commits on Dec 30, 2025

  1. 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>
    cardmagic and greptile-apps[bot] authored Dec 30, 2025
    Configuration menu
    Copy the full SHA
    ec8094b View commit details
    Browse the repository at this point in the history
  2. 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>
    dependabot[bot] authored Dec 30, 2025
    Configuration menu
    Copy the full SHA
    17bfc1e View commit details
    Browse the repository at this point in the history
  3. 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>
    dependabot[bot] authored Dec 30, 2025
    Configuration menu
    Copy the full SHA
    3cb257a View commit details
    Browse the repository at this point in the history

Commits on Dec 31, 2025

  1. 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
    cardmagic authored Dec 31, 2025
    Configuration menu
    Copy the full SHA
    4972dc3 View commit details
    Browse the repository at this point in the history
Loading