Omoikane (思金) is a Shinto god of wisdom and intelligence, who is always called upon to “ponder” and give good counsel in deliberations of the heavenly deities. (from the Shin Megami Tensei wiki)
Omoikane is also a library for Machine Learning in Ruby based on NMatrix and other SciRuby’s gems. It is intended for real-life usage in data mining and research.
You need to get NMatrix installed before installing Omoikane. On OSX, you’ll need to make some symlinks. The process is a bit more involved on Linux, but the instructions on NMatrix’s wiki should be enough.
After making sure you’re able to install NMatrix:
$ [sudo] gem install omoikane
To use k-means clustering:
``` require ‘omoikane’
dataset = NMatrix.load_matlab_file(“my_data.mat”) # Or use CSV.
Find 3 (k = 3) clusters via the k-means clustering algorithm with random initial clusters.
c = Omoikane::Clustering::KMeans.new(dataset, 3, :initial => :random) c.train! p c.clusters ```
- Fork it ( https://github.com/[my-github-username]/omoikane/fork )
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create a new Pull Request