Classifiers Based on Cost Function Optimization