Refactor classifier generation in notebook