{"id":20106147,"url":"https://github.com/himkt/rblearn","last_synced_at":"2025-08-03T11:32:28.078Z","repository":{"id":27816841,"uuid":"31306399","full_name":"himkt/rblearn","owner":"himkt","description":"library for nlp with ruby","archived":false,"fork":false,"pushed_at":"2016-08-03T11:34:53.000Z","size":31,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-23T16:51:37.338Z","etag":null,"topics":["nlp","rubyml"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/rblearn","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/himkt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-25T09:33:05.000Z","updated_at":"2020-08-05T22:24:12.000Z","dependencies_parsed_at":"2022-07-24T15:17:13.527Z","dependency_job_id":null,"html_url":"https://github.com/himkt/rblearn","commit_stats":null,"previous_names":["himkt/r_nlp"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himkt%2Frblearn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himkt%2Frblearn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himkt%2Frblearn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himkt%2Frblearn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/himkt","download_url":"https://codeload.github.com/himkt/rblearn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228540832,"owners_count":17934030,"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","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":["nlp","rubyml"],"created_at":"2024-11-13T17:49:13.644Z","updated_at":"2024-12-07T00:09:25.927Z","avatar_url":"https://github.com/himkt.png","language":"Ruby","readme":"# Rblearn\n\n[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)\n[![Website](https://img.shields.io/website-up-down-green-red/http/shields.io.svg?maxAge=2592000)](https://rubygems.org/gems/rblearn)\n[![GitHub issues](https://img.shields.io/github/issues/himkt/rblearn.svg)](https://github.com/himkt/rblearn/issues)\n[![GitHub stars](https://img.shields.io/github/stars/himkt/rblearn.svg)](https://github.com/himkt/rblearn/stargazers) \n[![GitHub release](https://img.shields.io/github/release/qubyte/rubidium.svg?maxAge=2592000)](https://github.com/himkt/rblearn) \n[![GitHub commits](https://img.shields.io/github/commits-since/SubtitleEdit/subtitleedit/3.4.7.svg?maxAge=2592000)](https://github.com/himkt/rblearn)\n\nruby-learn is a library for machine learning.\n\nNow, we support cross-validation and feature extraction.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'rblearn'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install rblearn\n\n## Usage\n\n### Cross Validation\n\nCrossValidation provides two features for cross-validation and train_test_split.\n\n1. train_test_split\n\n  This method splits your dataset into train\\_set and test\\_set.\n\n  ```ruby\n  x\\_train, y\\_train, x\\_test, y\\_test = Rblearn::CrossValidation.train_test_split(x, y, 0.7).map(\u0026:dup)\n  ```\n\n2. K-Fold\n\n  This method is for k-fold cross-validation.\n\n  three parameters are required.\n\n  1. n :: integer\n\n    n indicates the size of dataset.\n\n  2. n_folds :: integer\n\n    we specify the k by n_folds.\n\n  3. shuffle :: boolean\n\n    if shuffle is true, dataset are shuffled.\n\n  ```ruby\n  kf = Rblearn::CrossValidation::KFold.new(100, 10, true)\n  kf.create #=\u003e list\u003clist\u003ctrain_set_indices, test_set_indices\u003e\u003e\n  ```\n\n### Count Vectorizer\n\nCountVectorizer is the feature extractor from texts.\n\nConstructor needs three parameters.\n\n1. tokenizer :: function\n\n2. lowercase :: boolean\n\n3. max_features :: integer\n\n\nfor example, \n\n```ruby\ncv = Rblearn::CountVectorizer.new(lambda{|feature| feature.split.map(\u0026:stem)}, 1, 0.7)\ncv.fit_transform(features)\n```\n\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/rblearn. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n","funding_links":[],"categories":["Machine Learning Libraries"],"sub_categories":["Text-to-Speech-to-Text","Frameworks"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhimkt%2Frblearn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhimkt%2Frblearn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhimkt%2Frblearn/lists"}