<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def train(cls, data, isotonic=True):
 """ Train an isotonic regression model on the given data. :param data: RDD of (label, feature, weight) tuples. :param isotonic: Whether this is isotonic (which is default) or antitonic. (default: True) """

        boundaries, predictions = callMLlibFunc("trainIsotonicRegressionModel",
                                                data.map(_convert_to_vector), bool(isotonic))
        return IsotonicRegressionModel(boundaries.toArray(), predictions.toArray(), isotonic)