Spark Cookbook by 2015

Spark Cookbook by 2015

Author:2015
Language: eng
Format: epub
Publisher: Packt Publishing


Create a labeled point with a positive label and dense vector: scala> val willBuySUV = LabeledPoint(1.0,Vectors.dense(300.0,80,40))

Create a labeled point with a negative label and dense vector: scala> val willNotBuySUV = LabeledPoint(0.0,Vectors.dense(150.0,60,25))

Create a labeled point with a positive label and sparse vector: scala> val willBuySUV = LabeledPoint(1.0,Vectors.sparse(3,Array(0,1,2),Array(300.0,80,40)))

Create a labeled point with a negative label and sparse vector: scala> val willNotBuySUV = LabeledPoint(0.0,Vectors.sparse(3,Array(0,1,2),Array(150.0,60,25)))



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.