{"id":13878191,"url":"https://github.com/ankane/vowpalwabbit-ruby","last_synced_at":"2025-11-17T14:03:05.551Z","repository":{"id":56897638,"uuid":"216663373","full_name":"ankane/vowpalwabbit-ruby","owner":"ankane","description":"Fast online machine learning for Ruby","archived":false,"fork":false,"pushed_at":"2025-04-30T22:21:30.000Z","size":48,"stargazers_count":62,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-14T03:16:50.078Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ankane.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-10-21T20:52:09.000Z","updated_at":"2025-04-30T22:21:34.000Z","dependencies_parsed_at":"2024-07-27T05:24:57.994Z","dependency_job_id":"3e986083-7908-42a1-9609-586773b6aeb2","html_url":"https://github.com/ankane/vowpalwabbit-ruby","commit_stats":{"total_commits":51,"total_committers":1,"mean_commits":51.0,"dds":0.0,"last_synced_commit":"52dfad3409df73a47e1f17dfe227aec68d20c6a1"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/ankane/vowpalwabbit-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankane%2Fvowpalwabbit-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankane%2Fvowpalwabbit-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankane%2Fvowpalwabbit-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankane%2Fvowpalwabbit-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ankane","download_url":"https://codeload.github.com/ankane/vowpalwabbit-ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankane%2Fvowpalwabbit-ruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284406242,"owners_count":26999589,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-14T02:00:06.101Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-06T08:01:42.331Z","updated_at":"2025-11-17T14:03:05.516Z","avatar_url":"https://github.com/ankane.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# Vowpal Wabbit Ruby\n\n[Vowpal Wabbit](https://vowpalwabbit.org) - fast online machine learning - for Ruby\n\n[![Build Status](https://github.com/ankane/vowpalwabbit-ruby/actions/workflows/build.yml/badge.svg)](https://github.com/ankane/vowpalwabbit-ruby/actions)\n\n## Installation\n\nFirst, install the [Vowpal Wabbit C++ library](https://vowpalwabbit.org/start.html). For Homebrew, use:\n\n```sh\nbrew install vowpal-wabbit\n```\n\nAnd for Ubuntu, use:\n\n```sh\nsudo apt install libvw0\n```\n\nThen add this line to your application’s Gemfile:\n\n```ruby\ngem \"vowpalwabbit\"\n```\n\n## Getting Started\n\nPrep your data\n\n```ruby\nx = [[1, 2], [3, 4], [5, 6], [7, 8]]\ny = [1, 2, 3, 4]\n```\n\nTrain a model\n\n```ruby\nmodel = VowpalWabbit::Regressor.new(learning_rate: 100)\nmodel.fit(x, y)\n```\n\nUse `VowpalWabbit::Classifier` for classification and `VowpalWabbit::Model` for other models\n\nMake predictions\n\n```ruby\nmodel.predict(x)\n```\n\nSave the model to a file\n\n```ruby\nmodel.save(\"model.bin\")\n```\n\nLoad the model from a file\n\n```ruby\nmodel = VowpalWabbit::Regressor.load(\"model.bin\")\n```\n\nTrain online\n\n```ruby\nmodel.partial_fit(x, y)\n```\n\nGet the intercept and coefficients\n\n```ruby\nmodel.intercept\nmodel.coefs\n```\n\nScore - R-squared for regression and accuracy for classification\n\n```ruby\nmodel.score(x, y)\n```\n\n## Parameters\n\nSpecify parameters\n\n```ruby\nmodel = VowpalWabbit::Model.new(cb: 4)\n```\n\nSupports the same parameters as the [CLI](https://github.com/VowpalWabbit/vowpal_wabbit/wiki/Command-Line-Arguments)\n\n## Data\n\nData can be an array of arrays\n\n```ruby\n[[1, 2, 3], [4, 5, 6]]\n```\n\nOr a Numo array\n\n```ruby\nNumo::NArray.cast([[1, 2, 3], [4, 5, 6]])\n```\n\nOr an array of strings\n\n```ruby\n[\n  \"0 | price:.23 sqft:.25 age:.05 2006\",\n  \"1 2 'second_house | price:.18 sqft:.15 age:.35 1976\",\n  \"0 1 0.5 'third_house | price:.53 sqft:.32 age:.87 1924\"\n]\n```\n\nOr a path to a file\n\n```ruby\nmodel.fit(\"train.txt\")\nmodel.partial_fit(\"train.txt\")\nmodel.predict(\"train.txt\")\nmodel.score(\"train.txt\")\n```\n\nFiles can be compressed\n\n```ruby\nmodel.fit(\"train.txt.gz\")\n```\n\nRead more about the [input format](https://github.com/VowpalWabbit/vowpal_wabbit/wiki/Input-format)\n\n## History\n\nView the [changelog](https://github.com/ankane/vowpalwabbit-ruby/blob/master/CHANGELOG.md)\n\n## Contributing\n\nEveryone is encouraged to help improve this project. Here are a few ways you can help:\n\n- [Report bugs](https://github.com/ankane/vowpalwabbit-ruby/issues)\n- Fix bugs and [submit pull requests](https://github.com/ankane/vowpalwabbit-ruby/pulls)\n- Write, clarify, or fix documentation\n- Suggest or add new features\n\nTo get started with development:\n\n```sh\ngit clone https://github.com/ankane/vowpalwabbit-ruby.git\ncd vowpalwabbit-ruby\nbundle install\nbundle exec rake test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fankane%2Fvowpalwabbit-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fankane%2Fvowpalwabbit-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fankane%2Fvowpalwabbit-ruby/lists"}