acts_as_clusterable
This plugin makes it very easy to cluster active record objects. It uses the clusterer Ruby gem.
Download and install the gem, and its dependencies. Copy the plugin into vendor/plugins from the following svn repository
http://opensvn.csie.org/acts_as_clusterable/
Add the following lines to your model:
acts_as_clusterable :fields => ['title','text']
If no fields are given then it will use all text and string fields present in the model.
Now, doing clustering is as easy as:
Joke.hierarchical_clustering()
Joke.kmeans_clustering()
By default the number of clusters is Math.sqrt(no. of objects). To get custom no. of clusters give the method the no. of clusters as an argument, i.e.,
Joke.hierarchical_clustering(2)
Joke.kmeans_clustering(2)
For better results use hierarchical clustering, for faster results use kmeans.
Update: New release Clusterer + other plugins
23 Comments:
Hi,
This plugin implements clustering as explained in this wikipedia article:
http://en.wikipedia.org/wiki/Data_clustering
it works for text data. A scenario where it can help is say, your website collects news from different sources, then you can cluster the news and present the cluster to users, the user can then decide which cluster he is interested in.
Also, it can help in organizing search results, forming hierarchies, etc.
Nice work.
Can you give us some pointers on how to use this in the view? I get nice arrays of arrays on my data, but I'm not sure how to loop over them or put them to good effect. Thanks!
Very nice plugin!
Question.. Would this still be able to cluster a model class based on information in a different class? Ex: post has many tags, and I would like to cluster posts by tags. Tags are unique and separate objects like in acts_as_taggable implementation.
Or does it have to be a field in the model's sql table?
Hello,
Kevin, I am not good at designing. Each internal array is a cluster of records. You can look at http://demo.carrot-search.com/carrot2-webapp/main to see one example of how it can be used.
Ilya, yes you can use it to cluster a model class based on information in a different class. It uses "instance.send(field)" to get the text, and so there should not be any issue.
Looks nice!
Quick question: Instead of specifying the number of clusters could you specify some "tolerance" value or something like that. This value you make all the items in a cluster be "tolerance" or less distance from each other.
Thanks,
sCott
I am trying out this with the latest Rails 2.0 release candidate, and the clusterer 0.1.9 gem, and getting a method not defined error.
My model:
class Person < ActiveRecord::Base
acts_as_taggable
acts_as_clusterable :fields => ['name']
My rspec:
it "should cluster" do
puts Person.kmeans_clustering()
end
And my error:
undefined method `kmeans_clustering' for Clusterer::Clustering:Class
/Users/epugh/Documents/code/hightechcville/trunk/vendor/plugins/acts_as_clusterable/lib/acts_as_clusterable.rb:25:in `send'
/Users/epugh/Documents/code/hightechcville/trunk/vendor/plugins/acts_as_clusterable/lib/acts_as_clusterable.rb:25:in `method_missing'
It doesn't quite seem like what the method sends to Clusterer:Clustering matches what the method expects???
So, it seems like the README is out of date, because I am looking at a test "clusterable_test.rb" that seems to refer to using the cluster by hitting Person.cluster(), and passing in options???
So, I have at this point an example of acts_as_clusterable working using the google example from the clusterable gem. One thing I notice is that all the data passed in that clustering decisions are made are on stemmed:
design - 0.08, web - 0.08, develop - 0.07, databas - 0.06, softwar - 0.06, specifically the words database and software. Now, since I am passing in a list of tags, I sort of want to show this data, using the original value.. Any way of getting the unstemmed values back out? At any rate, this is pretty neat!
Hi Eric--
I'm interested in using and possibly expanding upon clusterer and the acts_as plugin. We should talk, exchange code samples, etc. since there isn't that much online regarding this gem. I'm mbukhin AT gmail dot com.
thanks
SEOSEO対策レーシックレーシックレーシックインプラントFXFXFXキャッシングキャッシング家庭教師美容整形エステレンタルサーバーオークションサプリメント生命保険自動車保険医療保険年金保険ガン保険介護保険学資保険終身保険傷害保険生命保険クレジットカードビジネスマナーサイト売買バイク買取インテリア投資信託
cheap wow gold
cheap wow gold
cheap wow gold
cheap wow gold
cheap wow gold
cheap wow gold
cheap wow gold
cheap wow gold
cheap wow gold
cheap wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
buy wow gold
buy wow gold
buy wow gold
buy wow gold
buy wow gold
buy wow gold
buy wow gold
buy wow gold
buy wow gold
buy wow gold
world of warcraft gold
world of warcraft gold
world of warcraft gold
world of warcraft gold
world of warcraft gold
world of warcraft gold
world of warcraft gold
world of warcraft gold
world of warcraft gold
world of warcraft gold
world of warcraft
world of warcraft
world of warcraft
world of warcraft
world of warcraft
world of warcraft
world of warcraft
world of warcraft
world of warcraft
world of warcraft
warcraft gold
warcraft gold
warcraft gold
warcraft gold
online poker free money bonus, no deposit bankroll, credited with the free and tournament.
online poker spam
free poker money, Make money from poker without play. $50 Huge rewards with free affiliate program
no deposit poker bonus countries such as Ireland, or working under poker ..
$50 free poker bonus
Titan to make significant poker profits on a regular basis and uniqe mansion no risk
oker is one of my passions, and own a copy of the, up poker profits. ... custom Without related poker sites
make money online
free poker cash, our Poker Profits a Boost plus articles and information about poker online room.
bout the profit. PokerStars Poker Stars internet. Many advanced simply refuse to accept credit card with poker
Internet poker instant bonus
Play for money ...
無料 出会い 競馬予想 無料 競馬予想 競馬予想 無料 競馬予想 無料 競馬予想 無料 近視 手術 メル友 出会い 出会い 出会い 出会い メル友 メル友 人妻 メル友 ギャンブル依存症 AV女優 無料 出会い 出逢い 掲示板 出会い系 無料 出会い 人妻 出会い 人妻 出会い セフレ 人妻 出会い セックスフレンド メル友 出会い SM 愛人 不倫 セフレ 無料 出会い 出会い系 無料 無料 出会い 富士山 写真 富士山 メル友 無臭性動画 カリビアムコム 一本堂 出会い 人妻 セックスフレンド ハメ撮り エッチな0930 メル友 無料 出会い 無料 出会い セフレ セフレ セフレ セックスフレンド セックスフレンド セックスフレンド 人妻 出会い 人妻 出会い 人妻 出会い 出会い系 出会い系 出会い系 カリビアンカム カリビアンカム
Lately I have been very busy with commercial work, so I am not able to give much time to Open Source projects. bet basketball But I still somehow managed to clean up the clusterer gem somewhat and has made a release 0.1.9, its actually a release candidate for 0.2.0. The gem has changed quite a lot, since the initial release, and its not backwards compatible. But there are several new features including Bayesian classifiers. The documentation is very sparse at this moment, sportsbook but the examples and tests should help. There is a new version of acts_as_classifiable . There was some incompatibility issue with the old version and Rails 1.2.*, this is fixed in the new release. The plugin now depends upon the clusterer gem and not classifier gem. The latest and greatest news about celebrity chefs, served up buffet style. - Joe Bastianich celebrates the completion of a marathon the same way I do: with plenty of booze. Of course, he actually ran in the marathon where as I just read about it in the news. march madness Also, after losing 45 lbs, Joe apparently turned into a completely different person. (Compare the photo above to this one.) -ZOMFG liberal foodies’ heads are exploding everywhere today with the news that MICHELLE OBAMA will actually appear on Iron Chef. This was in the New York Times today, so apparently it’s not a joke.
http://www.enterbet.com
it's good,China BusinessChina MarketHong Kong BusinessElectronic PartInternational
BusinessChina MarketBusiness OpportunitiesElectronic PartChina ManufacturerComputer PeripheralChina MarketChina MarketElectronic PartArtComputer PeripheralPaintElectronic PartElectronic PartChina MarketPictureComputer PeripheralComputerChina MarketComputer PeripheralElectronic
Partglamour tea
Kitty Kat gurgled with pleasure. He entered me in one slow motion and I wentcrazy.
incest sex stories free
parent spanking kids stories
interracial porn stories
free online bare ass spanking stories
nifty erotic stories archice
Kitty Kat gurgled with pleasure. He entered me in one slow motion and I wentcrazy.
Finding websites with as much information as this one is always a pleasure I wll be sure to come back and visit again real soon, keep up the good work. Data Recovery Delhi
Nice post. Thanks for the share. It was very interesting and meaningful.
Clone Scripts| Angry birds flash| Angry birds flash|
脚やせエステ仙台
脚やせエステ神奈川
脚やせエステ豊田
脚やせエステ広島
脱毛 山形
脱毛 津田沼
脱毛 長野
脱毛 梅田
脱毛 鹿児島
フェイシャルエステ春日部
フェイシャルエステ赤羽
フェイシャルエステ長野
フェイシャルエステ梅田
フェイシャルエステ鹿児島
エステ体験 茨城
エステ体験 葛飾・江戸川
エステ体験 町田
エステ体験 兵庫
エステ体験 熊本
秋田 エステ
川越 エステ
五反田 エステ
町田 エステ
新潟 エステ
滋賀県 エステ
神戸西神 エステ
天神 エステ
メンズエステ 山形
メンズエステ 福井
メンズエステ 松山
セックスフレンド
セックスフレンド
セックスフレンド
セックスフレンド
セックスフレンド
video
video
video
videowiki
wiki
wiki
wiki
wikiレンタルサーバー
レンタルサーバー
レンタルサーバー
レンタルサーバー
Hey,
Loving your blog, awesome tips on blog you have here. I
would just like to ask you some questions privately, mindIDM Free Download,function venues geelong,lifetime Fitness locations,Mobile Prices in Pakistan
burberry outlet
uggs
north face
coach factory outlet
canada goose
longchamp outlet
michael kors
canada goose outlet
flip or flop
ugg
201711.17wengdongdong
Post a Comment
<< Home