binary classifier implemented by javascript