jump to navigation

Machine Learning Interviews October 21, 2009

Posted by vyolian in Uncategorized.
Tags: , , , , ,
add a comment

I’ve been fairly busy lately and I have a backlog of blogs to write — mostly about startups. But since I don’t have much time, I’m going to cheat a little and link to a project that I’m pretty excited about.

I’ve been attracting a community of machine learning folks from around the web at http://machine-learning.eggsprout.com. It came to mind that interviews are a great way to learn about someone very quickly. It’s also an awesome way to generate unique and valuable content. I love doing it and it gives me an excuse to reach out to people I never would have otherwise.

Here’s a couple I’ve done so far and I’ll add to this list as I get more. I have a series of interviews for machine learning professionals as well as one for machine learning hiring companies. Please get in contact with me if you’d be open to an informal, flexible, email interview with me!

* Udi Schlessinger, ML + Evolutionary Computation (part 2)

The problem with evolutionary algorithms and machine learning is that it is really hard to create super-large neural networks (think millions or billions of nodes), however, using development this might be possible. If biology does it, so can we!

* Brian Donhauser, Financial Econometrician & ML Fanboy

People in financial economics have used the non-linear techniques found in ML to forecast asset returns, volatilities, correlations, etc., with varying degress of success. What I’m doing with high-frequency data would be considered more of a pre-processing step in knowledge discovery.

* John Graham-Cumming, Causata CTO

Secondly, many machine learning models are non-real time. Information about relationships is built using batch processes and presented to users later. Causata performs real-time machine learning which creates a number of challenges for our developers

Ubuntu Jaunty, VirtualBox, and IE6/7/8 September 11, 2009

Posted by vyolian in Development.
Tags: , , , , ,
2 comments

There are lots of sources on this already (see bottom) but I must have been an uber-noob for none of them to exactly work for me. This is just for myself to document how to test on IE6/7/8 with VirtualBox on Ubuntu Jaunty:

1. sudo apt-get install virtualbox-3.0 wine

2. Download one of the exe files from Internet Explorer Application Compatibility VPC Image page.
- The download takes about 30-40 minutes.
- For the Vista ones, you have to download the exe and the rar files.
- You’ll be repeating this process starting from this step for each IE version / Windows OS you want to test with.

3. wine [IE_number-OS_name].exe
- Go through the installation with defaults.
- At the end, you should have a .vhd file.

4. Create new VM
- VirtualBox
- New -> Give it a name (“WinXP”) and select the appropriate operating system -> Choose RAM (512 for me).
- At the Virtual Hard Disk screen, Existing -> Add -> Select .vhd from earlier.
- At the end, you should see your new VM in the list.

5. Install Guest Additions
- Select your new VM -> Start.
- Cancel all the prompts when Windows starts up.
- Devices (in the outermost VM window) -> Install Guest Additions.
- Restart windows when you’re done.

6. Back on Linux, Download PCnet Driver
- Download the latest AMD PCnet driver
- sudo apt-get install brasero
- brasero
- Project -> New Project -> New Data Project
- Add -> Browse to the zipped driver -> Burn

7. Back in Windows, Install PCnet Driver
- Devices -> Mount CD/DVD-ROM -> CD/DVD-ROM image
- Add -> The ISO you got from the previous step
- Open the drive -> Move and unzip the file into a folder
- Start -> Administrative Tools -> Computer Management -> Device Manager
- Right click on the batteries and disable them.
- Right click AMD PCNET adapter -> Update Driver -> Select the driver you unzipped if it can’t find it on its own.

8. IE should work now.

9. Configuring your “localhost”
- On ubuntu, use ifconfig and copy your ip address (something like 192.168.0.101)
- On windows, open up C:\WINDOWS\system32\drivers\etc\hosts in notepad
- Modify the line “127.0.0.1 localhost” to “192.168.0.101 localhost”

Resources

http://ubuntuforums.org/showthread.php?t=1097080
http://primeval-soup.blogspot.com/2009/02/ie8-in-ubuntu-intrepid-with-virtual-box.html

tinyMCE Multiple Instances with AJAX (Ruby on Rails) July 23, 2009

Posted by vyolian in Development.
Tags: , , ,
2 comments

I had a problem where I had multiple textboxes on a page but only certain ones needed to be tinyMCE WYSIWYGs. I also needed it to work with Ajax and allow for multiple submissions. Here are the gotchas for making it work (I was using Ruby on Rails).

1) Make sure your init mode is set to ‘none’: I also made a mistake of initializing tinyMCE multiple times, once in each partial.

tinyMCE.init({
	mode : "none",
	theme : "advanced",
    inline_styles : "true",
	plugins : "",

2) Add control for each interested textarea: something like…

<%= javascript_tag("tinyMCE.execCommand(
          'mceAddControl', true, 'my_textarea_id');") %>

3) TriggerSave before; Clean Up Afterwards

<% remote_form_for :my_object, :url=>my_url,
        :before=>"tinyMCE.triggerSave(true, true);",
        :update=>{:success=>'succes_id', :failure=>'failure_id'},
        :success=>"tinyMCE.execCommand('mceRemoveControl', false, 'my_textarea_id');" do |f| %>

Resources

http://stackoverflow.com/questions/699615/cant-post-twice-from-the-same-ajax-tinymce-textarea
http://www.elevatedrails.com/articles/2007/08/08/using-rails-tinymce-and-ajax/
http://hamisageek.blogspot.com/2007/11/multiple-tinymce-3-instances-on-one.html

Machine Learning for Beginners July 19, 2009

Posted by vyolian in Development.
Tags: , , , ,
6 comments

Lately, I got huge cravings to learn about machine learning seriously. I don’t get these curious attacks often but when they do, they’re quite extreme. I touched on basic machine learning algorithms at the end of my A.I course at UW. I ended up auditing a graduate machine learning course while I started Eggsprout. Those somehow left me wanting more… a lot more.

For some reason though, there aren’t as many learning resources on it than I’d like. Maybe it’s because I’m only a wanna-be right now and the topic is geared more towards advanced graduate-level scholars. Is there a beginner machine learning community out there? There must be others like me…

EDIT: I’ve started a home for machine learning folks powered by Eggsprout at http://machine-learning.eggsprout.com. Please join me and bring others like us together. Don’t be alarmed if the site is a little empty now, all communities have to start somewhere :) .

If you’re that kind of person and you somehow came across this blog, here’s what I’ve found useful so far:

Stanford CS229 Machine Learning Course on Youtube: Probably the most useful and relevant resource for a beginner. I somewhat enjoy Andrew Ng’s teaching style. I bet he’d be a great mentor to have for research. The way the course is organized is very different from how professor Pedro Domingos taught us though. Not far enough in the series to say whether I like it more or not.

CS229 Lecture Notes: Lecture notes that accompany the Youtube videos.

UW Part-time Masters Lectures: Taught by professor Pedro Domingos, awesome teacher and incredibly genius.

VideoLectures.net: These look like they’d be more advanced but interesting nonetheless. So much to watch… so little time.

ResearchChannel.org: I love this resource for just about any topic. I’ve spent hours on this studying neurobiology back when I first entered college. Hopefully the machine learning topics here are just as interesting.

Machine Learning Data Repository: Nice repository of data for when you’re ready to practice using an algorithm. One of my homework assignments from college was from here.

Ruby A.I Plugins: A few ruby machine learning libraries. I’m a rubyist and it’d be nice to see more of these. Maybe I’ll contribute to these some day :) .

Tegu: A machine learning system in Ruby developed by David Richards. He looks like an interesting character and I’m keeping an eye on him and his projects. I like his dedication to ruby and machine learning.

Aside: Why do Google searches on “Machine Learning” always turn up results about sewing machines?

Cucumber Environment (Facebooker Error) June 11, 2009

Posted by vyolian in Uncategorized.
4 comments

This is regarding rails 2.3.2, facebooker 1.0.32 and Cucumber 0.3.9.

Problem


#Shell

$ cucumber features

You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.[] (NoMethodError)
/project_root/vendor/plugins/facebooker/lib/facebooker.rb:52:in `apply_configuration'
/project_root/vendor/plugins/facebooker/lib/facebooker.rb:44:in `load_configuration'
/project_root/vendor/plugins/facebooker/rails/../init.rb:6

...

/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.11/bin/cucumber:9
/bin/cucumber:19:in `load'
/bin/cucumber:19

Solution

Cucumber added its own environment so that it now adds cucumber.rb into your config/environments folder. So in your config/facebooker.yml, you must add configurations for the new cucumber environment. Also, remember to copy any dependencies you might have from environments/test.rb to environments/cucumber.rb.

#facebooker.yml
cucumber:
  api_key:
  secret_key:
  canvas_page_name:
  callback_url:
  set_asset_host_to_callback_url:
  tunnel:
    public_host_username:
    public_host:
    public_port:
    local_port:
    server_alive_interval:

Resources

http://groups.google.com/group/facebooker/browse_thread/thread/fb26528664d00ec6?pli=1
http://groups.google.com/group/facebooker/browse_thread/thread/fb26528664d00ec6

Installing Webrat on Cygwin June 11, 2009

Posted by vyolian in Uncategorized.
1 comment so far

Webrat “lets you quickly write expressive and robust acceptance tests for a Ruby web application.”

Installing Nokogiri

Users of Debian Linux (e.g. Ubuntu) need to run:

sudo apt-get install libxslt1-dev libxml2-dev.

Otherwise the Nokogiri gem, which Webrat depends on, won’t install properly.

On their page, it warns you that Webrat relies on Nokogiri and you’ll have to manually install that first. However, for Cygwin, you really actually need libxslt-devel and libxml2-devel.

Always check the Cygwin Package List first when you get these kinds of errors — its saved me multiple times. Also, refer to my blog on apt-cyg for easy package installing.

Pulled Over For Speeding Ticket? My 101. May 23, 2009

Posted by vyolian in Community.
Tags: , , ,
add a comment

In 15 days, I owe $144 for going 71 on a 60 heading from Seattle to Pullman. Really… do people still get pulled over going 70 on a 60? On I-90E, you either go 55 on the right lane in between semis or you go on the left lane and be tailgated going 75. I had just slowed down to 70 exiting off I-90 onto WA-26 when I was pulled over within 5 miles along with the car in front of me. And must I mention having farms on either side of me with at most three other moving vehicles in my line of sight at all times…

Wrong time, wrong place? Since it’s my first time being pulled over, I thought I’d do some research about what I should have done and what I need to do now. Here’s what I’ve found:

When Being Pulled Over

There’s a common theme amongst the sources I’ve read about what to do when it’s already too late, you’re on the shoulder, and the cop is at your window.

  • Be Polite and Respectful
    It’s understandably frightening being an officer coming up to a stranger’s window. Make sure your hands are on your steering wheel and don’t make sudden movements towards your pocket or glove box. Tell them where you’re reaching and what you’re getting and wait for approval.
  • Don’t Admit Guilt
    Don’t speak first. The officer’s strategy is to have you admit that you committed a violation or that you were careless, inattentive, or negligent. Let all your answers be short and non-committal. Answer questions like “Do you know why I pulled you over” with “No”. Then when the officer explains to you what your violations are, answer with “I see”. Not sure why this won’t point you to being inattentive but it’s what I’ve been reading. Authorities can use any admission against you when you contest your ticket.
  • Change of Venue
    If you’re far away from your home, ask for a change of venue. This is where I got screwed. If I want to appear in court, I’d have to drive 3 hours to get there. I’ve been reading that it’s impossible or way less likely to get a change of venue after-the-fact. Still need to call to make sure.

Resources: here, here, here, here

After Traffic Ticket

There are three options after you get your ticket, pay right away, mitigate (admit guilt and hope for reduced fee) or contest (fight for innocence). Most resources recommend going to court for a mitigation even for the most minor violations — you’ll most likely get a fee reduction. On the other hand, most resources recommend not contesting (unless you’re on a biased traffic lawyer’s site).

  • The Fine
    I was billed $144 for going 71 on a 60. Apparently, the cost for going 11-15 over limit should be $52. Not sure how valid this document is, but check here.
  • Mail It Correctly
    There’s a suggestion to mail your ticket using certified with return receipt mail. Clerks receive thousands of tickets each day and some may get lost. In the worst case, at least you’ll have proof when you’re standing in front of the judge.
  • Other Options
    Some courts allow you to attend a Saturday traffic school session to keep a speeding ticket off your record. Unfortunately, Washington State generally doesn’t allow that. Another option is for you to ask for deferment so your ticket won’t be reported if you don’t get caught again within that year. You only get one of these every seven years.
  • Hearing by Mail
    When you mail in your green infraction ticket or up until 7 days prior to the hearing date, you may request a hearing by mail. You will no longer need to appear in court but may receive a notice by mail or phone. To request hearing by mail, complete and send the form here with your ticket.
  • Unlikely Choices
    I’ve been reading a lot of these and I think they’re lame, but here they are just for completeness. Many people try to find loopholes in how their speed was detected. They bring to court excuses like whether the radar has been calibrated correctly or whether the officer has been trained properly to operate it. Another lame one is to ask for a contest and hope the officer does not show up at the hearing, in which case, the violation is no longer valid.

Resouces: here, here, here, here, here

Good News

A ticket is a ticket, but here are some things to make you feel better.

  • Safety First
    Study shows that speeding tickets do make an impact for a little bit. One statistic finds one moving violation cuts the risk of a fatal crash in the following month by 35% (and then near 0% four months after). — washington-state-speeding-ticket
  • Where Your $$ Usually Goes
    Even if you don’t think you deserved your ticket, maybe the fee you pay will help avoid potential harm to your loved ones in the future. “Of the citation fines, 57% are remitted to the local jurisdiction wherein the citation was issued, and 43% are remitted to the Public Safety Education Account (PSEA). These funds are used to promote traffic safety education, highway safety, criminal justice training, crime victims’ compensation, judicial education, the judicial information system, civil representation of indigent persons, winter recreation parking, drug court operations, and state game programs.” — wsp.wa.gov
  • Ulterior Motives
    It’s hard not to think this and sometimes you may be right. Apparently, there’s a story covered by AP in 2008 that revealed almost a competition in WSP where they won an award for being the best state police agency of its size by issuing more speeding tickets than the previous year. Some of the ticket fines went to funding that exact agency. In the same article, I found that I traveled between a county ranked bottom third for number of speeding tickets issued (King County) and one that ranks 7th highest in Washington (Spokane County). — washingtontrafficlawblog
  • Average Education of a Police Officer
    I think this one gets pulled out the most often. I went ahead and did a little research in case I was following the stereotype. “Applicants usually must have at least a high school education, and some departments require 1 or 2 years of college coursework or, in some cases, a college degree.” (I took the liberty of emphasizing certain parts of the previous quote). Other than this, I’m having trouble finding real statistics. — here

The Rest of My Trip

For the next 2.5 hours heading to Pullman, I stuck to the speed limit on a one-lane freeway. Imagine how slow that must have felt surrounded by nothing but plains on either side. Every car that came behind me decided to pass me at the dotted yellow lines. I just stayed to the very right side of the boundary to make their pass easier. I made sure not to look left as they were passing only to see them staring back at me like I was an idiot. Oh how I envied their luck. However, I did see a few more cars pulled over before entering Pullman. Not sure how I was supposed to feel about that — but it did make a feel a little less of an idiot.

Ruby on Rails ImageMagick and RMagick on Cygwin May 14, 2009

Posted by vyolian in Development.
Tags: , , , ,
add a comment

I previously wrote an article about setting up ImageMagick and RMagick from source. I’ve since converted all my ruby on rails development onto Cygwin. Here’s a more specific setup for ImageMagick and RMagick for this environment.

Packages

You need to install quite a bit of packages in order for ImageMagick to work correctly. The list below looks like overkill to me but I haven’t isolated each one to see which ones actually matter and which ones can be left out.

You can (re)install Cygwin to get to the package UI to find most of these under the graphics category. I find that method extremely slow preferring apt-cyg instead, which I’ve documented here.

I like to use Cygwin’s package list for reference. The packages you need are:

  • ImageMagick
  • libMagick-devel
  • XFree86-lib-compat
  • xorg-x11-devel
  • libbz2-devel

RMagick

Installing the gem should now be as easy as…

gem install rmagick

Problem?

When you finally use ImageMagick, you may get the error…

unable to read font `/usr/lib/ImageMagick-6.4.0/config//usr/share/fonts/corefonts/arial.ttf': `(null)'

You may have noticed that the path looks a bit silly with “…/config//user/…” To fix this, help Cygwin along by pointing it to the actual location of Window’s fonts.

ln -s /cygdrive/c/Windows/Fonts /usr/share/fonts/corefonts

Resources

http://xiaoboonrails.blogspot.com/2008/02/run-ruby-gems-rails-and-mysql-on-cygwin.html
http://chihungchan.blogspot.com/2008_12_01_archive.html

Ruby on Rails respond_to bug on IE7 May 6, 2009

Posted by vyolian in Development.
Tags: , , , ,
add a comment

Bug

  • Clicking on a link pops up a download dialog instead of redirecting you to a page.
  • Clicking on a link opens up the xml feed instead of showing the actual page.

Order matters in respond_to

The order of format in respond_to matters. The two below are different.

respond_to do |format|
  format.html { }
  format.js { }
end
respond_to do |format|
  format.js{ }
  format.html { }
end

Reason

Due to how IE7 builds its request accept header, format.html needs to be first. IE accepts any MIME types so the order you put it in is the priority that IE7 takes. Firefox doesn’t have this problem because it asks for a particular format.

Resources

  • http://www.danielcadenas.com/2008/10/internet-explorer-7-accept-header-and.html
  • http://tore.darell.no/posts?page=4
  • http://paul.stadig.name
  • http://apidock.com/rails/ActionController/MimeResponds/InstanceMethods/respond_to

Ruby on Rails Disabling Submit Button May 1, 2009

Posted by vyolian in Development.
Tags: , , , , , ,
1 comment so far

You’ve seen sites with disclaimers, especially with credit card transactions, warning the user not to click twice or they may be charged double. Fortunately again, Ruby on Rails provides a very simple solution to that by disabling the submit button while the form is being processed. Here’s how:

Post

This slipped me every time I’ve looked into this, but there’s actually a documented option in submit_tag that does this automatically

    # :disable_with - Value of this parameter will be used as the value for a disabled version of the submit button when the form is submitted.
    <%= submit_tag "Submit", :disable_with=>"Processing..." %>

Ajax

For ajax forms, you’ll have to do something a little different but just as easy.

form_remote_tag
  :url=>{:action=>'my_action'},
  :loading=>"Form.Element.disable('submit_id')",
  :complete=>"Form.Element.enable('submit_id')"

Resources

http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#M001707
http://api.rubyonrails.org/classes/ActionView/Helpers/PrototypeHelper.html#M001616