Spark2 生存分析Survival regression
在spark.ml中,实现了加速失效时间(AFT)模型,这是一个用于检查数据的参数生存回归模型。 它描述了生存时间对数的模型,因此它通常被称为生存分析的对数线性模型。 不同于为相同目的设计的比例风险模型,AFT模型更容易并行化,因为每个实例独立地贡献于目标函数。
当在具有常量非零列的数据集上匹配AFTSurvivalRegressionModel而没有截距时,Spark MLlib为常量非零列输出零系数。 这种行为不同于R survival :: survreg。
导入包
import org.apache.spark.sql.SparkSession
import org.apache.spark.sql.Dataset
import org.apache.spark.sql.Row
import org.apache.spark.sql.DataFrame
import org.apache.spark.sql.functions._ import org.apache.spark.ml.linalg.Vectors
import org.apache.spark.ml.feature.VectorAssembler
import org.apache.spark.ml.Pipeline
import org.apache.spark.ml.evaluation.RegressionEvaluator
import org.apache.spark.ml.regression.AFTSurvivalRegression
import org.apache.spark.ml.tuning.{ CrossValidator, ParamGridBuilder }
导入样本数据
val spark = SparkSession.builder().appName("Spark Survival regression").config("spark.some.config.option", "some-value").getOrCreate() // For implicit conversions like converting RDDs to DataFrames
import spark.implicits._ val dataList: List[(Double, Double, Double, Double,Double, Double, Double, Double,Double, Double)] = List(
(16, 1, 1, 0, 0, 1, 24, 82, 14, 0),
(1, 1, 1, 0, 1, 0, 26, 85, 12, 0),
(4, 0, 1, 0, 0, 0, 25, 85, 12, 0),
(3, 1, 1, 0, 1, 1, 21, 85, 9, 0),
(36, 1, 1, 0, 1, 0, 22, 82, 12, 0),
(36, 1, 1, 0, 0, 0, 18, 82, 11, 0),
(16, 1, 1, 1, 1, 0, 20, 81, 9, 0),
(8, 0, 1, 0, 1, 0, 24, 85, 12, 0),
(20, 1, 1, 1, 0, 0, 24, 85, 12, 0),
(44, 1, 1, 0, 0, 0, 24, 82, 14, 0),
(20, 1, 1, 0, 1, 0, 26, 84, 12, 0),
(30, 1, 1, 0, 1, 0, 22, 84, 12, 1),
(24, 1, 1, 0, 0, 0, 19, 83, 12, 0),
(13, 1, 1, 0, 0, 0, 22, 80, 14, 0),
(6, 1, 1, 0, 0, 0, 27, 84, 16, 0),
(2, 1, 1, 0, 0, 0, 22, 81, 12, 1),
(5, 1, 1, 0, 0, 0, 26, 85, 13, 0),
(192, 1, 1, 0, 0, 0, 21, 78, 12, 0),
(4, 1, 1, 0, 0, 0, 20, 83, 12, 0),
(12, 1, 1, 0, 1, 0, 22, 81, 12, 0),
(4, 1, 2, 0, 0, 0, 24, 86, 12, 0),
(16, 0, 2, 1, 1, 1, 21, 84, 12, 1),
(24, 1, 1, 0, 0, 0, 27, 84, 14, 0),
(16, 1, 1, 0, 1, 0, 23, 81, 12, 0),
(3, 1, 1, 0, 0, 0, 26, 84, 14, 0),
(16, 1, 1, 0, 1, 0, 24, 82, 14, 0),
(28, 1, 1, 0, 0, 0, 23, 81, 12, 0),
(1, 1, 1, 0, 1, 0, 19, 81, 12, 0),
(13, 1, 1, 0, 0, 1, 23, 85, 14, 0),
(36, 1, 1, 0, 0, 0, 21, 83, 10, 0),
(32, 1, 1, 0, 1, 0, 20, 82, 12, 1),
(16, 1, 1, 0, 1, 1, 21, 80, 12, 0),
(2, 1, 1, 0, 0, 1, 21, 83, 12, 0),
(8, 1, 1, 0, 0, 1, 24, 83, 14, 1),
(1, 1, 1, 0, 0, 0, 22, 83, 10, 0),
(24, 1, 2, 0, 0, 0, 18, 79, 11, 0),
(64, 1, 1, 0, 1, 0, 20, 84, 12, 0),
(8, 1, 1, 0, 0, 0, 23, 84, 10, 1),
(2, 1, 1, 0, 0, 0, 16, 80, 9, 1),
(12, 1, 1, 0, 0, 0, 22, 80, 13, 0),
(18, 1, 1, 0, 0, 0, 24, 83, 12, 0),
(32, 1, 1, 0, 0, 0, 24, 85, 14, 0),
(2, 1, 1, 0, 0, 0, 19, 78, 12, 0),
(7, 1, 1, 0, 0, 0, 26, 85, 16, 0),
(5, 1, 1, 0, 0, 0, 22, 81, 12, 0),
(44, 1, 1, 0, 0, 0, 22, 82, 16, 0),
(2, 1, 1, 1, 1, 0, 21, 81, 12, 1),
(4, 1, 1, 0, 1, 0, 18, 81, 10, 1),
(2, 0, 1, 0, 0, 0, 21, 86, 12, 1),
(6, 1, 1, 0, 0, 0, 25, 85, 16, 0),
(4, 1, 1, 0, 0, 0, 22, 81, 12, 0),
(36, 1, 1, 0, 0, 0, 24, 83, 12, 0),
(12, 1, 1, 0, 0, 0, 22, 83, 13, 1),
(24, 1, 1, 0, 0, 0, 20, 85, 12, 0),
(42, 1, 1, 0, 0, 0, 25, 82, 16, 0),
(16, 1, 1, 0, 1, 0, 21, 79, 13, 0),
(44, 1, 1, 0, 0, 0, 25, 84, 12, 0),
(44, 1, 1, 0, 0, 0, 26, 84, 16, 0),
(10, 1, 1, 0, 0, 0, 22, 83, 12, 0),
(4, 1, 1, 1, 0, 0, 20, 81, 11, 0),
(12, 1, 1, 0, 1, 0, 26, 84, 12, 0),
(28, 1, 1, 0, 0, 0, 22, 82, 12, 0),
(24, 1, 1, 0, 0, 0, 18, 82, 11, 0),
(6, 1, 1, 0, 1, 0, 19, 78, 11, 0),
(28, 1, 1, 0, 0, 0, 21, 83, 12, 0),
(12, 1, 1, 1, 1, 0, 21, 81, 12, 0),
(34, 1, 1, 0, 0, 0, 24, 82, 12, 0),
(2, 1, 1, 0, 0, 0, 21, 84, 13, 0),
(48, 1, 1, 0, 0, 0, 21, 84, 14, 0),
(16, 1, 1, 0, 0, 0, 20, 80, 12, 0),
(26, 1, 1, 0, 0, 0, 26, 84, 12, 1),
(6, 1, 1, 0, 1, 0, 24, 84, 14, 0),
(2, 1, 3, 0, 0, 0, 22, 85, 12, 1),
(24, 1, 1, 0, 0, 0, 24, 85, 12, 0),
(6, 1, 1, 0, 0, 0, 23, 83, 12, 0),
(16, 1, 1, 0, 1, 0, 28, 85, 16, 0),
(16, 1, 1, 1, 0, 0, 20, 80, 12, 0),
(8, 1, 1, 0, 1, 0, 21, 84, 12, 0),
(28, 1, 1, 0, 0, 0, 23, 85, 14, 0),
(7, 1, 1, 0, 0, 0, 24, 83, 15, 0),
(5, 1, 1, 1, 1, 0, 19, 82, 8, 0),
(18, 1, 1, 0, 1, 0, 22, 80, 12, 0),
(4, 1, 1, 0, 1, 0, 19, 82, 12, 1),
(18, 1, 1, 0, 0, 0, 19, 83, 12, 0),
(6, 1, 2, 0, 0, 0, 19, 83, 12, 0),
(1, 1, 1, 1, 1, 0, 20, 84, 8, 1),
(10, 1, 1, 1, 1, 1, 17, 78, 8, 0),
(1, 1, 1, 0, 1, 0, 23, 81, 13, 0),
(1, 1, 1, 0, 0, 0, 17, 81, 11, 0),
(12, 1, 3, 0, 0, 0, 22, 81, 12, 0),
(12, 1, 3, 0, 0, 0, 23, 85, 14, 0),
(40, 1, 1, 0, 0, 0, 25, 83, 12, 0),
(12, 1, 1, 0, 1, 0, 22, 83, 12, 0),
(14, 1, 1, 0, 1, 0, 17, 79, 11, 0),
(52, 1, 1, 0, 1, 0, 21, 81, 12, 0),
(5, 1, 1, 0, 1, 0, 16, 78, 10, 0),
(3, 1, 1, 0, 1, 0, 19, 83, 12, 0),
(28, 1, 1, 0, 0, 0, 19, 80, 10, 0),
(16, 1, 1, 0, 1, 0, 20, 82, 12, 1),
(8, 1, 1, 0, 0, 0, 25, 86, 16, 0),
(4, 1, 1, 1, 1, 0, 20, 85, 10, 0),
(13, 1, 1, 0, 0, 0, 25, 84, 12, 0),
(20, 1, 1, 0, 1, 0, 18, 78, 10, 0),
(12, 1, 1, 0, 0, 0, 21, 79, 12, 0),
(4, 1, 1, 0, 0, 0, 22, 84, 12, 0),
(52, 1, 1, 0, 1, 0, 20, 80, 12, 1),
(23, 0, 1, 0, 0, 0, 27, 84, 12, 0),
(16, 1, 3, 1, 0, 0, 17, 79, 9, 1),
(4, 0, 1, 0, 1, 0, 23, 85, 13, 0),
(6, 1, 1, 0, 0, 1, 26, 85, 12, 0),
(4, 1, 1, 0, 0, 0, 22, 85, 12, 0),
(1, 1, 1, 0, 0, 0, 25, 84, 13, 0),
(16, 1, 1, 0, 0, 0, 18, 81, 12, 0),
(18, 1, 2, 0, 1, 0, 20, 81, 14, 0),
(3, 1, 1, 0, 0, 0, 23, 85, 12, 0),
(16, 1, 1, 0, 0, 0, 24, 85, 14, 1),
(96, 1, 1, 0, 0, 0, 21, 80, 13, 0),
(24, 1, 3, 0, 0, 0, 19, 83, 9, 0),
(48, 1, 2, 0, 1, 0, 18, 79, 12, 0),
(4, 1, 1, 0, 0, 0, 19, 83, 11, 0),
(2, 1, 3, 0, 0, 0, 18, 82, 12, 1),
(16, 1, 1, 0, 1, 1, 19, 79, 11, 0),
(28, 1, 1, 0, 0, 0, 19, 82, 12, 0),
(1, 1, 1, 0, 0, 0, 23, 85, 12, 0),
(52, 1, 1, 0, 0, 0, 23, 82, 14, 0),
(32, 1, 2, 1, 0, 0, 20, 82, 14, 0),
(20, 1, 3, 0, 0, 0, 20, 82, 12, 0),
(12, 1, 3, 0, 0, 0, 20, 85, 12, 0),
(8, 1, 3, 0, 0, 0, 17, 78, 11, 0),
(36, 1, 1, 0, 0, 0, 24, 81, 16, 0),
(8, 1, 1, 0, 0, 0, 24, 85, 12, 1),
(24, 1, 1, 0, 0, 0, 20, 83, 11, 1),
(36, 1, 1, 0, 0, 0, 24, 83, 16, 0),
(16, 1, 1, 0, 0, 0, 24, 84, 12, 0),
(3, 1, 1, 0, 1, 0, 22, 80, 12, 0),
(32, 1, 1, 0, 0, 0, 22, 80, 15, 0),
(16, 1, 1, 0, 0, 0, 22, 84, 12, 0),
(48, 1, 1, 0, 0, 0, 23, 85, 16, 0),
(1, 1, 1, 0, 0, 0, 21, 80, 12, 0),
(36, 1, 1, 0, 1, 0, 25, 84, 12, 1),
(30, 1, 1, 0, 0, 0, 24, 81, 12, 0),
(2, 1, 1, 0, 0, 0, 19, 78, 12, 0),
(52, 1, 1, 0, 0, 0, 20, 79, 13, 0),
(36, 1, 1, 1, 0, 1, 21, 83, 13, 0),
(28, 1, 1, 0, 0, 0, 23, 82, 12, 1),
(48, 1, 1, 0, 0, 0, 21, 80, 16, 0),
(16, 1, 3, 0, 1, 0, 19, 78, 7, 0),
(4, 1, 1, 0, 0, 0, 25, 83, 12, 0),
(1, 1, 1, 0, 0, 0, 25, 85, 12, 0),
(6, 1, 1, 0, 0, 0, 20, 82, 12, 1),
(12, 1, 1, 0, 0, 0, 20, 78, 12, 0),
(24, 1, 1, 0, 1, 0, 19, 80, 11, 0),
(40, 1, 1, 1, 0, 0, 22, 80, 10, 0),
(8, 1, 1, 1, 0, 0, 26, 85, 19, 0),
(4, 1, 1, 0, 1, 0, 22, 82, 12, 0),
(20, 1, 2, 0, 0, 0, 23, 84, 12, 0),
(6, 1, 2, 0, 0, 0, 19, 83, 12, 0),
(12, 1, 1, 0, 0, 0, 21, 82, 12, 0),
(8, 1, 1, 1, 0, 0, 23, 84, 16, 0),
(3, 0, 1, 0, 0, 0, 28, 85, 16, 0),
(12, 1, 1, 0, 0, 1, 25, 85, 16, 0),
(16, 1, 1, 0, 0, 0, 19, 80, 12, 0),
(20, 1, 1, 0, 1, 0, 19, 78, 8, 0),
(12, 1, 2, 0, 1, 0, 18, 79, 12, 0),
(16, 1, 3, 0, 0, 0, 20, 83, 12, 0),
(17, 1, 1, 0, 1, 0, 25, 83, 11, 0),
(60, 1, 3, 0, 0, 0, 19, 80, 11, 1),
(12, 1, 3, 1, 0, 0, 19, 81, 10, 1),
(4, 1, 1, 1, 0, 0, 17, 79, 10, 1),
(16, 1, 1, 0, 0, 0, 21, 81, 14, 0),
(3, 1, 1, 0, 1, 0, 21, 83, 12, 0),
(3, 1, 1, 0, 1, 0, 25, 85, 12, 0),
(16, 1, 1, 0, 0, 0, 19, 82, 12, 0),
(24, 1, 1, 1, 0, 1, 19, 78, 12, 0),
(21, 1, 1, 0, 1, 0, 19, 78, 12, 0),
(32, 1, 1, 0, 0, 0, 20, 81, 12, 0),
(8, 1, 1, 1, 1, 0, 26, 85, 11, 0),
(6, 1, 1, 0, 0, 0, 23, 84, 12, 0),
(16, 1, 1, 0, 1, 0, 17, 82, 11, 0),
(12, 1, 1, 0, 1, 0, 24, 81, 12, 0),
(16, 1, 1, 1, 0, 0, 18, 82, 12, 0),
(16, 1, 1, 1, 1, 0, 28, 85, 12, 0),
(8, 1, 1, 0, 0, 0, 26, 85, 16, 1),
(20, 1, 1, 0, 1, 0, 21, 85, 12, 0),
(40, 1, 1, 0, 0, 0, 22, 83, 12, 0),
(12, 1, 1, 0, 0, 0, 22, 83, 12, 0),
(36, 1, 1, 0, 0, 0, 25, 84, 16, 0),
(18, 1, 1, 0, 0, 0, 20, 82, 13, 0),
(48, 1, 1, 0, 0, 0, 20, 81, 12, 0),
(7, 1, 1, 1, 1, 0, 18, 81, 10, 1),
(1, 1, 1, 0, 0, 0, 25, 85, 12, 0),
(24, 1, 1, 0, 0, 0, 21, 85, 12, 0),
(12, 1, 3, 1, 0, 0, 17, 80, 9, 0),
(36, 1, 3, 1, 0, 0, 17, 82, 8, 0),
(3, 1, 3, 1, 0, 0, 18, 79, 10, 0),
(1, 1, 3, 0, 0, 0, 23, 81, 6, 0),
(5, 1, 3, 0, 0, 0, 20, 83, 10, 0),
(24, 1, 3, 1, 0, 0, 19, 83, 11, 1),
(21, 1, 1, 1, 0, 1, 19, 81, 12, 1),
(1, 1, 1, 0, 1, 0, 17, 78, 11, 0),
(8, 1, 1, 0, 0, 0, 21, 79, 12, 0),
(24, 1, 2, 0, 0, 0, 24, 84, 16, 0),
(68, 1, 1, 1, 0, 0, 20, 80, 12, 0),
(20, 1, 1, 0, 0, 0, 19, 80, 14, 0),
(2, 1, 1, 0, 1, 0, 16, 80, 9, 0),
(12, 1, 1, 0, 0, 0, 25, 84, 12, 0),
(40, 1, 1, 0, 0, 1, 24, 82, 14, 0),
(4, 1, 1, 0, 0, 0, 26, 84, 12, 0),
(1, 1, 1, 0, 0, 1, 25, 85, 12, 0),
(32, 1, 1, 0, 1, 0, 25, 84, 11, 1),
(1, 1, 3, 0, 0, 0, 19, 80, 10, 0),
(6, 1, 1, 0, 0, 0, 24, 81, 16, 0),
(13, 1, 1, 0, 0, 1, 27, 85, 16, 0),
(2, 1, 1, 1, 1, 0, 22, 85, 12, 0),
(50, 1, 2, 0, 0, 0, 19, 83, 11, 1),
(32, 1, 1, 0, 1, 0, 21, 78, 12, 0),
(12, 1, 1, 0, 1, 0, 16, 79, 9, 0),
(2, 1, 2, 0, 0, 0, 22, 79, 12, 0),
(8, 1, 2, 0, 0, 0, 23, 82, 12, 1),
(20, 1, 2, 0, 0, 0, 21, 83, 15, 0),
(12, 1, 1, 0, 0, 0, 26, 85, 12, 0),
(8, 1, 1, 0, 0, 0, 21, 85, 12, 0),
(1, 1, 1, 0, 0, 0, 24, 83, 13, 0),
(16, 1, 1, 0, 1, 0, 21, 83, 11, 0),
(24, 1, 1, 0, 0, 0, 17, 80, 11, 0),
(4, 1, 1, 0, 0, 0, 24, 85, 13, 0),
(22, 1, 2, 0, 0, 0, 25, 83, 12, 0),
(5, 1, 2, 0, 0, 0, 20, 82, 12, 0),
(36, 1, 2, 1, 0, 0, 23, 84, 12, 0),
(12, 1, 1, 0, 0, 0, 23, 80, 12, 0),
(52, 1, 1, 0, 0, 0, 19, 79, 13, 0),
(9, 1, 1, 0, 0, 0, 25, 85, 16, 0),
(6, 1, 1, 0, 0, 0, 22, 85, 14, 0),
(26, 1, 1, 0, 0, 0, 21, 81, 13, 0),
(8, 1, 1, 0, 0, 0, 26, 84, 16, 0),
(18, 0, 1, 1, 0, 0, 23, 84, 14, 0),
(2, 1, 3, 0, 0, 0, 27, 85, 19, 0),
(20, 1, 1, 0, 0, 0, 23, 82, 16, 0),
(16, 1, 1, 0, 0, 0, 25, 85, 14, 1),
(2, 0, 1, 0, 0, 0, 22, 86, 12, 0),
(48, 1, 1, 0, 0, 1, 20, 80, 12, 1),
(4, 1, 1, 0, 1, 0, 23, 83, 11, 0),
(8, 1, 1, 0, 0, 0, 22, 80, 12, 0),
(40, 1, 1, 0, 1, 0, 19, 81, 12, 1),
(14, 0, 1, 0, 0, 0, 27, 85, 19, 0),
(80, 1, 1, 0, 0, 0, 25, 83, 16, 0),
(13, 0, 1, 0, 0, 0, 24, 85, 16, 0),
(20, 1, 1, 0, 1, 0, 26, 84, 16, 1),
(44, 1, 1, 0, 0, 0, 18, 78, 12, 0),
(12, 1, 1, 0, 0, 0, 20, 84, 13, 0),
(20, 1, 1, 0, 0, 0, 22, 79, 14, 0),
(32, 1, 1, 0, 0, 0, 24, 84, 12, 1),
(2, 1, 1, 0, 0, 0, 23, 83, 12, 0),
(28, 1, 2, 0, 0, 0, 22, 85, 14, 1),
(6, 1, 2, 0, 0, 0, 21, 84, 12, 0),
(6, 1, 1, 0, 1, 0, 26, 83, 12, 0),
(38, 1, 1, 0, 0, 0, 22, 81, 12, 0),
(16, 1, 1, 0, 1, 0, 21, 80, 14, 0),
(1, 1, 1, 0, 0, 0, 26, 85, 12, 0),
(7, 1, 1, 0, 0, 0, 26, 84, 12, 0),
(10, 1, 1, 0, 1, 0, 23, 83, 12, 0),
(3, 1, 1, 0, 0, 0, 23, 82, 16, 0),
(36, 1, 1, 0, 0, 0, 21, 83, 12, 0),
(12, 1, 1, 0, 0, 0, 20, 85, 12, 0),
(8, 1, 2, 1, 0, 0, 19, 81, 11, 1),
(14, 1, 1, 0, 0, 0, 22, 81, 12, 0),
(4, 1, 1, 0, 1, 1, 20, 79, 11, 1),
(1, 1, 1, 0, 1, 0, 22, 83, 12, 0),
(2, 1, 1, 0, 0, 0, 24, 85, 13, 1),
(1, 1, 1, 0, 1, 1, 21, 83, 12, 0),
(4, 1, 1, 0, 0, 0, 24, 85, 12, 0),
(24, 1, 1, 1, 0, 0, 22, 79, 14, 0),
(12, 1, 1, 0, 0, 0, 23, 80, 15, 0),
(12, 1, 1, 0, 1, 0, 21, 79, 12, 0),
(20, 1, 1, 0, 0, 0, 26, 84, 12, 0),
(7, 1, 1, 0, 0, 0, 21, 84, 12, 0),
(12, 1, 1, 0, 1, 0, 17, 80, 10, 0),
(8, 1, 1, 0, 1, 0, 16, 78, 9, 0),
(6, 1, 1, 0, 1, 0, 19, 81, 11, 0),
(16, 1, 1, 0, 0, 1, 23, 84, 15, 0),
(48, 1, 1, 0, 0, 0, 20, 79, 13, 0),
(2, 1, 1, 0, 0, 0, 22, 85, 12, 0),
(1, 1, 1, 0, 0, 0, 22, 84, 12, 0),
(16, 1, 1, 1, 1, 0, 18, 80, 11, 1),
(8, 1, 1, 0, 0, 0, 21, 85, 14, 0),
(24, 1, 1, 0, 0, 0, 23, 83, 15, 0),
(4, 1, 1, 0, 0, 0, 20, 80, 12, 0),
(2, 1, 2, 0, 0, 0, 23, 83, 12, 0),
(5, 0, 1, 0, 0, 0, 27, 85, 16, 0),
(24, 1, 2, 1, 0, 0, 20, 79, 12, 0),
(1, 1, 2, 1, 0, 0, 18, 82, 11, 0),
(12, 1, 1, 0, 0, 0, 21, 78, 13, 0),
(10, 1, 1, 1, 0, 0, 19, 81, 12, 0),
(48, 1, 1, 0, 0, 0, 21, 81, 11, 0),
(24, 1, 1, 0, 0, 0, 21, 84, 13, 0),
(56, 1, 1, 0, 0, 0, 25, 83, 13, 0),
(52, 1, 1, 0, 0, 0, 21, 79, 12, 0),
(6, 1, 1, 0, 1, 0, 19, 79, 10, 0),
(32, 1, 1, 1, 0, 0, 17, 81, 10, 0),
(8, 1, 1, 0, 1, 0, 22, 84, 12, 1),
(6, 1, 1, 0, 0, 0, 17, 81, 10, 0),
(24, 1, 1, 1, 1, 0, 18, 81, 11, 0),
(2, 1, 3, 0, 0, 0, 19, 79, 12, 0),
(20, 1, 3, 0, 0, 0, 23, 84, 12, 0),
(40, 1, 2, 1, 1, 0, 23, 80, 12, 0),
(4, 1, 2, 0, 0, 0, 20, 82, 12, 1),
(3, 0, 1, 0, 1, 0, 24, 86, 11, 1),
(24, 1, 1, 0, 1, 0, 19, 78, 9, 1),
(8, 1, 1, 0, 0, 0, 20, 84, 12, 0),
(24, 1, 1, 0, 0, 0, 21, 82, 12, 0),
(36, 1, 1, 0, 0, 0, 19, 83, 12, 0),
(1, 1, 1, 0, 1, 0, 21, 80, 12, 1),
(8, 1, 1, 0, 0, 0, 19, 78, 12, 0),
(8, 1, 1, 0, 1, 0, 23, 81, 12, 0),
(40, 1, 1, 0, 0, 0, 20, 84, 12, 0),
(5, 1, 1, 0, 0, 0, 16, 79, 9, 1),
(24, 1, 1, 0, 0, 0, 23, 85, 16, 0),
(2, 1, 3, 0, 0, 0, 21, 83, 12, 0),
(6, 0, 1, 0, 0, 0, 26, 85, 12, 0),
(24, 1, 1, 0, 0, 0, 22, 80, 14, 0),
(42, 1, 1, 0, 1, 0, 21, 84, 11, 0),
(12, 1, 1, 0, 0, 0, 16, 79, 10, 0),
(48, 1, 2, 0, 0, 0, 19, 80, 12, 0),
(12, 1, 1, 0, 0, 1, 20, 83, 10, 0),
(7, 1, 3, 0, 0, 0, 23, 81, 12, 1),
(10, 1, 1, 0, 1, 0, 24, 84, 12, 0),
(1, 1, 1, 0, 0, 0, 21, 78, 12, 0),
(2, 1, 1, 0, 0, 0, 23, 85, 12, 1),
(3, 1, 1, 0, 0, 0, 21, 85, 12, 0),
(6, 1, 1, 0, 1, 0, 19, 80, 11, 0),
(40, 1, 1, 0, 1, 0, 20, 79, 12, 0),
(38, 1, 1, 0, 0, 0, 22, 80, 12, 0),
(1, 1, 1, 0, 0, 0, 18, 79, 11, 0),
(2, 1, 1, 0, 1, 0, 19, 81, 10, 1),
(8, 1, 1, 0, 1, 0, 21, 85, 11, 1),
(20, 1, 1, 0, 0, 0, 17, 79, 10, 0),
(2, 1, 1, 0, 0, 0, 20, 83, 11, 0),
(2, 1, 1, 0, 0, 0, 20, 84, 11, 0),
(3, 1, 1, 0, 0, 0, 26, 83, 12, 0),
(13, 0, 1, 1, 0, 0, 27, 85, 13, 1),
(20, 1, 1, 0, 0, 0, 21, 78, 12, 0),
(3, 1, 3, 0, 1, 0, 18, 82, 11, 0),
(10, 1, 1, 0, 0, 0, 23, 84, 13, 0),
(2, 1, 1, 0, 1, 0, 22, 85, 12, 1),
(24, 1, 1, 0, 0, 0, 19, 82, 12, 0),
(2, 1, 1, 1, 0, 0, 23, 83, 12, 1),
(10, 1, 1, 0, 1, 0, 21, 81, 12, 1),
(28, 1, 1, 0, 1, 0, 16, 78, 9, 1),
(7, 1, 1, 0, 0, 1, 21, 80, 12, 0),
(2, 1, 1, 0, 0, 0, 26, 83, 13, 0),
(1, 1, 1, 0, 0, 0, 25, 84, 12, 0),
(40, 1, 1, 0, 0, 0, 21, 84, 12, 0),
(104, 1, 1, 1, 1, 1, 20, 83, 12, 0),
(1, 1, 1, 0, 1, 0, 18, 78, 11, 1),
(16, 1, 1, 0, 0, 0, 18, 79, 10, 0),
(7, 0, 1, 0, 0, 0, 22, 85, 12, 1),
(40, 1, 1, 0, 0, 0, 23, 84, 12, 0),
(8, 1, 1, 1, 0, 0, 20, 79, 12, 0),
(2, 1, 1, 0, 1, 0, 18, 78, 12, 0),
(3, 1, 1, 0, 0, 0, 19, 79, 12, 0),
(1, 1, 1, 0, 0, 0, 26, 83, 12, 0),
(14, 1, 1, 0, 1, 0, 21, 79, 11, 0),
(2, 1, 1, 0, 0, 0, 20, 81, 12, 0),
(15, 1, 1, 0, 0, 0, 24, 83, 12, 1),
(6, 1, 1, 0, 0, 0, 19, 81, 12, 0),
(8, 1, 1, 0, 1, 0, 22, 85, 12, 0),
(1, 1, 1, 0, 0, 0, 21, 81, 13, 0),
(7, 1, 1, 0, 0, 0, 25, 84, 16, 0),
(24, 1, 1, 0, 0, 0, 24, 85, 14, 0),
(3, 1, 1, 0, 1, 0, 21, 82, 12, 0),
(12, 1, 1, 1, 0, 0, 19, 82, 12, 1),
(2, 1, 1, 0, 0, 0, 19, 79, 11, 0),
(10, 1, 1, 0, 1, 0, 23, 86, 12, 0),
(26, 1, 1, 0, 1, 0, 21, 85, 13, 0),
(7, 1, 1, 0, 0, 0, 22, 83, 12, 0),
(1, 1, 1, 1, 1, 0, 20, 81, 8, 0),
(2, 1, 3, 1, 0, 0, 19, 82, 11, 1),
(32, 1, 3, 0, 0, 1, 23, 85, 15, 0),
(20, 1, 1, 0, 0, 0, 25, 82, 16, 0),
(6, 1, 1, 0, 0, 1, 21, 80, 13, 0),
(1, 1, 1, 0, 1, 0, 20, 81, 9, 0),
(4, 1, 1, 0, 0, 0, 25, 84, 14, 0),
(10, 1, 1, 0, 0, 0, 21, 85, 15, 0),
(6, 1, 1, 0, 0, 0, 18, 79, 9, 0),
(24, 1, 1, 0, 0, 0, 21, 84, 13, 1),
(24, 1, 1, 0, 0, 0, 20, 82, 13, 0),
(24, 1, 1, 0, 0, 0, 24, 81, 16, 0),
(6, 1, 1, 0, 0, 0, 19, 81, 12, 0),
(7, 1, 1, 0, 0, 0, 26, 84, 12, 0),
(2, 1, 1, 0, 0, 0, 22, 82, 12, 0),
(32, 1, 1, 0, 0, 0, 21, 78, 14, 0),
(1, 1, 1, 1, 0, 0, 20, 83, 12, 1),
(6, 1, 1, 0, 1, 0, 22, 82, 12, 0),
(2, 1, 1, 0, 1, 0, 21, 79, 12, 0),
(8, 1, 1, 0, 0, 0, 22, 81, 12, 0),
(24, 1, 1, 0, 0, 0, 20, 83, 12, 1),
(12, 1, 1, 0, 0, 0, 25, 85, 12, 1),
(18, 0, 1, 0, 1, 0, 21, 84, 12, 0),
(10, 1, 1, 0, 1, 0, 20, 85, 12, 0),
(12, 1, 1, 0, 1, 0, 22, 85, 10, 0),
(3, 1, 1, 0, 1, 0, 20, 82, 12, 0),
(40, 1, 1, 0, 0, 0, 26, 83, 12, 0),
(72, 1, 1, 1, 0, 0, 23, 80, 15, 0),
(8, 1, 1, 0, 1, 0, 21, 79, 12, 0),
(60, 1, 1, 0, 0, 0, 23, 81, 13, 0),
(48, 1, 1, 1, 1, 0, 19, 83, 8, 1),
(2, 1, 1, 0, 0, 0, 15, 78, 10, 0),
(20, 1, 1, 0, 0, 0, 21, 84, 12, 0),
(60, 1, 1, 0, 0, 0, 19, 78, 12, 0),
(2, 1, 1, 0, 0, 0, 22, 83, 12, 0),
(2, 1, 1, 0, 0, 0, 23, 80, 12, 0),
(44, 1, 1, 1, 1, 0, 25, 82, 10, 1),
(12, 1, 1, 0, 1, 0, 22, 81, 12, 0),
(1, 1, 1, 0, 0, 0, 27, 85, 12, 0),
(6, 1, 1, 0, 0, 0, 26, 84, 16, 0),
(24, 1, 1, 0, 0, 0, 22, 80, 15, 0),
(8, 1, 1, 1, 1, 0, 22, 85, 12, 0),
(10, 1, 1, 0, 0, 0, 22, 85, 12, 1),
(8, 1, 1, 0, 0, 0, 22, 84, 12, 0),
(44, 1, 1, 0, 0, 0, 23, 84, 14, 0),
(8, 1, 1, 1, 1, 0, 21, 85, 12, 0),
(32, 1, 1, 0, 1, 0, 21, 79, 13, 0),
(15, 1, 1, 0, 0, 0, 25, 85, 12, 1),
(5, 1, 1, 0, 1, 0, 24, 84, 12, 0),
(12, 1, 1, 1, 1, 0, 20, 83, 12, 0),
(8, 1, 1, 0, 0, 0, 23, 85, 16, 0),
(40, 1, 1, 0, 1, 1, 24, 83, 13, 1),
(24, 1, 1, 0, 0, 0, 20, 82, 13, 0),
(1, 0, 1, 0, 0, 1, 26, 86, 16, 1),
(6, 1, 1, 1, 0, 0, 21, 85, 14, 0),
(6, 1, 1, 0, 0, 0, 20, 85, 13, 1),
(8, 1, 1, 0, 0, 0, 18, 79, 12, 0),
(16, 1, 1, 0, 0, 0, 24, 82, 15, 0),
(2, 1, 1, 0, 0, 0, 16, 79, 9, 0),
(32, 1, 1, 0, 0, 0, 20, 81, 12, 1),
(1, 1, 1, 0, 1, 0, 24, 85, 12, 0),
(2, 1, 1, 0, 0, 0, 20, 80, 13, 0),
(1, 1, 2, 1, 0, 0, 22, 85, 13, 0),
(6, 1, 1, 0, 1, 0, 17, 80, 9, 0),
(1, 1, 1, 0, 0, 0, 19, 79, 12, 0),
(1, 1, 1, 1, 0, 0, 19, 82, 9, 0),
(8, 1, 1, 0, 1, 0, 23, 84, 12, 0),
(1, 1, 1, 0, 1, 0, 23, 82, 13, 0),
(28, 1, 3, 0, 0, 0, 23, 81, 16, 0),
(1, 1, 1, 0, 1, 0, 24, 82, 12, 0),
(8, 1, 1, 0, 0, 0, 24, 84, 16, 0),
(28, 1, 1, 0, 0, 0, 22, 82, 14, 0),
(12, 1, 2, 0, 0, 0, 16, 80, 9, 0),
(4, 1, 2, 0, 0, 1, 17, 80, 10, 1),
(6, 1, 2, 0, 0, 0, 17, 82, 11, 0),
(52, 1, 1, 0, 0, 0, 20, 80, 13, 0),
(7, 0, 1, 0, 1, 0, 27, 85, 14, 0),
(52, 1, 1, 0, 1, 0, 24, 82, 12, 0),
(28, 1, 1, 0, 1, 0, 17, 81, 10, 1),
(2, 1, 1, 0, 0, 0, 19, 81, 12, 1),
(4, 1, 1, 0, 0, 0, 19, 82, 11, 0),
(52, 1, 1, 0, 0, 0, 26, 84, 14, 0),
(3, 1, 1, 0, 0, 0, 21, 81, 12, 0),
(10, 1, 1, 0, 1, 1, 22, 82, 12, 0),
(4, 1, 1, 1, 1, 1, 21, 81, 12, 1),
(16, 1, 1, 0, 1, 0, 16, 80, 10, 0),
(20, 1, 3, 0, 0, 0, 18, 78, 11, 0),
(9, 0, 3, 0, 0, 0, 27, 85, 13, 0),
(12, 1, 3, 0, 0, 0, 18, 79, 10, 0),
(6, 0, 1, 0, 0, 0, 21, 85, 12, 0),
(2, 1, 3, 0, 0, 0, 22, 84, 12, 0),
(8, 1, 1, 1, 1, 1, 20, 80, 12, 1),
(48, 1, 3, 0, 0, 0, 22, 82, 13, 0),
(12, 1, 3, 0, 0, 0, 23, 82, 12, 0),
(1, 1, 3, 0, 0, 0, 24, 82, 12, 0),
(8, 1, 3, 1, 0, 0, 25, 85, 15, 1),
(8, 1, 3, 0, 0, 0, 26, 83, 14, 0),
(4, 1, 3, 0, 1, 0, 21, 80, 13, 0),
(48, 1, 3, 1, 0, 0, 19, 82, 12, 0),
(3, 1, 3, 0, 1, 0, 20, 80, 12, 0),
(32, 1, 3, 0, 1, 0, 18, 79, 11, 1),
(28, 1, 3, 0, 0, 0, 19, 81, 12, 0),
(24, 1, 3, 0, 0, 0, 20, 84, 8, 0),
(8, 1, 3, 0, 0, 0, 21, 83, 12, 0),
(40, 1, 2, 0, 0, 0, 20, 81, 12, 0),
(4, 1, 2, 1, 0, 0, 19, 83, 12, 1),
(48, 1, 2, 0, 0, 0, 20, 84, 12, 0),
(15, 1, 2, 1, 0, 0, 17, 81, 10, 1),
(48, 1, 2, 0, 0, 0, 17, 80, 10, 0),
(1, 1, 1, 1, 0, 0, 20, 81, 12, 0),
(6, 1, 2, 1, 0, 0, 18, 82, 11, 0),
(8, 1, 2, 0, 0, 0, 21, 81, 13, 0),
(24, 1, 2, 0, 0, 0, 21, 78, 12, 0),
(56, 1, 2, 0, 0, 0, 23, 84, 12, 1),
(6, 0, 2, 0, 0, 0, 26, 85, 14, 0),
(1, 1, 2, 0, 0, 0, 20, 84, 13, 0),
(24, 1, 2, 0, 1, 0, 19, 78, 12, 0),
(4, 1, 2, 0, 0, 0, 24, 82, 12, 0),
(1, 1, 2, 0, 0, 0, 24, 82, 14, 0),
(4, 0, 2, 0, 0, 0, 26, 85, 13, 0),
(16, 1, 2, 1, 0, 0, 19, 81, 12, 1),
(4, 1, 2, 0, 0, 0, 25, 86, 14, 1),
(24, 1, 2, 0, 0, 0, 20, 84, 13, 0),
(3, 1, 2, 1, 0, 0, 19, 82, 11, 0),
(2, 1, 2, 0, 0, 0, 22, 84, 15, 0),
(28, 1, 2, 0, 0, 0, 20, 81, 13, 1),
(10, 1, 1, 0, 0, 0, 25, 83, 16, 0),
(24, 1, 1, 0, 0, 0, 18, 80, 11, 0),
(16, 1, 1, 0, 1, 1, 22, 81, 16, 0),
(36, 1, 1, 0, 0, 0, 24, 81, 17, 0),
(5, 1, 1, 0, 0, 0, 27, 84, 16, 0),
(6, 1, 1, 0, 0, 0, 26, 84, 17, 0),
(48, 1, 1, 0, 0, 0, 25, 83, 15, 0),
(48, 1, 1, 0, 1, 0, 21, 83, 12, 0),
(12, 1, 1, 0, 1, 0, 19, 79, 12, 0),
(4, 1, 3, 1, 0, 0, 18, 79, 11, 1),
(18, 1, 2, 0, 0, 0, 20, 80, 13, 0),
(1, 1, 2, 1, 1, 1, 18, 83, 12, 0),
(50, 1, 3, 1, 0, 0, 19, 82, 12, 1),
(20, 1, 1, 0, 0, 0, 23, 83, 8, 0),
(12, 1, 1, 0, 0, 0, 19, 83, 11, 1),
(12, 1, 2, 1, 0, 0, 23, 81, 12, 0),
(96, 1, 3, 1, 0, 0, 19, 79, 8, 0),
(12, 1, 3, 0, 0, 0, 23, 82, 13, 0),
(12, 1, 3, 0, 0, 0, 24, 82, 16, 0),
(2, 1, 1, 1, 1, 1, 22, 83, 10, 0),
(1, 1, 1, 0, 1, 0, 23, 81, 12, 0),
(1, 1, 2, 0, 1, 0, 21, 85, 12, 0),
(28, 1, 2, 0, 0, 0, 20, 79, 12, 1),
(4, 1, 1, 0, 1, 1, 23, 83, 12, 0),
(22, 1, 1, 1, 1, 0, 20, 81, 13, 0),
(2, 1, 1, 0, 0, 0, 17, 78, 10, 0),
(4, 1, 1, 0, 0, 0, 18, 80, 11, 0),
(1, 1, 1, 1, 1, 0, 21, 84, 12, 1),
(6, 0, 2, 0, 0, 0, 28, 85, 18, 0),
(1, 1, 2, 0, 0, 0, 21, 81, 14, 1),
(8, 1, 2, 0, 1, 0, 20, 83, 12, 1),
(48, 1, 2, 1, 0, 0, 21, 81, 11, 0),
(24, 1, 2, 1, 0, 0, 26, 84, 15, 0),
(8, 1, 2, 0, 0, 0, 22, 83, 12, 0),
(4, 1, 2, 1, 1, 0, 17, 78, 10, 0),
(20, 1, 2, 1, 1, 1, 18, 80, 11, 0),
(4, 1, 1, 1, 0, 0, 20, 80, 10, 0),
(11, 1, 1, 0, 0, 0, 26, 85, 16, 0),
(15, 1, 1, 1, 1, 0, 19, 78, 10, 1),
(16, 1, 1, 0, 0, 0, 23, 82, 14, 0),
(1, 1, 1, 0, 0, 0, 20, 79, 7, 1),
(24, 1, 2, 0, 0, 0, 25, 82, 12, 1),
(15, 1, 2, 0, 0, 0, 20, 83, 13, 0),
(6, 1, 2, 0, 0, 0, 22, 81, 13, 0),
(1, 1, 1, 0, 1, 0, 19, 82, 12, 0),
(32, 1, 1, 0, 1, 0, 24, 83, 12, 0),
(2, 1, 3, 0, 0, 0, 26, 85, 15, 0),
(3, 1, 2, 0, 0, 0, 19, 81, 12, 0),
(16, 1, 1, 0, 0, 0, 20, 83, 12, 0),
(6, 1, 2, 0, 0, 0, 19, 81, 12, 0),
(3, 1, 1, 0, 0, 0, 21, 79, 13, 0),
(42, 1, 1, 0, 0, 0, 23, 80, 15, 0),
(3, 1, 1, 0, 1, 0, 20, 83, 12, 0),
(32, 1, 1, 0, 0, 0, 25, 84, 16, 1),
(8, 1, 1, 1, 1, 0, 15, 79, 7, 1),
(4, 1, 2, 0, 0, 0, 23, 84, 13, 1),
(3, 1, 2, 1, 1, 0, 18, 83, 10, 0),
(7, 0, 1, 0, 0, 0, 26, 85, 16, 0),
(4, 1, 1, 0, 1, 0, 25, 83, 17, 0),
(6, 1, 1, 0, 1, 0, 26, 85, 16, 0),
(20, 1, 1, 0, 0, 0, 27, 85, 17, 0),
(18, 1, 3, 0, 1, 0, 21, 82, 12, 0),
(3, 1, 1, 0, 1, 0, 25, 83, 14, 0),
(16, 1, 2, 0, 0, 0, 24, 83, 16, 0),
(26, 1, 1, 0, 0, 0, 25, 84, 16, 0),
(1, 0, 1, 0, 0, 0, 28, 86, 16, 0),
(20, 1, 1, 0, 0, 0, 27, 85, 18, 0),
(12, 1, 1, 0, 1, 0, 15, 79, 8, 1),
(16, 1, 3, 1, 0, 0, 23, 83, 6, 0),
(32, 1, 1, 0, 0, 0, 22, 81, 12, 0),
(60, 1, 1, 0, 0, 0, 21, 79, 12, 0),
(24, 1, 1, 0, 0, 0, 24, 84, 16, 0),
(7, 1, 1, 1, 1, 0, 17, 80, 9, 1),
(1, 1, 2, 0, 0, 0, 23, 86, 13, 1),
(16, 1, 1, 1, 0, 0, 17, 78, 10, 0),
(48, 1, 1, 0, 0, 0, 20, 79, 12, 1),
(12, 1, 1, 0, 0, 0, 20, 79, 13, 0),
(4, 1, 3, 1, 0, 0, 25, 85, 13, 1),
(8, 1, 3, 1, 0, 0, 18, 82, 10, 0),
(4, 1, 3, 1, 0, 0, 18, 82, 11, 1),
(4, 1, 3, 0, 0, 0, 18, 80, 12, 0),
(18, 1, 3, 0, 1, 1, 20, 83, 10, 0),
(48, 1, 3, 0, 0, 0, 24, 82, 12, 0),
(24, 1, 2, 1, 0, 0, 21, 79, 14, 0),
(8, 1, 3, 0, 0, 0, 22, 82, 12, 0),
(52, 1, 3, 0, 0, 0, 19, 82, 12, 0),
(1, 1, 1, 0, 1, 0, 19, 83, 10, 0),
(12, 1, 2, 0, 0, 1, 23, 81, 16, 0),
(4, 1, 3, 0, 0, 0, 20, 79, 14, 1),
(12, 1, 3, 0, 0, 0, 19, 81, 12, 0),
(8, 1, 3, 0, 0, 0, 17, 81, 10, 1),
(2, 1, 1, 0, 0, 0, 21, 83, 14, 0),
(96, 1, 1, 1, 1, 0, 18, 78, 10, 1),
(8, 1, 3, 0, 0, 0, 19, 84, 12, 0),
(8, 1, 2, 0, 0, 1, 22, 83, 13, 0),
(40, 1, 1, 1, 0, 0, 22, 79, 12, 0),
(10, 1, 3, 0, 0, 0, 21, 82, 12, 0),
(12, 1, 3, 0, 0, 0, 19, 78, 12, 0),
(12, 1, 3, 0, 0, 0, 22, 83, 14, 0),
(9, 1, 3, 1, 0, 0, 27, 84, 18, 1),
(6, 1, 2, 0, 0, 0, 22, 82, 13, 0),
(16, 1, 1, 0, 1, 0, 28, 85, 12, 0),
(1, 1, 3, 0, 0, 0, 25, 83, 11, 0),
(6, 1, 3, 1, 0, 0, 21, 84, 12, 0),
(4, 1, 3, 0, 0, 0, 18, 81, 10, 1),
(2, 1, 3, 0, 0, 0, 19, 79, 11, 0),
(4, 1, 3, 0, 0, 0, 20, 80, 11, 0),
(8, 1, 1, 0, 1, 0, 27, 85, 11, 1),
(6, 1, 1, 0, 0, 0, 25, 82, 16, 0),
(40, 1, 1, 0, 0, 0, 23, 81, 11, 0),
(24, 1, 3, 0, 0, 0, 22, 81, 16, 0),
(1, 1, 3, 0, 0, 0, 24, 82, 13, 0),
(5, 1, 3, 0, 0, 0, 20, 79, 12, 0),
(2, 1, 3, 0, 0, 0, 22, 79, 13, 0),
(8, 1, 3, 0, 1, 0, 24, 81, 12, 0),
(4, 1, 3, 0, 0, 0, 21, 85, 13, 0),
(12, 1, 3, 0, 0, 0, 22, 79, 3, 0),
(12, 1, 3, 1, 0, 0, 18, 79, 6, 0),
(3, 1, 3, 1, 1, 0, 16, 78, 7, 0),
(48, 1, 1, 0, 0, 0, 23, 82, 14, 0),
(8, 1, 3, 1, 0, 0, 16, 79, 8, 0),
(14, 1, 1, 0, 1, 0, 23, 83, 11, 1),
(9, 1, 3, 1, 0, 0, 21, 85, 12, 0),
(4, 1, 1, 0, 1, 0, 24, 83, 12, 0),
(14, 1, 3, 0, 0, 0, 26, 85, 14, 0),
(3, 1, 3, 0, 0, 0, 19, 83, 10, 1),
(3, 1, 3, 0, 0, 0, 20, 78, 11, 0),
(6, 1, 3, 0, 0, 0, 23, 85, 12, 0),
(12, 1, 1, 0, 0, 1, 22, 83, 12, 0),
(8, 0, 1, 0, 1, 0, 25, 85, 12, 0),
(3, 1, 3, 0, 0, 0, 24, 81, 12, 1),
(3, 1, 3, 0, 0, 0, 19, 83, 12, 0),
(10, 1, 3, 0, 0, 0, 22, 80, 12, 0),
(3, 1, 3, 1, 1, 0, 19, 81, 11, 1),
(44, 1, 3, 0, 0, 0, 25, 83, 16, 0),
(2, 1, 1, 0, 0, 0, 22, 84, 13, 0),
(1, 1, 1, 1, 0, 0, 16, 80, 8, 0),
(1, 1, 2, 1, 0, 0, 23, 83, 12, 0),
(12, 1, 2, 0, 0, 0, 23, 82, 14, 0),
(4, 1, 2, 1, 0, 0, 19, 82, 12, 0),
(16, 1, 2, 0, 1, 0, 18, 79, 11, 0),
(5, 0, 1, 0, 0, 0, 22, 85, 12, 0),
(24, 1, 1, 0, 0, 0, 20, 81, 9, 0),
(6, 0, 1, 0, 0, 0, 28, 85, 14, 0),
(52, 1, 1, 1, 0, 0, 20, 78, 12, 0),
(2, 1, 3, 1, 0, 0, 15, 80, 8, 1),
(2, 1, 1, 0, 1, 1, 25, 84, 13, 0),
(10, 1, 1, 0, 0, 0, 24, 84, 12, 0),
(48, 1, 1, 0, 0, 0, 23, 81, 12, 1),
(52, 1, 1, 0, 0, 0, 20, 81, 12, 0),
(2, 1, 1, 0, 0, 0, 25, 85, 14, 1),
(24, 1, 1, 0, 1, 0, 19, 80, 9, 1),
(12, 1, 1, 1, 1, 0, 21, 82, 10, 0),
(8, 1, 2, 0, 0, 0, 16, 78, 11, 0),
(4, 1, 1, 1, 0, 1, 24, 84, 12, 0),
(4, 1, 1, 0, 0, 0, 19, 78, 12, 1),
(4, 1, 1, 1, 0, 0, 16, 78, 9, 0),
(8, 1, 1, 0, 0, 0, 20, 80, 12, 0),
(48, 1, 2, 0, 0, 1, 24, 81, 14, 1),
(24, 1, 1, 0, 0, 1, 27, 84, 18, 1),
(3, 1, 1, 0, 1, 0, 26, 84, 16, 1),
(20, 1, 1, 0, 1, 0, 25, 84, 15, 0),
(52, 1, 1, 0, 1, 0, 25, 82, 16, 0),
(60, 1, 1, 0, 1, 0, 24, 84, 14, 0),
(2, 1, 1, 0, 0, 0, 21, 79, 13, 0),
(2, 1, 3, 0, 0, 0, 22, 84, 14, 0),
(5, 1, 3, 1, 0, 0, 20, 81, 12, 0),
(12, 1, 3, 1, 0, 0, 17, 80, 8, 0),
(24, 1, 3, 0, 0, 0, 27, 84, 10, 0),
(12, 1, 3, 0, 0, 0, 19, 81, 12, 0),
(4, 1, 3, 0, 0, 0, 23, 85, 13, 0),
(2, 1, 3, 0, 0, 0, 16, 79, 10, 0),
(6, 1, 3, 0, 0, 0, 24, 85, 13, 0),
(1, 1, 1, 0, 0, 0, 22, 81, 15, 0),
(4, 1, 3, 0, 0, 0, 17, 80, 10, 0),
(2, 1, 1, 0, 1, 1, 19, 82, 8, 0),
(48, 1, 2, 0, 0, 0, 21, 83, 12, 1),
(8, 1, 2, 1, 0, 0, 20, 79, 9, 1),
(24, 1, 1, 0, 0, 0, 20, 81, 12, 0),
(12, 1, 2, 0, 0, 0, 26, 85, 14, 0),
(2, 1, 1, 1, 1, 0, 22, 82, 12, 1),
(3, 1, 1, 0, 1, 0, 21, 84, 9, 0),
(96, 1, 1, 1, 0, 0, 19, 80, 8, 0),
(3, 1, 1, 1, 0, 0, 19, 83, 10, 0),
(16, 1, 2, 0, 1, 0, 23, 82, 16, 0),
(6, 1, 1, 0, 1, 1, 21, 84, 12, 0),
(4, 1, 1, 1, 0, 0, 19, 79, 10, 0),
(56, 1, 2, 1, 0, 0, 17, 80, 11, 0),
(4, 1, 2, 0, 0, 0, 20, 84, 12, 0),
(6, 1, 1, 1, 0, 0, 19, 81, 10, 1),
(2, 1, 2, 1, 0, 0, 21, 81, 14, 0),
(8, 1, 1, 0, 0, 0, 21, 84, 14, 0),
(14, 1, 2, 0, 0, 0, 22, 82, 13, 0),
(8, 1, 3, 0, 0, 0, 19, 83, 10, 0),
(1, 1, 3, 0, 0, 0, 24, 85, 9, 0),
(2, 1, 3, 0, 0, 0, 19, 83, 11, 1),
(16, 0, 1, 0, 0, 1, 27, 84, 16, 1),
(8, 1, 1, 0, 0, 0, 26, 84, 16, 0),
(48, 1, 1, 1, 1, 1, 18, 80, 8, 0),
(52, 1, 1, 1, 1, 0, 17, 81, 7, 0),
(25, 1, 1, 1, 1, 0, 21, 82, 11, 0),
(20, 1, 1, 1, 1, 0, 22, 83, 12, 0),
(12, 1, 1, 1, 1, 0, 19, 81, 11, 1),
(8, 1, 3, 0, 0, 0, 23, 83, 14, 0),
(5, 1, 3, 1, 1, 1, 20, 81, 10, 1),
(4, 1, 1, 0, 1, 1, 25, 84, 16, 0),
(16, 1, 1, 0, 0, 0, 25, 84, 16, 0),
(1, 1, 1, 0, 0, 0, 22, 81, 15, 0),
(5, 1, 1, 0, 1, 0, 26, 85, 16, 0),
(3, 1, 1, 1, 1, 0, 19, 83, 11, 0),
(46, 1, 1, 1, 1, 0, 20, 78, 12, 0),
(8, 1, 3, 1, 0, 0, 18, 78, 12, 0),
(40, 1, 1, 0, 0, 0, 18, 80, 10, 0),
(1, 1, 3, 1, 1, 1, 22, 82, 12, 0),
(4, 1, 2, 0, 0, 1, 24, 86, 13, 0),
(3, 1, 1, 0, 1, 0, 22, 81, 12, 0),
(2, 1, 3, 0, 0, 1, 25, 84, 12, 0),
(2, 1, 1, 0, 0, 0, 27, 85, 15, 0),
(3, 1, 1, 0, 0, 0, 22, 80, 16, 0),
(46, 1, 1, 0, 0, 0, 25, 83, 14, 0),
(2, 1, 3, 0, 0, 0, 19, 81, 12, 1),
(36, 1, 1, 0, 0, 0, 21, 82, 12, 0),
(6, 0, 3, 0, 0, 0, 22, 85, 12, 0),
(8, 1, 1, 0, 0, 0, 18, 81, 11, 0),
(16, 1, 1, 0, 0, 0, 19, 79, 12, 0),
(16, 1, 1, 1, 1, 0, 19, 78, 9, 0),
(12, 1, 3, 1, 0, 0, 23, 80, 9, 1),
(6, 1, 2, 1, 0, 0, 20, 83, 13, 0),
(5, 0, 3, 0, 0, 0, 21, 85, 14, 0),
(16, 1, 3, 1, 1, 0, 19, 84, 11, 0),
(12, 1, 3, 0, 0, 0, 19, 81, 12, 0),
(1, 1, 3, 0, 0, 0, 26, 85, 11, 0),
(4, 1, 1, 1, 1, 0, 21, 78, 12, 0),
(24, 1, 1, 1, 0, 0, 19, 78, 11, 0),
(1, 1, 1, 0, 0, 0, 22, 80, 12, 0),
(10, 1, 3, 0, 1, 1, 22, 81, 13, 0),
(10, 1, 1, 0, 0, 0, 25, 85, 13, 0),
(2, 1, 3, 1, 0, 0, 20, 84, 12, 1),
(2, 1, 3, 0, 1, 1, 24, 84, 12, 0),
(64, 1, 3, 1, 0, 0, 21, 80, 11, 0),
(8, 1, 2, 1, 0, 0, 21, 84, 12, 0),
(48, 1, 2, 1, 1, 0, 21, 81, 12, 0),
(28, 1, 3, 0, 0, 0, 21, 80, 11, 1),
(24, 1, 3, 0, 0, 0, 18, 79, 10, 0),
(18, 1, 2, 1, 0, 0, 23, 82, 11, 0),
(6, 1, 3, 0, 0, 0, 21, 85, 12, 0),
(3, 1, 2, 1, 1, 0, 19, 82, 11, 1),
(56, 1, 3, 0, 0, 0, 26, 84, 15, 1),
(18, 1, 1, 0, 0, 0, 24, 83, 13, 0),
(2, 1, 3, 0, 0, 0, 21, 81, 9, 0),
(6, 1, 3, 0, 0, 0, 20, 79, 6, 1),
(12, 1, 3, 0, 0, 0, 24, 82, 14, 0),
(32, 1, 1, 0, 1, 0, 19, 82, 9, 0),
(3, 1, 3, 0, 0, 0, 21, 83, 12, 1),
(72, 1, 1, 0, 0, 0, 19, 83, 11, 0),
(5, 1, 1, 1, 1, 0, 19, 84, 7, 0),
(12, 1, 2, 0, 0, 0, 20, 80, 13, 1),
(8, 1, 3, 0, 0, 0, 23, 82, 12, 0),
(8, 1, 1, 0, 1, 0, 23, 81, 13, 0),
(16, 1, 1, 0, 1, 0, 21, 78, 14, 0),
(2, 0, 1, 0, 0, 0, 26, 85, 13, 0),
(3, 0, 1, 0, 0, 0, 27, 85, 16, 0),
(12, 1, 2, 1, 0, 0, 17, 79, 10, 0),
(40, 1, 2, 1, 0, 0, 18, 81, 12, 0),
(96, 1, 1, 0, 0, 0, 25, 83, 14, 0),
(4, 1, 1, 0, 1, 1, 22, 81, 12, 0),
(3, 1, 1, 0, 1, 0, 20, 84, 12, 1),
(12, 1, 1, 0, 0, 0, 25, 83, 16, 0),
(28, 1, 1, 0, 1, 0, 25, 83, 16, 0),
(7, 1, 1, 1, 1, 1, 22, 84, 11, 0),
(1, 1, 2, 1, 0, 0, 22, 85, 15, 0),
(1, 1, 1, 0, 1, 0, 23, 83, 14, 0),
(4, 1, 3, 0, 0, 0, 26, 83, 9, 0),
(3, 1, 3, 0, 0, 0, 25, 84, 14, 1),
(12, 1, 3, 1, 0, 0, 24, 84, 12, 0),
(1, 1, 2, 0, 0, 0, 19, 83, 12, 0),
(14, 1, 1, 0, 0, 1, 26, 84, 15, 0),
(12, 1, 1, 0, 0, 0, 20, 79, 12, 0),
(8, 1, 2, 1, 0, 0, 19, 81, 12, 0),
(12, 1, 3, 0, 0, 0, 25, 82, 12, 0),
(1, 1, 3, 0, 0, 0, 22, 85, 11, 0),
(8, 1, 1, 1, 0, 0, 17, 81, 10, 0),
(8, 1, 1, 1, 1, 0, 24, 85, 9, 1),
(8, 1, 1, 1, 1, 0, 15, 80, 9, 0),
(7, 1, 3, 0, 1, 0, 23, 84, 13, 0),
(12, 1, 3, 0, 0, 0, 21, 82, 12, 0),
(6, 1, 3, 0, 0, 0, 24, 84, 12, 0),
(2, 1, 2, 0, 0, 0, 23, 85, 14, 0),
(16, 1, 3, 1, 0, 0, 20, 81, 11, 1),
(24, 1, 1, 0, 0, 0, 18, 80, 9, 1),
(24, 1, 3, 0, 0, 0, 20, 79, 10, 0),
(12, 1, 3, 0, 1, 1, 24, 83, 9, 0),
(72, 1, 1, 1, 0, 0, 16, 81, 9, 1),
(6, 1, 1, 0, 1, 0, 23, 83, 12, 0),
(1, 1, 2, 0, 0, 0, 25, 82, 13, 0),
(48, 1, 1, 0, 0, 0, 20, 80, 12, 0),
(3, 1, 1, 0, 1, 0, 22, 83, 12, 0),
(24, 1, 1, 0, 0, 0, 23, 81, 12, 0),
(12, 1, 1, 0, 0, 0, 23, 82, 12, 0),
(26, 1, 1, 0, 0, 0, 22, 80, 12, 0),
(3, 1, 1, 0, 1, 0, 23, 83, 12, 0),
(24, 1, 1, 0, 0, 0, 20, 80, 12, 0),
(1, 1, 1, 0, 0, 1, 20, 78, 12, 0),
(5, 1, 1, 0, 1, 0, 24, 83, 12, 0),
(2, 1, 1, 0, 1, 0, 21, 79, 12, 0),
(12, 1, 1, 0, 0, 0, 19, 80, 12, 0),
(48, 1, 1, 0, 0, 0, 23, 81, 12, 0),
(3, 1, 2, 0, 1, 1, 23, 81, 13, 0),
(4, 1, 1, 0, 1, 0, 22, 81, 12, 0),
(6, 1, 1, 0, 1, 0, 22, 81, 12, 0),
(4, 1, 1, 0, 1, 1, 24, 82, 13, 0),
(52, 1, 1, 1, 0, 0, 22, 81, 12, 0),
(8, 1, 2, 1, 0, 0, 23, 81, 12, 0),
(20, 1, 1, 1, 0, 0, 21, 81, 12, 0),
(20, 1, 1, 0, 0, 0, 23, 82, 12, 0),
(28, 1, 1, 0, 0, 0, 22, 83, 12, 0),
(4, 1, 1, 0, 0, 0, 24, 82, 12, 1),
(16, 1, 1, 1, 0, 0, 19, 78, 12, 0),
(8, 1, 2, 0, 0, 0, 19, 79, 12, 0),
(5, 1, 1, 0, 0, 0, 21, 80, 12, 0),
(11, 1, 1, 0, 1, 0, 24, 83, 12, 0),
(4, 1, 2, 0, 0, 0, 24, 83, 12, 0),
(3, 1, 1, 0, 0, 0, 22, 81, 12, 0),
(2, 1, 1, 0, 0, 0, 23, 81, 12, 0),
(2, 1, 1, 0, 0, 0, 21, 80, 12, 0),
(6, 1, 1, 0, 0, 0, 21, 80, 13, 0),
(8, 1, 1, 1, 1, 0, 21, 79, 12, 0),
(1, 1, 1, 0, 1, 1, 18, 79, 12, 1),
(48, 1, 1, 0, 1, 0, 19, 79, 12, 0),
(32, 1, 1, 0, 0, 0, 20, 79, 13, 0),
(32, 1, 1, 0, 0, 1, 20, 79, 12, 0),
(6, 1, 1, 0, 1, 0, 22, 81, 12, 0),
(6, 1, 1, 0, 0, 0, 25, 82, 12, 0),
(24, 1, 1, 0, 0, 1, 20, 79, 12, 0),
(4, 1, 3, 0, 0, 0, 20, 79, 14, 0),
(16, 1, 1, 0, 0, 0, 22, 82, 12, 0),
(12, 1, 1, 0, 0, 0, 21, 80, 12, 0),
(2, 1, 1, 0, 1, 0, 24, 83, 12, 0),
(1, 1, 1, 0, 0, 0, 21, 81, 12, 0),
(3, 1, 1, 0, 1, 0, 22, 82, 12, 0),
(7, 1, 1, 1, 1, 1, 25, 83, 12, 0),
(56, 1, 1, 0, 0, 0, 24, 81, 12, 0),
(1, 1, 1, 0, 0, 0, 22, 80, 12, 0),
(24, 1, 1, 0, 0, 0, 21, 81, 12, 0),
(16, 1, 1, 0, 1, 0, 19, 78, 12, 0),
(20, 1, 1, 0, 1, 0, 22, 82, 12, 0),
(1, 1, 1, 0, 0, 0, 22, 81, 13, 0),
(120, 1, 3, 0, 0, 0, 22, 80, 12, 0),
(44, 1, 1, 0, 0, 0, 22, 81, 14, 0),
(3, 1, 1, 0, 0, 0, 25, 83, 12, 0),
(32, 1, 1, 0, 0, 0, 20, 80, 12, 0),
(6, 1, 1, 0, 0, 0, 22, 82, 12, 0),
(52, 1, 1, 0, 0, 0, 22, 79, 12, 0),
(24, 1, 2, 0, 0, 1, 23, 81, 12, 0),
(72, 1, 1, 0, 0, 0, 21, 81, 12, 0),
(24, 1, 2, 0, 0, 0, 21, 81, 12, 0),
(3, 1, 1, 0, 1, 0, 22, 82, 10, 0),
(6, 1, 1, 0, 1, 0, 21, 79, 12, 0),
(24, 1, 1, 0, 1, 0, 24, 82, 12, 0),
(16, 1, 2, 0, 0, 0, 23, 83, 12, 0),
(5, 1, 1, 0, 1, 0, 25, 83, 12, 0),
(48, 1, 1, 0, 0, 0, 20, 79, 12, 0),
(10, 1, 1, 0, 1, 0, 23, 82, 12, 0),
(48, 1, 1, 0, 0, 0, 23, 82, 13, 0),
(2, 1, 1, 1, 1, 0, 24, 82, 12, 0),
(6, 1, 1, 0, 0, 0, 24, 82, 14, 0),
(36, 1, 2, 0, 0, 0, 22, 82, 14, 0),
(12, 1, 1, 0, 0, 0, 22, 83, 12, 0),
(2, 1, 1, 0, 1, 0, 21, 85, 12, 0),
(4, 1, 1, 0, 1, 0, 18, 80, 12, 1),
(24, 1, 1, 0, 0, 0, 23, 82, 13, 0),
(1, 1, 1, 0, 0, 0, 23, 83, 11, 0),
(20, 1, 1, 0, 0, 0, 21, 81, 13, 0),
(76, 1, 1, 0, 0, 0, 21, 83, 14, 0),
(8, 1, 1, 0, 0, 0, 20, 79, 12, 0),
(4, 1, 3, 0, 0, 0, 24, 81, 11, 0),
(36, 1, 1, 0, 1, 0, 20, 80, 12, 0),
(6, 1, 1, 0, 0, 0, 21, 82, 12, 0),
(32, 1, 1, 0, 0, 0, 19, 83, 14, 0),
(4, 1, 1, 0, 0, 0, 20, 81, 12, 0),
(4, 1, 1, 0, 1, 0, 21, 79, 12, 0),
(40, 1, 1, 1, 1, 0, 22, 85, 12, 0),
(3, 1, 3, 0, 0, 0, 20, 81, 9, 0),
(8, 1, 1, 1, 0, 1, 23, 83, 10, 1),
(32, 1, 1, 0, 0, 0, 18, 80, 11, 0),
(10, 0, 1, 0, 0, 0, 28, 85, 15, 1),
(1, 1, 1, 0, 0, 0, 20, 84, 12, 1),
(1, 1, 1, 0, 1, 0, 20, 80, 12, 0),
(5, 1, 1, 1, 1, 1, 21, 78, 15, 0),
(24, 1, 1, 0, 1, 0, 18, 81, 10, 0),
(48, 1, 1, 0, 0, 0, 23, 83, 12, 0),
(12, 1, 1, 0, 1, 0, 24, 83, 12, 0),
(20, 1, 1, 0, 0, 0, 27, 85, 17, 0),
(4, 1, 1, 0, 1, 0, 21, 84, 12, 0),
(16, 1, 1, 1, 1, 0, 21, 82, 12, 0),
(32, 1, 3, 1, 0, 0, 18, 82, 10, 1),
(24, 1, 1, 0, 0, 0, 26, 85, 14, 1),
(13, 1, 1, 0, 0, 0, 21, 82, 12, 0),
(1, 1, 1, 1, 0, 0, 16, 81, 9, 1),
(16, 1, 1, 0, 1, 0, 20, 81, 12, 0),
(44, 1, 1, 0, 0, 0, 21, 80, 12, 0),
(32, 1, 1, 0, 1, 1, 22, 83, 12, 0),
(1, 1, 1, 0, 1, 1, 20, 83, 12, 0),
(8, 1, 1, 0, 1, 0, 22, 79, 12, 0),
(6, 1, 1, 0, 0, 0, 22, 82, 13, 1),
(6, 1, 1, 1, 1, 0, 21, 81, 12, 0),
(32, 1, 1, 0, 0, 1, 25, 84, 18, 0),
(28, 1, 1, 0, 1, 1, 19, 80, 12, 0),
(7, 1, 1, 0, 0, 1, 24, 83, 14, 0),
(12, 1, 1, 1, 1, 1, 20, 80, 10, 1),
(4, 1, 1, 1, 0, 0, 18, 81, 11, 0),
(32, 1, 1, 0, 0, 0, 23, 81, 16, 0),
(48, 1, 1, 1, 0, 0, 20, 84, 11, 1),
(32, 1, 1, 1, 0, 0, 17, 78, 12, 1),
(3, 1, 2, 0, 1, 0, 19, 79, 11, 1),
(4, 1, 2, 0, 0, 0, 21, 78, 12, 0),
(4, 1, 1, 0, 1, 0, 23, 82, 12, 0),
(2, 1, 1, 0, 0, 0, 24, 82, 13, 0),
(3, 1, 1, 0, 0, 1, 21, 80, 12, 0),
(1, 1, 1, 0, 1, 1, 20, 81, 12, 0),
(32, 1, 1, 0, 1, 0, 24, 81, 12, 0),
(24, 1, 1, 0, 0, 0, 20, 80, 12, 0),
(4, 1, 1, 0, 0, 0, 20, 79, 12, 0),
(5, 1, 1, 0, 0, 1, 22, 81, 12, 0),
(24, 1, 2, 0, 0, 0, 21, 80, 12, 0),
(6, 1, 1, 0, 1, 0, 20, 80, 12, 0)) val data = dataList.toDF("label", "censor","race","poverty","smoke","alcohol","agemth","ybirth","yschool","pc3mth").orderBy("label")
建模并调优
val colArray = Array("race", "poverty", "smoke", "alcohol", "agemth", "ybirth", "yschool", "pc3mth") val assembler = new VectorAssembler().setInputCols(colArray).setOutputCol("features") val vecDF: DataFrame = assembler.transform(data) val Array(trainingDF, testDF) = vecDF.randomSplit(Array(0.7, 0.3)) //###########################
// 建立生存回归模型
val AFT = new AFTSurvivalRegression().setFeaturesCol("features").setLabelCol("label").setCensorCol("censor").fit(trainingDF) // 设置管道
val pipeline = new Pipeline().setStages(Array(AFT)) // 设置参数网格
val paramGrid = new ParamGridBuilder().addGrid(AFT.maxIter, Array(100, 500, 1000)).addGrid(AFT.tol, Array(1E-2, 1E-6)).build() // 选择(prediction, true label),计算测试误差。
// 注意RegEvaluator.isLargerBetter,评估的度量值是大的好,还是小的好,系统会自动识别
val RegEvaluator = new RegressionEvaluator().setLabelCol(AFT.getLabelCol).setPredictionCol(AFT.getPredictionCol).setMetricName("rmse") // 设置交叉验证
val cv = new CrossValidator().setEstimator(pipeline).setEvaluator(RegEvaluator).setEstimatorParamMaps(paramGrid).setNumFolds(3) // 执行交叉验证,并选择出最好的参数集
val cvModel = cv.fit(trainingDF) // 查看全部参数
cvModel.extractParamMap()
// cvModel.avgMetrics.length=cvModel.getEstimatorParamMaps.length
// cvModel.avgMetrics与cvModel.getEstimatorParamMaps中的元素一一对应
cvModel.avgMetrics.length
cvModel.avgMetrics // 参数对应的平均度量 cvModel.getEstimatorParamMaps.length
cvModel.getEstimatorParamMaps // 参数组合的集合 cvModel.getEvaluator.extractParamMap() // 评估的参数 cvModel.getEvaluator.isLargerBetter // 评估的度量值是大的好,还是小的好
cvModel.getNumFolds // 交叉验证的折数 //################################
// 测试模型
val predictDF: DataFrame = cvModel.transform(testDF).selectExpr(
//"race","poverty","smoke","alcohol","agemth","ybirth","yschool","pc3mth", "features",
"label", "censor",
"round(prediction,2) as prediction").orderBy("label")
predictDF.show spark.stop()
代码执行结果
// 查看全部参数
cvModel.extractParamMap()
res2: org.apache.spark.ml.param.ParamMap =
{
cv_baf8c9af33b7-estimator: pipeline_20ba567066f7,
cv_baf8c9af33b7-estimatorParamMaps: [Lorg.apache.spark.ml.param.ParamMap;@412a07c8,
cv_baf8c9af33b7-evaluator: regEval_59075079f1c9,
cv_baf8c9af33b7-numFolds: 3,
cv_baf8c9af33b7-seed: -1191137437
} // cvModel.avgMetrics.length=cvModel.getEstimatorParamMaps.length
// cvModel.avgMetrics与cvModel.getEstimatorParamMaps中的元素一一对应
cvModel.avgMetrics.length
res3: Int = 6 cvModel.avgMetrics // 参数对应的平均度量
res4: Array[Double] = Array(18.53, 17.53, 19.53, 17.63, 18.53, 18.93) cvModel.getEstimatorParamMaps.length
res5: Int = 6 cvModel.getEstimatorParamMaps // 参数组合的集合
res6: Array[org.apache.spark.ml.param.ParamMap] =
Array({
aftSurvReg_a7e5bc450599-maxIter: 100,
aftSurvReg_a7e5bc450599-tol: 0.01
}, {
aftSurvReg_a7e5bc450599-maxIter: 100,
aftSurvReg_a7e5bc450599-tol: 1.0E-6
}, {
aftSurvReg_a7e5bc450599-maxIter: 500,
aftSurvReg_a7e5bc450599-tol: 0.01
}, {
aftSurvReg_a7e5bc450599-maxIter: 500,
aftSurvReg_a7e5bc450599-tol: 1.0E-6
}, {
aftSurvReg_a7e5bc450599-maxIter: 1000,
aftSurvReg_a7e5bc450599-tol: 0.01
}, {
aftSurvReg_a7e5bc450599-maxIter: 1000,
aftSurvReg_a7e5bc450599-tol: 1.0E-6
}) cvModel.getEvaluator.extractParamMap() // 评估的参数
res7: org.apache.spark.ml.param.ParamMap =
{
regEval_59075079f1c9-labelCol: label,
regEval_59075079f1c9-metricName: rmse,
regEval_59075079f1c9-predictionCol: prediction
} cvModel.getEvaluator.isLargerBetter // 评估的度量值是大的好,还是小的好
res8: Boolean = false // 这里显示“评估的度量值”是小的好 cvModel.getNumFolds // 交叉验证的折数
res9: Int = 3 //################################
// 测试模型
val predictDF: DataFrame = cvModel.transform(testDF).selectExpr(
| //"race","poverty","smoke","alcohol","agemth","ybirth","yschool","pc3mth", "features",
| "label", "censor",
| "round(prediction,2) as prediction").orderBy("label")
predictDF: org.apache.spark.sql.DataFrame = [label: double, censor: double ... 1 more field] predictDF.show
+-----+------+----------+
|label|censor|prediction|
+-----+------+----------+
| 1.0| 1.0| 15.4|
| 1.0| 1.0| 20.02|
| 1.0| 1.0| 18.73|
| 1.0| 1.0| 21.58|
| 1.0| 1.0| 21.8|
| 1.0| 1.0| 21.8|
| 1.0| 1.0| 14.37|
| 1.0| 1.0| 13.5|
| 1.0| 1.0| 15.82|
| 1.0| 1.0| 19.51|
| 1.0| 1.0| 13.17|
| 1.0| 1.0| 11.9|
| 1.0| 1.0| 17.26|
| 1.0| 1.0| 13.57|
| 1.0| 1.0| 11.57|
| 1.0| 1.0| 13.55|
| 1.0| 1.0| 10.95|
| 1.0| 1.0| 14.92|
| 1.0| 1.0| 12.25|
| 1.0| 1.0| 19.62|
+-----+------+----------+
only showing top 20 rows
Spark2 生存分析Survival regression的更多相关文章
- 生存分析(survival analysis)
一.生存分析(survival analysis)的定义 生存分析:对一个或多个非负随机变量进行统计推断,研究生存现象和响应时间数据及其统计规律的一门学科. 生存分析:既考虑结果又考虑生存时间的一种统 ...
- 生存模型(Survival Model)介绍
https://www.cnblogs.com/BinbinChen/p/3416972.html 生存分析,维基上的解释是: 生存分析(Survival analysis)是指根据试验或调查得到的数 ...
- BMDP为常规的统计分析提供了大量的完备的函数系统,如:方差分析(ANOVA)、回归分析(Regression)、非参数分析(Nonparametric Analysis)、时间序列(Times Series)等等。此外,BMDP特别擅于进行出色的生存分析(Survival Analysis )。许多年来,一大批世界范围内顶级的统计学家都曾今参与过BMDP的开发工作。这不仅使得BMDP的权威性得到
BMDP是Bio Medical Data Processing的缩写,是世界级的统计工具软件,至今已经有40多年的历史.目前在国际上与SAS.SPSS被并称为三大统计软件包.BMDP是一个大 ...
- survival analysis 生存分析与R 语言示例 入门篇
原创博客,未经允许,不得转载. 生存分析,survival analysis,顾名思义是用来研究个体的存活概率与时间的关系.例如研究病人感染了病毒后,多长时间会死亡:工作的机器多长时间会发生崩溃等. ...
- WOE:信用评分卡模型中的变量离散化方法(生存分析)
WOE:信用评分卡模型中的变量离散化方法 2016-03-21 生存分析 在做回归模型时,因临床需要常常需要对连续性的变量离散化,诸如年龄,分为老.中.青三组,一般的做法是ROC或者X-tile等等. ...
- R数据分析:生存分析与有竞争事件的生存分析的做法和解释
今天被粉丝发的文章给难住了,又偷偷去学习了一下竞争风险模型,想起之前写的关于竞争风险模型的做法,真的都是皮毛哟,大家见笑了.想着就顺便把所有的生存分析的知识和R语言的做法和论文报告方法都给大家梳理一遍 ...
- Cox回归模型【生存分析】
参考:<复杂数据统计方法--基于R的应用> 吴喜之 在生存分析中,研究的主要对象是寿命超过某一时间的概率.还可以描述其他一些事情发生的概率,例如产品的失效.出狱犯人第一次犯罪.失业人员第一 ...
- 生存分析与R--转载
生存分析与R 生存分析是将事件的结果和出现这一结果所经历的时间结合起来分析的一类统计分析方法.不仅考虑事件是否出现,而且还考虑事件出现的时间长短,因此这类方法也被称为事件时间分析(time-to-ev ...
- R语言学习 - 非参数法生存分析--转载
生存分析指根据试验或调查得到的数据对生物或人的生存时间进行分析和推断,研究生存时间和结局与众多影响因素间关系及其程度大小的方法,也称生存率分析或存活率分析.常用于肿瘤等疾病的标志物筛选.疗效及预后的考 ...
随机推荐
- Linux Shell 通配符、元字符、转义符使用实例介绍
https://www.cnblogs.com/chengmo/archive/2010/10/17/1853344.html
- kendo-ui下拉树形选择(DropDownTreeView)
摘要: 最近项目中有一个特殊的需求,下拉选择部门,但是部门的层级关系要在下来框中体现出来,如下图 下面我就把实现的过程分享给大家,代码如下: dropdowntreeview.js /* * * Dr ...
- jar包的启动和停止脚本
启动: #!/bin/sh PIDFILE="/app/eureka/eureka.pid" LOGFILE="/app/eureka/out.log" if ...
- [Object Tracking] Identify and Track Specific Object
Abstract—Augmented Reality (AR) has become increasingly popular in recent years and it has a widespr ...
- SpringBoot------热部署(devtools)(推荐)
1.修改pom.xml文件 <project> <dependencies> <!-- 使用devtool热部署插件(推荐) --> <dependency& ...
- EventHandler中如何提升用户权限(模拟管理员权限)
不论是在工作流或是EventHandler中,我们经常希望模拟管理员权限,从而可以通过程序自定义列表项的权限. 在工作流中可以用如下代码来提升权限:(以下代码实现的功能是断开列表项所继承的权限,除管理 ...
- drawCall_01
在屏幕上渲染物体,引擎需要发出一个绘制调用来访问图形API(iOS系统中为OpenGL ES).每个绘制调用需要进行大量的工作来访问图形API,从而导致了CPU方面显著的性能开销. Unity在运 ...
- error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
更新的软件可以解决 TortoiseGit-preview-2.5.7.0-20180127-b2d00f8-64bit.msi和Git-2.16.2-64-bit.exe. 链接地址为: https ...
- C语言实现字符串IP与整数型IP的相互转换
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <malloc.h&g ...
- 【LeetCode OJ】Add Two Numbers
题目:You are given two linked lists representing two non-negative numbers. The digits are stored in re ...