Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Monday, April 18, 2011

Simple Java Wicket using Mahout

While continuing the study of mahout, it is inevitable to write code that uses the various algorithms stored with it. So I asked a colleague to help out and one option was to start with a java wicket found here: http://blog.jteam.nl/wp-content/uploads/2010/04/taste-getting-started.zip

Using it is quite straightforward. Download the zip file. Unzip it to some folder (say taste-getting-started in the mahout machine). Using Ubuntu’s Terminal application, go to that folder and run mvn package. After packaging is complete, run mvn jetty:run-war. Once the jetty server is up, you can make use of the wicket by browsing http://localhost:8080/taste-getting-started/movies.

Although the above is the straightforward usage of the said wicket, setting it up requires some effort such as

  • downloading the MovieLens’ 100K Ratings Data Set: http://grouplens.org/system/files/ml-data_0.zip
  • Unzipping it to some other folder.
  • Copying u.data to taste-getting-started/src/main/resources/grouplens/100K/ratings
  • Copying u.item to taste-getting-started/src/main/resources/grouplens/100K/data
  • Executing the initialize_movielens_db.sql using the following command mysql --user=mysqluser --password=mysqlpassword < initialize_movielens_db.sql while at the taste-getting-started/src/main/resources/sql folder.

Oh and if you do not have MySQL yet, install it by issuing the following command sudo apt-get install mysql-server mysql-client.

Thursday, March 31, 2011

sudo apt-get install made my day

 

I just have installed Ubuntu 10.10 on an instance of an Oracle VM VirtualBox on my Windows 7 machine when I tried to install the prerequisites of mahout (http://mahout.apache.org/). So I opened the Terminal app, keyed in java and it suggests that I should use sudo apt-get install <package> to initiate the installation which I did.

Now in the next steps of mahout install procedure I saw the need for subversion. So I tried keying in svn and again Ubuntu suggests the use of sudo apt-get install <package>.

Very well indeed, this suggestion saved me time where to find the correct installers, time to download them, and fire up the installation.