Learning Penalty for Optimal Partitioning via Automatic Feature Extraction