Feature optimization and attribute selection