<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def predict(self, features):
 """Use the optimized pipeline to predict the target for a feature set. Parameters features: array-like {n_samples, n_features} Feature matrix Returns array-like: {n_samples} Predicted target for the samples in the feature matrix """

        if not self.fitted_pipeline_:
            raise RuntimeError('A pipeline has not yet been optimized. Please call fit() first.')

        features = self._check_dataset(features, target=None, sample_weight=None)

        return self.fitted_pipeline_.predict(features)