generate classifier only once at first