Package org.apache.spark.ml.regression
Class AFTSurvivalRegressionModel
Object
org.apache.spark.ml.PipelineStage
org.apache.spark.ml.Transformer
org.apache.spark.ml.Model<M>
org.apache.spark.ml.PredictionModel<FeaturesType,M>
org.apache.spark.ml.regression.RegressionModel<Vector,AFTSurvivalRegressionModel>
org.apache.spark.ml.regression.AFTSurvivalRegressionModel
- All Implemented Interfaces:
Serializable
,org.apache.spark.internal.Logging
,Params
,HasAggregationDepth
,HasFeaturesCol
,HasFitIntercept
,HasLabelCol
,HasMaxBlockSizeInMB
,HasMaxIter
,HasPredictionCol
,HasTol
,PredictorParams
,AFTSurvivalRegressionParams
,Identifiable
,MLWritable
,scala.Serializable
public class AFTSurvivalRegressionModel
extends RegressionModel<Vector,AFTSurvivalRegressionModel>
implements AFTSurvivalRegressionParams, MLWritable
Model produced by
AFTSurvivalRegression
.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.spark.internal.Logging
org.apache.spark.internal.Logging.SparkShellLoggingFilter
-
Method Summary
Modifier and TypeMethodDescriptionfinal IntParam
Param for suggested depth for treeAggregate (>= 2).Param for censor column name.Creates a copy of this instance with the same UID and some extra params.final BooleanParam
Param for whether to fit an intercept term.double
static AFTSurvivalRegressionModel
final DoubleParam
Param for Maximum memory in MB for stacking input data into blocks.final IntParam
maxIter()
Param for maximum number of iterations (>= 0).int
Returns the number of features the model was trained on.double
Predict label for the given features.predictQuantiles
(Vector features) final DoubleArrayParam
Param for quantile probabilities array.Param for quantiles column name.static MLReader<AFTSurvivalRegressionModel>
read()
double
scale()
setQuantileProbabilities
(double[] value) setQuantilesCol
(String value) final DoubleParam
tol()
Param for the convergence tolerance for iterative algorithms (>= 0).toString()
Transforms dataset by reading fromPredictionModel.featuresCol()
, callingpredict
, and storing the predictions as a new columnPredictionModel.predictionCol()
.transformSchema
(StructType schema) Check transform validity and derive the output schema from the input schema.uid()
An immutable unique ID for the object and its derivatives.write()
Returns anMLWriter
instance for this ML instance.Methods inherited from class org.apache.spark.ml.PredictionModel
featuresCol, labelCol, predictionCol, setFeaturesCol, setPredictionCol
Methods inherited from class org.apache.spark.ml.Transformer
transform, transform, transform
Methods inherited from class org.apache.spark.ml.PipelineStage
params
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.spark.ml.regression.AFTSurvivalRegressionParams
getCensorCol, getQuantileProbabilities, getQuantilesCol, hasQuantilesCol, validateAndTransformSchema
Methods inherited from interface org.apache.spark.ml.param.shared.HasAggregationDepth
getAggregationDepth
Methods inherited from interface org.apache.spark.ml.param.shared.HasFeaturesCol
featuresCol, getFeaturesCol
Methods inherited from interface org.apache.spark.ml.param.shared.HasFitIntercept
getFitIntercept
Methods inherited from interface org.apache.spark.ml.param.shared.HasLabelCol
getLabelCol, labelCol
Methods inherited from interface org.apache.spark.ml.param.shared.HasMaxBlockSizeInMB
getMaxBlockSizeInMB
Methods inherited from interface org.apache.spark.ml.param.shared.HasMaxIter
getMaxIter
Methods inherited from interface org.apache.spark.ml.param.shared.HasPredictionCol
getPredictionCol, predictionCol
Methods inherited from interface org.apache.spark.internal.Logging
initializeForcefully, initializeLogIfNecessary, initializeLogIfNecessary, initializeLogIfNecessary$default$2, isTraceEnabled, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning, org$apache$spark$internal$Logging$$log_, org$apache$spark$internal$Logging$$log__$eq
Methods inherited from interface org.apache.spark.ml.util.MLWritable
save
Methods inherited from interface org.apache.spark.ml.param.Params
clear, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, paramMap, params, set, set, set, setDefault, setDefault, shouldOwn
Methods inherited from interface org.apache.spark.ml.PredictorParams
validateAndTransformSchema
-
Method Details
-
read
-
load
-
censorCol
Description copied from interface:AFTSurvivalRegressionParams
Param for censor column name. The value of this column could be 0 or 1. If the value is 1, it means the event has occurred i.e. uncensored; otherwise censored.- Specified by:
censorCol
in interfaceAFTSurvivalRegressionParams
- Returns:
- (undocumented)
-
quantileProbabilities
Description copied from interface:AFTSurvivalRegressionParams
Param for quantile probabilities array. Values of the quantile probabilities array should be in the range (0, 1) and the array should be non-empty.- Specified by:
quantileProbabilities
in interfaceAFTSurvivalRegressionParams
- Returns:
- (undocumented)
-
quantilesCol
Description copied from interface:AFTSurvivalRegressionParams
Param for quantiles column name. This column will output quantiles of corresponding quantileProbabilities if it is set.- Specified by:
quantilesCol
in interfaceAFTSurvivalRegressionParams
- Returns:
- (undocumented)
-
maxBlockSizeInMB
Description copied from interface:HasMaxBlockSizeInMB
Param for Maximum memory in MB for stacking input data into blocks. Data is stacked within partitions. If more than remaining data size in a partition then it is adjusted to the data size. Default 0.0 represents choosing optimal value, depends on specific algorithm. Must be >= 0..- Specified by:
maxBlockSizeInMB
in interfaceHasMaxBlockSizeInMB
- Returns:
- (undocumented)
-
aggregationDepth
Description copied from interface:HasAggregationDepth
Param for suggested depth for treeAggregate (>= 2).- Specified by:
aggregationDepth
in interfaceHasAggregationDepth
- Returns:
- (undocumented)
-
fitIntercept
Description copied from interface:HasFitIntercept
Param for whether to fit an intercept term.- Specified by:
fitIntercept
in interfaceHasFitIntercept
- Returns:
- (undocumented)
-
tol
Description copied from interface:HasTol
Param for the convergence tolerance for iterative algorithms (>= 0). -
maxIter
Description copied from interface:HasMaxIter
Param for maximum number of iterations (>= 0).- Specified by:
maxIter
in interfaceHasMaxIter
- Returns:
- (undocumented)
-
uid
Description copied from interface:Identifiable
An immutable unique ID for the object and its derivatives.- Specified by:
uid
in interfaceIdentifiable
- Returns:
- (undocumented)
-
coefficients
-
intercept
public double intercept() -
scale
public double scale() -
numFeatures
public int numFeatures()Description copied from class:PredictionModel
Returns the number of features the model was trained on. If unknown, returns -1- Overrides:
numFeatures
in classPredictionModel<Vector,
AFTSurvivalRegressionModel>
-
setQuantileProbabilities
-
setQuantilesCol
-
predictQuantiles
-
predict
Description copied from class:PredictionModel
Predict label for the given features. This method is used to implementtransform()
and outputPredictionModel.predictionCol()
.- Specified by:
predict
in classPredictionModel<Vector,
AFTSurvivalRegressionModel> - Parameters:
features
- (undocumented)- Returns:
- (undocumented)
-
transform
Description copied from class:PredictionModel
Transforms dataset by reading fromPredictionModel.featuresCol()
, callingpredict
, and storing the predictions as a new columnPredictionModel.predictionCol()
.- Overrides:
transform
in classPredictionModel<Vector,
AFTSurvivalRegressionModel> - Parameters:
dataset
- input dataset- Returns:
- transformed dataset with
PredictionModel.predictionCol()
of typeDouble
-
transformSchema
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 byParam.validate()
.Typical implementation should first conduct verification on schema change and parameter validity, including complex parameter interaction checks.
- Overrides:
transformSchema
in classPredictionModel<Vector,
AFTSurvivalRegressionModel> - Parameters:
schema
- (undocumented)- Returns:
- (undocumented)
-
copy
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. SeedefaultCopy()
.- Specified by:
copy
in interfaceParams
- Specified by:
copy
in classModel<AFTSurvivalRegressionModel>
- Parameters:
extra
- (undocumented)- Returns:
- (undocumented)
-
write
Description copied from interface:MLWritable
Returns anMLWriter
instance for this ML instance.- Specified by:
write
in interfaceMLWritable
- Returns:
- (undocumented)
-
toString
- Specified by:
toString
in interfaceIdentifiable
- Overrides:
toString
in classObject
-