一、 定义
表示数据点的特征和标签的类
二、 构造器
LabeledPoint(double label, Vector features)
label: 数据点的标签
features: 据点的特征向量
三、 方法
修饰符和类型 | 方法 | 说明 |
---|---|---|
Vector | features() | |
Vector | getFeatures() | 获取特征 |
double | getLabel() | 获取标签 |
double | label() | |
static LabeledPoint | parse(String s) | 将LabeledPoint.toString 产生的字符串解析为LabeledPoint 类型变量 |
String | toString() | 转化为String类型变量 |
从类Object继承的方法 |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
从接口scala.Product继承的方法 |
---|
i n i t init init, productArity, productElement, productIterator, productPrefix |
从接口scala.Equals继承的方法 |
---|
canEqual, equals |
参考资料:
- spark官方文档:http://spark.apache.org/docs/latest/api/java/index.html