Class IsotonicRegressionModel

All Implemented Interfaces:
Serializable, org.apache.spark.internal.Logging, Params, HasFeaturesCol, HasLabelCol, HasPredictionCol, HasWeightCol, IsotonicRegressionBase, Identifiable, MLWritable, scala.Serializable

public class IsotonicRegressionModel extends Model<IsotonicRegressionModel> implements IsotonicRegressionBase, MLWritable
Model fitted by IsotonicRegression. Predicts using a piecewise linear function.

For detailed rules see org.apache.spark.mllib.regression.IsotonicRegressionModel.predict().

param: oldModel A IsotonicRegressionModel model trained by IsotonicRegression.

See Also:
  • Method Details

    • read

      public static MLReader<IsotonicRegressionModel> read()
    • load

      public static IsotonicRegressionModel load(String path)
    • isotonic

      public final BooleanParam isotonic()
      Description copied from interface: IsotonicRegressionBase
      Param for whether the output sequence should be isotonic/increasing (true) or antitonic/decreasing (false). Default: true
      Specified by:
      isotonic in interface IsotonicRegressionBase
      Returns:
      (undocumented)
    • featureIndex

      public final IntParam featureIndex()
      Description copied from interface: IsotonicRegressionBase
      Param for the index of the feature if featuresCol is a vector column (default: 0), no effect otherwise.
      Specified by:
      featureIndex in interface IsotonicRegressionBase
      Returns:
      (undocumented)
    • weightCol

      public final Param<String> weightCol()
      Description copied from interface: HasWeightCol
      Param for weight column name. If this is not set or empty, we treat all instance weights as 1.0.
      Specified by:
      weightCol in interface HasWeightCol
      Returns:
      (undocumented)
    • predictionCol

      public final Param<String> predictionCol()
      Description copied from interface: HasPredictionCol
      Param for prediction column name.
      Specified by:
      predictionCol in interface HasPredictionCol
      Returns:
      (undocumented)
    • labelCol

      public final Param<String> labelCol()
      Description copied from interface: HasLabelCol
      Param for label column name.
      Specified by:
      labelCol in interface HasLabelCol
      Returns:
      (undocumented)
    • featuresCol

      public final Param<String> featuresCol()
      Description copied from interface: HasFeaturesCol
      Param for features column name.
      Specified by:
      featuresCol in interface HasFeaturesCol
      Returns:
      (undocumented)
    • uid

      public String uid()
      Description copied from interface: Identifiable
      An immutable unique ID for the object and its derivatives.
      Specified by:
      uid in interface Identifiable
      Returns:
      (undocumented)
    • setFeaturesCol

      public IsotonicRegressionModel setFeaturesCol(String value)
    • setPredictionCol

      public IsotonicRegressionModel setPredictionCol(String value)
    • setFeatureIndex

      public IsotonicRegressionModel setFeatureIndex(int value)
    • boundaries

      public Vector boundaries()
      Boundaries in increasing order for which predictions are known.
    • predictions

      public Vector predictions()
      Predictions associated with the boundaries at the same index, monotone because of isotonic regression.
      Returns:
      (undocumented)
    • copy

      public IsotonicRegressionModel copy(ParamMap extra)
      Description copied from interface: Params
      Creates a copy of this instance with the same UID and some extra params. Subclasses should implement this method and set the return type properly. See defaultCopy().
      Specified by:
      copy in interface Params
      Specified by:
      copy in class Model<IsotonicRegressionModel>
      Parameters:
      extra - (undocumented)
      Returns:
      (undocumented)
    • transform

      public Dataset<Row> transform(Dataset<?> dataset)
      Description copied from class: Transformer
      Transforms the input dataset.
      Specified by:
      transform in class Transformer
      Parameters:
      dataset - (undocumented)
      Returns:
      (undocumented)
    • predict

      public double predict(double value)
    • transformSchema

      public StructType transformSchema(StructType schema)
      Description copied from class: PipelineStage
      Check transform validity and derive the output schema from the input schema.

      We check validity for interactions between parameters during transformSchema and raise an exception if any parameter value is invalid. Parameter value checks which do not depend on other parameters are handled by Param.validate().

      Typical implementation should first conduct verification on schema change and parameter validity, including complex parameter interaction checks.

      Specified by:
      transformSchema in class PipelineStage
      Parameters:
      schema - (undocumented)
      Returns:
      (undocumented)
    • write

      public MLWriter write()
      Description copied from interface: MLWritable
      Returns an MLWriter instance for this ML instance.
      Specified by:
      write in interface MLWritable
      Returns:
      (undocumented)
    • numFeatures

      public int numFeatures()
    • toString

      public String toString()
      Specified by:
      toString in interface Identifiable
      Overrides:
      toString in class Object