Unified framework for quantum classification