Class IsotonicRegression

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

public class IsotonicRegression extends Estimator<IsotonicRegressionModel> implements IsotonicRegressionBase, DefaultParamsWritable
Isotonic regression.

Currently implemented using parallelized pool adjacent violators algorithm. Only univariate (single feature) algorithm supported.

Uses IsotonicRegression.

See Also:
  • Constructor Details

    • IsotonicRegression

      public IsotonicRegression(String uid)
    • IsotonicRegression

      public IsotonicRegression()
  • Method Details

    • load

      public static IsotonicRegression load(String path)
    • read

      public static MLReader<T> read()
    • 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)
    • setLabelCol

      public IsotonicRegression setLabelCol(String value)
    • setFeaturesCol

      public IsotonicRegression setFeaturesCol(String value)
    • setPredictionCol

      public IsotonicRegression setPredictionCol(String value)
    • setIsotonic

      public IsotonicRegression setIsotonic(boolean value)
    • setWeightCol

      public IsotonicRegression setWeightCol(String value)
    • setFeatureIndex

      public IsotonicRegression setFeatureIndex(int value)
    • copy

      public IsotonicRegression 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 Estimator<IsotonicRegressionModel>
      Parameters:
      extra - (undocumented)
      Returns:
      (undocumented)
    • fit

      public IsotonicRegressionModel fit(Dataset<?> dataset)
      Description copied from class: Estimator
      Fits a model to the input data.
      Specified by:
      fit in class Estimator<IsotonicRegressionModel>
      Parameters:
      dataset - (undocumented)
      Returns:
      (undocumented)
    • 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)