胃癌转移数据说明
肾细胞癌转移情况(有转移 y=1,无转移 y=2)
x1:确诊时患者年龄(岁)
x2:肾细胞癌血管内皮生长因子(VEGF),其阳性表述由低到高共3个等级
x3:肾细胞癌组织内微血管数(MVC)
x4:肾癌细胞核组织学分级,由低到高共4级
x5:肾细胞癌分期,由低到高共4级
y x1 x2 x3 x4 x5
0 59 2 43.4 2 1
运行代码如下
package spark.logisticRegression
import org.apache.spark.mllib.classification.LogisticRegressionWithSGD
import org.apache.spark.mllib.evaluation.MulticlassMetrics
import org.apache.spark.mllib.linalg.Vectors
import org.apache.spark.mllib.regression.LabeledPoint
import org.apache.spark.mllib.util.MLUtils
import org.apache.spark.{SparkConf, SparkContext}
/**
* MLLib分类,逻辑回归,是分类,不是回归
* 胃癌转移判断
* Created by eric on 16-7-17.
*/
object LogisticRegression4 {
val conf = new SparkConf() //创建环境变量