Supervised Structured-Input Classification Algorithm