In bulk

Here are four short notes that were not short enough to be tweets, nor long enough to be posts on their own.


Now They're Sixty-Four is a fun article about pilgrimages to Liverpool. I feel uncomfortable about tribute bands; playing covers is OK, but copying their appearance, haircuts and all that seems a bit excessive to me. And about the Beatles, although I considered once doing a pilgrimage, I don't think that I'll put an effort on that idea anytime soon.


On a side note, Fray appears to be a good to read on a Sunday morning like this. It needs to be read not on a feed reader, but on a its own website, using something that is able to render the page with its nice layout, fonts and illustrations. By the way, I found about Fray in Javier's blog, which I also recommend reading. Again, not on a feed reader, but on its website, as it should be.


I started to use sbt: a (relatively) simple build tool for Java and Scala.

Having survived the pain of writing XML Ant build files (including for loops and conditionals), skipped almost completely Maven (and its tendency to download hundreds of jar files for compiling a couple of classes) and enjoyed the joy of Python (where build files are essentially unnecessary), I think sbt has a sane balance between these two extremes. It is simple enough for the most common cases, relatively easy to adapt for special cases and, at least for me, a bit to complex to be completely understandable (e.g. the overloaded operators of its syntax).

Somehow, sbt reflects what Scala is to Java: a language that is elegant, fun to write, (sometimes) easy enough to read, but that gets too complex when you try to do something more advanced.


Again, on a side note, I think (non-toy) software projects should own it domain name. Or at least they should have a home page that shows the main information about it, preferably independent of the project hosting site they're using.

This applies to many more things, but in the case of software projects is particularly important to own its identity. Even just for practical reasons: users get less confused, documentation and related files are in the same place and other users and search engines know which links to follow. I know that people writing software rarely have time to create home pages or to write good documentation, but one should follow great examples (like Django and scikit-learn) and try to do the same.

Detección de género para nombres de personas (2)

Aprovechando las vacaciones y que ahora tengo una mejor idea de clasificadores automáticos, actualicé mi programa que indica si el nombre de una persona es de género masculino o femenino. Cambié la forma de representar los datos, el algoritmo de clasificación y la librería que utilizaba para implementarlo. El nuevo clasificador comete menos errores y es más facil de modificar.

Primero, la representación de los datos es muy sencilla: se basa en las últimas letras de cada nombre. Concretamente, por cada nombre se extraen tres partes que corresponden a la última, 4 últimas y cinco últimas letras. Por ejemplo, Daniel se representa como una secuencia de tres elementos: "l", "niel" y "aniel". Para nombres compuestos (como Manuel Darío) se hace lo mismo para cada nombre. Esta fue la combinación con la cual el clasificador obtuvo mejores resultados durante las pruebas.

Segundo, reemplacé el clasificador bayesiano (naïve bayes) por regresión logística, de nuevo, porque obtuve mejores resultados, y ahora utilizo la implementación de scikit-learn, mi librería favorita para mis proyectos de machine learning. En cuanto a los resultados, el nuevo clasificador pasó de 252 errores a 121 en los datos de prueba (alrededor de 14.000 nombres). En una serie de datos adicionales, el anterior clasificador cometía 255 errores, mientras que la nueva versión comete 132.

Creo que los resultados son bastante buenos, especialmente teniendo en cuenta la simplicidad del modelo. Me gustaría comparar los resultados usando árboles de decisión y AdaBoost, como me lo sugirieron en un comentario a la primera versión. Sin embargo, primero tengo que hacer unas modificaciones para usar las implementaciones de la librería. Espero trabajar en eso durante estos días, aunque este proyecto no es más que un juguete poco útil, quiero utilizar más y contribuir a scikit-learn.