Smorgasbord - Politics, Lisp, Rails, Fencing, etc.

My musings on assortment of things ranging from politics, computer technology and programming to sports.

Thursday, August 24, 2006


On this day:

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

24 Comments:

At Fri Aug 25, 05:17:00 AM 2006, Blogger Surendra Singhi said...

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.

 
At Sun Aug 27, 10:27:00 AM 2006, Anonymous Anonymous said...

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!

 
At Sun Aug 27, 06:59:00 PM 2006, Anonymous Anonymous said...

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?

 
At Mon Aug 28, 04:32:00 AM 2006, Blogger Surendra Singhi said...

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.

 
At Mon Nov 27, 08:13:00 PM 2006, Anonymous Anonymous said...

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

 
At Sun Nov 25, 12:28:00 PM 2007, Anonymous Anonymous said...

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???

 
At Sun Nov 25, 12:46:00 PM 2007, Anonymous Anonymous said...

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???

 
At Mon Nov 26, 08:32:00 AM 2007, Anonymous Anonymous said...

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!

 
At Fri Dec 28, 07:47:00 AM 2007, Anonymous Anonymous said...

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

 
At Fri May 22, 03:09:00 AM 2009, Anonymous SEO said...

SEOSEO対策レーシックレーシックレーシックインプラントFXFXFXキャッシングキャッシング家庭教師美容整形エステレンタルサーバーオークションサプリメント生命保険自動車保険医療保険年金保険ガン保険介護保険学資保険終身保険傷害保険生命保険クレジットカードビジネスマナーサイト売買バイク買取インテリア投資信託

 
At Fri Jun 12, 09:55:00 PM 2009, Blogger Unknown said...

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

 
At Mon Jun 22, 06:55:00 AM 2009, Anonymous Anonymous said...

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 ...

 
At Fri Jul 24, 10:48:00 AM 2009, Anonymous Anonymous said...

無料 出会い 競馬予想 無料 競馬予想 競馬予想 無料 競馬予想 無料 競馬予想 無料 近視 手術 メル友 出会い 出会い 出会い 出会い メル友 メル友 人妻 メル友 ギャンブル依存症 AV女優 無料 出会い 出逢い 掲示板 出会い系 無料 出会い 人妻 出会い 人妻 出会い セフレ 人妻 出会い セックスフレンド メル友 出会い SM 愛人 不倫 セフレ 無料 出会い 出会い系 無料 無料 出会い 富士山 写真 富士山 メル友 無臭性動画 カリビアムコム 一本堂 出会い 人妻 セックスフレンド ハメ撮り エッチな0930 メル友 無料 出会い 無料 出会い セフレ セフレ セフレ セックスフレンド セックスフレンド セックスフレンド 人妻 出会い 人妻 出会い 人妻 出会い 出会い系 出会い系 出会い系 カリビアンカム カリビアンカム

 
At Tue Feb 16, 01:04:00 PM 2010, Blogger pedro velasquez said...

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

 
At Wed Mar 17, 02:55:00 AM 2010, Blogger blog said...

it's good,China BusinessChina MarketHong Kong BusinessElectronic PartInternational

Business
China MarketBusiness OpportunitiesElectronic PartChina ManufacturerComputer PeripheralChina MarketChina MarketElectronic PartArtComputer PeripheralPaintElectronic PartElectronic PartChina MarketPictureComputer PeripheralComputerChina MarketComputer PeripheralElectronic

Partglamour tea

 
At Thu Oct 21, 07:17:00 PM 2010, Blogger 咪摩兔 said...

八大娛樂全套-指油壓半套

高雄汽車借款.高雄當鋪.吉成當鋪
高雄當鋪.高雄汽車借款.易成當鋪
台南當鋪.台南汽車借款.信利當鋪

 
At Sat Dec 04, 06:38:00 AM 2010, Anonymous bestiality real stories said...

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.

 
At Tue Mar 01, 12:45:00 AM 2011, Anonymous Anonymous said...

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

 
At Thu Jun 16, 02:11:00 AM 2011, Anonymous airbnb clone said...

Nice post. Thanks for the share. It was very interesting and meaningful.
Clone Scripts| Angry birds flash| Angry birds flash|

 
At Fri Jun 24, 02:38:00 AM 2011, Anonymous Anonymous said...

脚やせエステ仙台
脚やせエステ神奈川
脚やせエステ豊田
脚やせエステ広島
脱毛 山形
脱毛 津田沼
脱毛 長野
脱毛 梅田
脱毛 鹿児島
フェイシャルエステ春日部
フェイシャルエステ赤羽
フェイシャルエステ長野
フェイシャルエステ梅田
フェイシャルエステ鹿児島
エステ体験 茨城
エステ体験 葛飾・江戸川
エステ体験 町田
エステ体験 兵庫
エステ体験 熊本
秋田 エステ
川越 エステ
五反田 エステ
町田 エステ
新潟 エステ
滋賀県 エステ
神戸西神 エステ
天神 エステ
メンズエステ 山形
メンズエステ 福井
メンズエステ 松山

 
At Wed Jul 27, 12:04:00 AM 2011, Anonymous Anonymous said...

セックスフレンド
セックスフレンド
セックスフレンド
セックスフレンド
セックスフレンド

 
At Wed Jul 27, 12:06:00 AM 2011, Anonymous Anonymous said...

video
video
video
videowiki
wiki
wiki
wiki
wikiレンタルサーバー
レンタルサーバー
レンタルサーバー
レンタルサーバー

 
At Fri Sep 09, 04:17:00 PM 2011, Blogger Frank said...

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

 
At Thu Nov 16, 06:55:00 PM 2017, Blogger Unknown said...

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