天天看點

基于Spark MLlib 在IDEA環境實作Kmeans 算法

import org.apache.spark.{SparkContext, SparkConf}
import org.apache.spark.mllib.clustering.{KMeans, KMeansModel}
import org.apache.spark.mllib.linalg.Vectors
import org.apache.log4j.{ Level, Logger }
import scala.collection.mutable.ArrayBuffer


/*
* 支援五個參數,依次為:
*
* read_file_path   資料讀取目錄
* save_file_path   結果存放目錄
* setk             聚類數 預設為2
* setMaxIterations 最大疊代次數 預設為20
* run              計算并行度 預設為2
* */


object Spark_MLlib_Kmeans {
  def main(args: Array[String]) {
    if (args.length < 5) {
      sys.exit(1)
    }

    /*關閉INFO 和 WARN 級别的日志*/
    Logger.getLogger("org.apache.spark").setLevel(Level.WARN)
    Logger.getLogger("org.eclipse.jetty.server").setLevel(Level.OFF)


    // 1. 建構spark對象
    val conf = new SparkConf().setAppName("K-Means Clustering").setMaster("local")
    val sc = new SparkContext(conf)
    Logger.getRootLogger.setLevel(Level.WARN)


    // 2. 讀取樣本資料,格式為LIBSVM格式,資料及
    val rawTranData = sc.textFile(args(0))
    val tran = 0.7
    val test = 0.3
    val dataParts = rawTranData.randomSplit(Array(tran, test), seed = 2)

    // 訓練集
    val dataParts_TranData = dataParts(0)
    // 測試集
    val dataParts_TestData = dataParts(1)
    // 訓練資料因子化并緩存
    val TranData = dataParts_TranData.map(s => Vectors.dense(s.split(' ').map(_.toDouble))).cache()




    // 3. 建立kmeans 聚類模型,并訓練
    val initMode = "k-means||"
    val numClusters = args(2).toInt
    val numIterations = args(3).toInt
    val runTimes = args(4).toInt
    var clusterIndex: Int = 0
    val model = new KMeans().setInitializationMode(initMode)
      .setK(numClusters)
      .setMaxIterations(numIterations)
      .run(TranData)


    val mutableArr = ArrayBuffer[String]()

    // 4. 誤差計算
    val WSSSE = model.computeCost(TranData)
    mutableArr += "\n"+WSSSE.toString


    // 5. 輸出每個類别的中心點
    model.clusterCenters.foreach(
      x => {
        mutableArr += ("\n"+clusterIndex.toString+":"+x.toString)
        clusterIndex += 1
      })


    // 6.測試模型  測試資料因子化并緩存
    val TestData = dataParts_TestData.map(s => Vectors.dense(s.split(' ').map(_.toDouble))).cache()


    // 7. 輸出測試結果(每條記錄和其所屬的類别)
    TestData.collect().foreach(testDataLine => {
      val classIndex: Int = model.predict(testDataLine)
      mutableArr += ("\n"+testDataLine.toString+"\t"+classIndex.toString)
    })

    val ws = Array(mutableArr)
    val fd= sc.parallelize(ws)
    fd.saveAsTextFile(args(1))

    println("\nSpark MLlib K-means clustering test finished.\n")
  }

}
      

  

輸出結果

Using Spark's default log4j profile: org/apache/spark/log4j-defaults.properties
18/12/19 11:54:00 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
18/12/19 11:54:01 INFO Slf4jLogger: Slf4jLogger started
18/12/19 11:54:01 INFO Remoting: Starting remoting
18/12/19 11:54:01 INFO Remoting: Remoting started; listening on addresses :[akka.tcp://[email protected]:52676]
18/12/19 11:54:03 WARN BLAS: Failed to load implementation from: com.github.fommil.netlib.NativeSystemBLAS
18/12/19 11:54:03 WARN BLAS: Failed to load implementation from: com.github.fommil.netlib.NativeRefBLAS
[12345.0,27.0,101.0,76.0,800.0,2.27,1.01,1.12,1.47,1.42]	0
[12345.0,33.6,101.3,50.4,800.0,1.61,1.0,1.06,1.22,1.14]	0
[12345.0,33.1,101.1,50.2,800.0,0.79,0.81,230.41,77.34,1.0]	0
[12345.0,33.0,101.0,52.6,800.0,158.72,0.56,0.55,53.28,1.37]	0
[12345.0,31.8,101.5,71.7,0.0,5.87,5.99,5.11,5.66,1.6]	0
[12345.0,30.7,101.2,67.9,798.0,6.25,5.67,5.81,5.91,1.42]	0
[12345.0,26.6,101.3,52.0,800.0,1.24,1.64,1.2,1.36,1.17]	0
[12345.0,33.9,100.8,37.6,800.0,1.95,1.04,1.52,1.5,1.14]	0
[12345.0,33.9,100.8,37.6,800.0,1.2,1.8,0.41,1.14,1.14]	0
[12345.0,31.6,101.0,48.4,800.0,8.39,3.88,4.62,5.63,1.12]	0
[12345.0,33.8,101.0,25.2,800.0,2.15,1.83,1.85,1.94,1.21]	0
[12345.0,30.5,101.0,74.7,800.0,1.83,1.35,1.46,1.55,1.14]	0
[12345.0,35.1,100.8,33.2,800.0,2.06,2.7,1.77,2.18,1.15]	0
[12345.0,35.1,100.8,33.2,800.0,1.01,1.25,1.19,1.15,0.81]	0
[12345.0,35.1,100.8,33.2,800.0,1.2,1.48,1.34,1.34,1.14]	0
[12345.0,28.0,100.9,99.0,1000.0,2.49,1.43,0.9,1.61,1.22]	0
[12345.0,31.7,100.8,99.0,1000.0,5.67,5.11,5.07,5.28,1.78]	0
[12345.0,30.3,101.0,50.4,1000.0,2.46,1.0,0.74,1.4,1.1]	0
[125661.0,31.9,100.4,56.7,0.0,3.3,2.8,2.7,2.9,1.56]	3
[60000.0,33.7,100.9,57.2,0.0,7.5,1.9,1.3,3.6,1.56]	3
[65401.0,33.6,99.8,53.7,0.0,9.3,2.2,2.2,4.6,1.56]	3
[12345.0,21.0,101.0,98.0,800.0,251.15,0.6,0.58,84.11,0.87]	0
[12345.0,29.8,101.0,69.2,1000.0,0.86,0.8,0.77,0.81,0.75]	0
[0.0,35.1,100.8,5.0,0.0,1.5,1.8,1.4,1.5,1.3]	0
[0.0,28.7,100.4,25.9,0.0,1.7,1.5,0.9,1.4,0.9]	0
[0.0,24.8,100.6,54.2,0.0,1.7,2.4,2.4,2.1,1.3]	0
[0.0,20.4,100.5,64.3,0.0,2.3,2.3,1.5,2.1,1.1]	0
[0.0,28.7,101.4,55.4,0.0,1.1,1.4,1.9,1.5,1.3]	0
[0.0,25.4,100.5,89.8,0.0,1.0,0.9,1.6,1.2,1.2]	0
[169574.0,34.6,100.7,53.7,0.0,1.9,1.6,2.1,1.9,0.8]	3
[0.0,33.8,100.7,49.1,0.0,2.6,1.7,1.6,2.0,1.3]	0
[0.0,31.6,100.7,67.4,0.0,1.8,2.0,1.1,1.6,1.5]	0
[0.0,29.1,100.9,79.9,0.0,3.6,2.5,4.4,3.5,1.3]	0
[0.0,31.1,101.0,74.1,0.0,2.9,3.8,5.1,3.9,1.4]	0
[0.0,30.4,100.8,74.5,0.0,1.8,2.3,0.8,1.6,1.3]	0
[0.0,31.3,100.7,71.3,0.0,5.2,5.2,3.0,4.5,1.1]	0
[0.0,30.6,100.5,57.1,1481.0,1.3,1.6,1.4,1.5,1.2]	0
[0.0,30.5,101.1,75.6,424.0,2.2,2.0,1.2,1.8,1.7]	0
[0.0,31.9,101.0,63.9,2250.0,2.0,2.8,2.7,2.5,1.7]	0
[60001.0,23.9,101.2,82.4,0.0,1.89,2.09,1.19,1.72,1.43]	3
[65201.0,31.0,101.0,49.8,0.0,2.65,2.73,3.19,2.86,1.44]	3
[85630.0,29.8,100.8,56.9,0.0,0.1,0.82,1.63,0.85,0.75]	3
[85630.0,29.8,100.8,56.9,0.0,1.1,0.1,1.36,0.85,0.75]	3
[85630.0,30.6,100.8,53.7,0.0,0.1,0.94,1.88,0.97,0.75]	3
[300001.0,29.8,101.0,55.0,0.0,1.41,1.69,1.26,1.45,1.36]	2
[84109.0,30.7,100.9,55.0,0.0,2.25,1.59,1.26,1.7,1.45]	3
[85630.0,26.1,100.4,58.0,0.0,4.06,3.59,4.39,4.01,0.83]	3
[85630.0,26.1,100.4,58.0,0.0,1.11,1.11,1.1,1.11,0.83]	3
[85630.0,28.1,101.2,55.0,0.0,2.89,1.06,0.29,1.41,1.17]	3
[65201.0,28.8,101.1,55.0,0.0,1.88,1.8,1.7,1.79,0.73]	3
[65201.0,28.8,101.1,55.0,0.0,1.61,1.68,1.07,1.45,0.73]	3
[85630.0,29.1,101.1,53.1,0.0,2.98,1.87,1.12,1.99,0.53]	3
[85630.0,29.4,101.2,52.6,0.0,0.82,0.77,0.85,0.81,0.53]	3
[20000.0,24.0,101.6,63.3,0.0,0.02,0.01,10.22,3.42,2.5]	0
[12345.0,29.5,98.4,90.0,800.0,1.73,1.64,1.65,1.67,0.95]	0
[12345.0,37.8,98.7,54.7,800.0,2.46,2.57,6.35,3.79,1.01]	0
[12345.0,34.3,98.9,71.3,800.0,6.5,2.72,2.5,3.91,1.56]	0
[12345.0,37.9,98.7,59.0,800.0,0.88,4.36,3.86,3.03,1.06]	0
[12345.0,36.2,98.8,61.3,800.0,1.26,2.12,1.08,1.49,1.34]	0
[12345.0,36.9,98.8,60.9,800.0,3.5,2.79,3.37,3.22,1.34]	0
[12345.0,35.2,98.5,67.3,800.0,4.42,0.23,0.19,1.61,1.03]	0
[12345.0,32.8,98.7,78.7,800.0,1.85,1.9,1.76,1.84,1.68]	0
[12345.0,32.7,98.5,81.3,0.0,0.87,1.41,1.16,1.15,1.14]	0
[12345.0,33.7,98.5,72.0,651.0,8.57,6.35,6.11,7.01,1.19]	0
[12345.0,29.3,98.4,75.8,1000.0,0.48,1.67,1.44,1.2,0.77]	0
[12345.0,27.4,98.8,75.6,1000.0,1.42,1.07,1.44,1.31,1.29]	0
[12345.0,32.1,98.9,80.7,747.0,6.87,0.77,2.46,3.37,1.6]	0
[125252.0,37.7,100.9,40.6,0.0,0.1,0.1,0.1,0.1,3.0]	3
[125252.0,30.9,100.7,56.7,0.0,0.1,0.1,0.1,0.1,3.0]	3
[58000.0,25.7,100.2,89.1,0.0,0.1,0.1,0.1,0.1,2.5]	3
[68000.0,25.7,100.2,89.1,0.0,0.1,0.1,0.1,0.1,2.5]	3
[68000.0,24.7,100.2,90.2,0.0,0.17,0.16,0.16,0.16,2.5]	3
[12345.0,27.5,101.1,57.2,800.0,0.98,1.11,0.49,0.86,0.73]	0
[12345.0,29.2,100.0,48.5,800.0,2.46,0.97,0.47,1.3,0.73]	0
[12345.0,33.4,100.0,44.6,800.0,1.38,1.04,1.05,1.16,1.04]	0
[12345.0,24.5,100.5,75.7,800.0,2.52,0.79,1.65,1.65,1.06]	0
[12345.0,27.3,100.4,84.5,800.0,2.01,1.86,2.3,2.06,0.68]	0
[12345.0,31.9,99.8,73.0,800.0,1.89,4.06,4.12,3.36,1.02]	0
[12345.0,33.0,100.8,57.3,800.0,1.69,0.76,1.48,1.31,1.26]	0
[12345.0,29.1,100.8,83.0,1000.0,2.14,2.36,1.42,1.97,1.17]	0
[113656.0,33.2,100.5,66.0,0.0,1.8,1.8,1.8,1.8,1.4]	3
[60000.0,32.0,101.1,66.2,0.0,0.87,0.87,0.87,0.87,0.74]	3
[0.0,27.5,101.3,74.1,0.0,4.63,0.32,0.32,1.76,1.56]	0
[0.0,28.0,100.4,68.6,0.0,0.99,1.0,1.0,1.0,0.84]	0
[0.0,34.3,100.9,58.0,0.0,1.24,1.24,1.41,1.3,0.88]	0
[0.0,43.2,100.8,57.6,0.0,1.4,0.55,0.1,0.68,0.52]	0
[0.0,35.2,101.2,74.4,0.0,0.5,1.15,1.16,0.94,0.84]	0
[0.0,36.1,101.1,68.8,0.0,1.41,1.18,1.18,1.26,1.08]	0
[0.0,39.3,100.4,62.5,0.0,1.3,1.3,1.31,1.3,1.15]	0
[0.0,35.8,100.6,79.6,0.0,1.33,1.34,1.34,1.34,1.29]	0
[0.0,37.9,100.8,70.5,0.0,1.26,1.25,1.25,1.25,1.05]	0
[50001.0,20.3,101.5,56.8,0.0,0.76,0.85,0.88,0.83,0.76]	0
[89710.0,24.4,100.1,64.8,0.0,1.38,2.7,0.43,1.5,0.75]	3
[30002.0,35.9,100.1,45.8,0.0,0.69,0.67,1.19,0.85,0.83]	0
[190000.0,23.8,100.4,85.9,0.0,1.54,1.29,0.97,1.27,1.22]	3
[68851.0,26.5,100.0,86.7,0.0,1.26,1.33,1.69,1.43,0.85]	3
[90002.0,34.6,100.1,73.4,0.0,4.42,0.1,0.1,1.54,0.79]	3
[275455.0,30.7,100.4,78.3,0.0,1.78,2.01,0.53,1.44,1.36]	2
[50001.0,31.7,100.6,77.0,0.0,0.62,1.66,2.14,1.47,1.32]	0
[90001.0,24.0,100.5,74.2,0.0,3.28,0.18,0.19,1.22,0.75]	3
[105623.0,36.0,101.0,64.0,0.0,4.9,0.3,0.3,1.9,1.2]	3
[205623.0,36.0,101.0,64.0,0.0,2.2,1.6,1.6,1.8,1.2]	3
[225624.0,36.0,101.0,64.0,0.0,2.1,1.6,1.6,1.8,1.2]	3
[325624.0,36.0,101.0,64.0,0.0,1.4,1.4,1.3,1.4,1.2]	2
[243692.0,36.0,101.0,64.0,0.0,4.6,4.7,4.8,4.7,1.6]	2
[85630.0,36.0,101.0,64.0,0.0,1.7,2.0,1.8,1.8,1.6]	3
[95630.0,36.0,101.0,64.0,0.0,1.8,1.9,1.7,1.8,1.6]	3
[285623.0,30.0,101.0,70.0,0.0,1.3,1.3,1.3,1.3,1.2]	2
[485623.0,30.0,101.0,70.0,0.0,1.9,1.6,1.7,1.7,1.2]	2
[585623.0,30.0,101.0,70.0,0.0,2.0,1.8,2.1,2.0,1.2]	1
[186308.0,27.0,101.0,70.0,0.0,2.7,1.9,1.9,2.2,1.5]	3
[96592.0,27.0,101.0,70.0,0.0,1.6,1.4,1.4,1.5,1.5]	3
[206854.0,31.0,101.0,62.0,0.0,2.9,3.1,3.0,3.0,1.3]	3
[223054.0,31.0,101.0,68.0,0.0,2.0,1.2,1.2,1.5,1.3]	3
[135502.0,36.0,101.0,61.0,0.0,1.9,1.8,1.8,1.8,1.6]	3
[235502.0,32.0,101.0,70.0,0.0,2.0,1.9,2.0,1.9,1.6]	2
[335502.0,32.0,101.0,70.0,0.0,2.0,1.9,1.8,1.9,1.6]	2
[435502.0,32.0,101.0,70.0,0.0,1.6,1.9,1.8,1.8,1.6]	2
[405623.0,32.0,101.0,70.0,0.0,4.7,4.3,4.4,4.5,1.3]	2
[505623.0,32.0,101.0,70.0,0.0,3.6,3.8,2.7,3.4,1.3]	2
[605623.0,32.0,101.0,70.0,0.0,2.3,2.4,2.7,2.5,1.3]	1
[65555.0,32.0,101.0,65.0,0.0,1.7,1.3,0.9,1.3,1.2]	3
[218300.0,32.0,101.0,65.0,0.0,2.1,1.4,1.6,1.7,1.3]	3
[12345.0,32.7,101.0,28.1,800.0,2.66,2.13,0.11,1.63,1.36]	0
[12345.0,28.0,101.0,78.0,800.0,2.17,0.84,2.28,1.76,1.29]	0
[12345.0,32.3,101.0,64.7,800.0,2.71,0.71,0.57,1.33,1.13]	0
[12345.0,30.5,101.0,60.0,800.0,3.0,2.07,2.64,2.57,1.49]	0
[12345.0,24.5,101.0,66.8,800.0,1.07,1.83,1.39,1.43,1.4]	0
[12345.0,29.9,100.3,66.1,722.0,1.64,3.59,0.28,1.84,1.27]	0
[98275.0,33.4,100.7,80.6,0.0,3.92,0.62,2.77,2.44,3.0]	3
[133007.0,37.7,100.2,64.4,0.0,2.31,0.31,0.17,0.93,0.85]	3
[99000.0,35.7,100.1,60.1,0.0,1.64,1.34,1.48,1.49,1.12]	3
[102000.0,33.1,99.9,75.0,0.0,2.81,2.72,2.55,2.69,3.0]	3
[100000.0,35.5,100.2,66.3,0.0,1.55,2.33,1.61,1.83,1.03]	3
[100000.0,39.4,100.1,59.2,0.0,2.33,2.01,0.86,1.73,1.03]	3
[90000.0,33.1,100.0,72.5,0.0,0.1,2.67,0.82,1.2,1.33]	3
[43000.0,35.9,100.0,64.9,0.0,4.55,1.77,3.07,3.13,0.79]	0
[231600.0,35.1,100.2,66.9,0.0,10.55,4.43,5.22,6.73,1.41]	3
[156895.0,38.2,100.3,68.0,0.0,1.29,1.29,1.29,1.29,0.71]	3
[12834.0,28.2,100.2,72.4,0.0,1.3,1.39,1.28,1.32,1.19]	0
[14526.0,28.5,99.9,73.9,0.0,0.01,1.92,1.22,1.05,1.04]	0
[43550.0,27.9,100.8,61.1,0.0,4.26,4.22,4.03,4.17,0.77]	0
[65000.0,25.8,100.8,49.9,0.0,1.99,0.52,1.58,1.36,0.75]	3
[105001.0,38.4,100.5,56.4,0.0,2.94,1.88,2.16,2.33,1.46]	3
[32445.0,32.3,99.9,43.5,0.0,1.28,0.1,1.07,0.8,0.77]	0
[87950.0,37.7,100.7,50.7,0.0,0.68,2.46,0.1,1.06,0.75]	3
[24110.0,36.1,100.3,60.0,0.0,2.07,1.3,1.59,1.65,1.33]	0
[75441.0,39.4,100.1,50.3,0.0,0.46,0.1,3.44,1.32,1.19]	3
[20000.0,34.2,100.2,58.0,0.0,1.04,0.95,0.98,0.99,0.83]	0
[18000.0,36.2,100.1,64.8,0.0,2.33,0.37,0.18,0.96,0.52]	0
[98512.0,30.2,100.1,59.6,0.0,6.06,0.27,0.23,2.19,0.79]	3
[10000.0,25.6,100.71,90.0,0.0,0.49,0.55,0.54,0.53,0.52]	0
[2760.0,23.2,100.89,24.7,0.0,0.71,0.83,0.92,0.82,0.52]	0
[50000.0,31.8,100.56,90.0,0.0,0.34,0.33,16.08,5.58,1.14]	0
[12345.0,22.8,99.2,46.7,800.0,4.74,3.83,2.7,3.76,3.0]	0
[12345.0,25.0,98.9,41.3,800.0,10.28,11.53,5.76,9.19,2.5]	0
[12345.0,19.0,100.8,17.9,800.0,1.3,1.27,7.26,3.28,2.5]	0
[12345.0,24.5,101.0,7.7,800.0,4.0,4.67,1.16,3.28,2.5]	0
[12345.0,27.9,101.0,5.0,800.0,7.79,11.22,7.26,8.76,2.5]	0
[12345.0,25.7,101.0,5.0,800.0,0.08,5.02,3.58,2.89,2.5]	0
[12345.0,22.4,101.0,7.0,800.0,3.48,3.82,3.48,3.59,2.5]	0
[12345.0,31.1,101.0,69.8,800.0,4.44,2.11,2.51,3.02,3.0]	0
[12345.0,32.9,101.0,67.4,800.0,0.32,7.31,0.02,2.55,2.5]	0
[12345.0,33.2,101.0,68.9,800.0,4.12,3.41,3.43,3.65,2.5]	0
[12345.0,29.6,101.0,61.9,800.0,6.11,1.48,1.26,2.95,2.5]	0
[12345.0,30.2,100.0,51.8,800.0,16.06,16.06,4.45,12.19,2.5]	0
[12345.0,30.6,101.0,69.3,800.0,1.68,2.53,3.48,2.56,2.5]	0
[12345.0,31.1,101.0,61.5,800.0,2.0,4.69,2.0,2.9,2.5]	0
[12345.0,30.6,101.0,60.9,800.0,0.1,8.67,0.1,2.96,2.5]	0
[12345.0,30.0,101.0,58.3,800.0,0.02,4.19,3.4,2.54,2.5]	0
[12345.0,30.6,101.1,62.6,800.0,11.89,0.61,0.13,4.21,2.5]	0
[12345.0,33.0,101.0,46.7,701.0,4.3,3.83,3.81,3.98,1.36]	0
[12345.0,34.0,101.0,43.0,1000.0,3.37,3.55,0.4,2.44,1.23]	0
[12345.0,32.6,101.0,38.0,904.0,2.1,1.69,1.07,1.62,1.29]	0
[12345.0,32.4,101.0,39.4,1000.0,3.61,3.66,2.87,3.38,1.5]	0
[12345.0,32.3,101.0,39.2,1000.0,3.67,3.51,3.02,3.4,1.5]	0
[12345.0,32.3,101.0,39.2,596.0,2.6,2.21,2.29,2.37,1.29]	0
[12345.0,22.9,102.5,54.0,861.0,13.5,5.0,5.44,7.98,1.81]	0
[12345.0,23.4,102.5,52.0,806.0,1.31,0.77,3.5,1.86,1.47]	0
[12345.0,26.0,102.6,43.3,1000.0,1.22,1.58,1.22,1.34,0.97]	0
[12345.0,23.0,100.8,54.1,828.0,1.01,4.27,3.41,2.9,1.6]	0
[12345.0,32.6,101.0,52.5,468.0,2.87,1.92,1.49,2.09,1.34]	0
[12345.0,33.7,101.0,30.7,617.0,0.07,0.9,7.21,2.73,1.14]	0
[12345.0,33.7,101.0,31.4,1000.0,2.79,1.93,4.16,2.96,1.14]	0
[12345.0,33.7,101.0,34.9,1000.0,0.14,3.35,2.96,2.15,1.68]	0
[12345.0,34.4,100.0,43.7,1000.0,2.01,3.5,0.4,1.97,1.41]	0
[98005.0,31.5,125.0,80.8,600.0,7.0,0.5,1.0,2.8,2.5]	3
[23854.0,34.2,125.0,76.9,600.0,1.6,1.5,1.6,1.6,1.2]	0
[151000.0,27.6,125.0,95.0,600.0,3.3,1.1,0.6,1.7,1.3]	3
[155233.0,31.5,125.0,95.0,600.0,4.2,4.2,4.2,4.2,1.4]	3
[124215.0,34.6,125.0,95.0,600.0,1.5,1.1,1.1,1.2,1.1]	3
[152285.0,38.2,125.0,86.6,600.0,6.7,2.6,3.3,4.2,1.5]	3
[155222.0,36.6,125.0,87.7,0.0,4.3,2.1,1.9,2.8,1.4]	3
[120001.0,30.9,125.0,95.0,0.0,3.7,0.1,0.1,1.3,1.3]	3
[102410.0,33.9,125.0,95.0,1049.0,4.3,4.7,4.0,4.3,3.0]	3
[52102.0,21.6,101.1,68.4,0.0,1.56,1.64,1.32,1.51,1.3]	0
[772100.0,21.6,101.1,68.4,0.0,3.2,0.97,1.28,1.82,1.4]	1
[36854.0,21.6,101.1,68.4,0.0,2.55,0.98,0.65,1.39,1.3]	0
[95623.0,21.6,101.1,68.4,0.0,0.82,1.18,1.62,1.21,1.1]	3
[85124.0,21.6,101.1,68.4,0.0,1.67,1.21,0.66,1.18,1.1]	3
[32012.0,21.6,101.1,68.4,0.0,3.68,1.02,2.84,2.51,1.3]	0
[22000.0,21.6,101.1,68.4,0.0,1.26,1.42,1.2,1.29,1.2]	0
[12345.0,27.7,98.0,67.4,800.0,0.09,0.05,2.5,0.88,0.77]	0
[41258.0,21.8,101.3,77.7,0.0,0.56,0.75,0.75,0.69,0.67]	0
[145460.0,28.8,99.8,59.7,0.0,0.99,7.09,3.26,3.78,1.5]	3
[30051.0,30.0,100.6,64.7,0.0,0.6,0.55,0.58,0.58,0.52]	0
[45123.0,28.4,100.6,64.7,0.0,1.17,1.17,1.04,1.13,0.97]	0
[113200.0,29.0,100.2,59.7,0.0,1.75,3.55,2.56,2.62,2.5]	3
[52580.0,30.7,100.3,54.7,0.0,0.68,3.38,2.78,2.28,1.68]	0
[51250.0,30.4,100.3,54.7,0.0,0.95,1.75,1.54,1.41,1.26]	0
[101230.0,30.4,100.3,54.7,0.0,0.87,0.55,4.05,1.82,0.97]	3
[95220.0,28.6,100.4,54.7,0.0,0.94,2.63,0.48,1.35,0.83]	3
[101540.0,31.1,100.3,54.7,0.0,0.27,0.83,1.3,0.8,0.75]	3
[56123.0,29.4,100.5,54.7,0.0,1.91,1.61,1.62,1.71,0.75]	0
[157956.0,28.2,101.0,29.5,600.0,1.74,1.25,1.01,1.33,1.29]	3
[68635.0,27.8,101.1,56.9,600.0,2.28,2.26,2.18,2.24,1.29]	3
[89488.0,33.1,101.1,58.4,413.0,4.93,4.78,4.73,4.81,3.0]	3
[52000.0,34.0,100.9,55.7,649.0,4.54,5.13,4.61,4.76,1.7]	0
[52000.0,32.5,101.0,60.1,860.0,2.62,2.11,2.31,2.35,1.7]	0
[52000.0,34.2,101.0,54.0,1304.0,2.02,2.2,2.06,2.09,1.7]	0
[89488.0,35.2,101.1,56.9,753.0,5.05,4.99,4.78,4.94,3.0]	3
[89488.0,33.7,101.0,59.9,428.0,1.37,1.58,1.61,1.52,1.11]	3
[89488.0,33.5,101.0,58.5,852.0,2.1,1.31,1.22,1.54,1.11]	3
[89488.0,31.6,100.9,61.7,0.0,4.67,5.24,5.29,5.07,1.11]	3
[89488.0,32.5,100.9,55.9,421.0,3.54,3.53,3.65,3.57,1.11]	3
[89488.0,34.2,101.0,55.4,437.0,2.52,2.5,2.61,2.54,1.11]	3
[65700.0,34.7,101.0,58.6,672.0,5.87,5.52,5.68,5.69,1.29]	3
[65700.0,34.5,101.0,58.0,655.0,5.2,5.9,5.76,5.62,1.29]	3
[122357.0,32.1,101.2,57.3,625.0,3.62,3.19,3.49,3.43,1.7]	3
[20241.0,31.4,100.0,60.0,750.0,1.64,1.1,2.03,1.59,1.29]	0
[66879.0,31.6,100.0,63.9,652.0,2.55,2.62,3.06,2.74,1.15]	3
[98700.0,32.2,100.0,62.1,765.0,3.94,3.83,3.59,3.79,3.0]	3
[98700.0,31.8,99.8,63.8,761.0,2.2,1.48,3.16,2.28,1.07]	3
[98700.0,31.1,99.8,64.6,761.0,2.79,2.49,2.67,2.65,1.07]	3
[69532.0,28.6,100.2,70.7,802.0,1.73,2.23,2.01,1.99,1.4]	3
[66879.0,30.4,99.9,63.4,649.0,0.99,1.27,1.81,1.36,1.15]	3
[66879.0,30.8,99.9,61.9,649.0,1.29,1.23,1.44,1.32,1.15]	3
[96523.0,30.2,100.8,62.9,842.0,2.78,2.58,3.23,2.86,1.7]	3
[96523.0,31.0,100.8,59.0,961.0,3.45,2.64,2.99,3.03,1.7]	3
[84978.0,29.4,100.6,56.1,773.0,4.43,1.34,1.55,2.44,1.14]	3
[89451.0,32.1,100.0,60.3,872.0,3.85,3.28,3.47,3.53,3.0]	3
[103154.0,33.5,100.9,51.2,714.0,2.39,2.3,2.36,2.35,1.29]	3
[192743.0,33.3,100.9,52.7,765.0,4.51,4.31,4.23,4.35,3.0]	3
[60000.0,30.3,102.0,57.9,600.0,10.5,7.4,5.1,7.7,3.0]	3
[90000.0,35.7,101.8,69.5,592.0,1.4,1.3,1.4,1.4,1.1]	3
[90000.0,35.7,101.8,69.2,583.0,1.5,1.3,1.3,1.4,1.1]	3
[90000.0,35.8,101.7,68.7,0.0,0.3,3.5,0.5,1.5,1.1]	3
[57123.0,30.2,101.2,68.0,600.0,4.6,3.5,2.7,3.6,1.1]	3
[57123.0,30.5,101.2,66.6,600.0,1.3,0.8,5.3,2.5,1.1]	3
[13200.0,23.1,101.6,56.1,0.0,7.07,7.11,6.96,7.05,3.05]	0
[103500.0,30.7,100.0,72.8,0.0,2.6,1.73,1.77,2.03,1.11]	3
[13200.0,28.6,100.9,62.9,0.0,5.24,5.15,5.3,5.23,1.06]	0
[13200.0,27.9,100.6,60.6,0.0,0.36,1.17,5.25,2.26,0.77]	0
[13200.0,24.2,100.8,79.6,0.0,0.83,1.32,1.19,1.11,1.02]	0
[103500.0,28.5,100.3,82.0,0.0,4.74,1.31,1.54,2.53,1.12]	3
[13200.0,31.3,100.1,74.1,0.0,0.9,0.9,0.9,0.9,0.73]	0
[13200.0,28.9,100.8,82.8,0.0,8.36,8.38,8.4,8.38,2.08]	0
[13200.0,31.3,100.8,71.4,0.0,5.76,5.76,5.76,5.76,0.83]	0
[80846.0,32.9,100.8,68.8,0.0,6.48,6.26,0.1,4.25,0.96]	3
[13200.0,32.9,100.8,69.1,0.0,4.45,4.47,4.43,4.45,0.99]	0
[13200.0,32.0,100.9,69.4,0.0,1.17,1.63,1.3,1.37,1.26]	0
[13200.0,33.7,100.7,61.6,0.0,3.99,4.01,3.91,3.97,1.35]	0
[80846.0,30.9,100.3,80.0,0.0,6.96,0.26,0.15,2.46,1.55]	3
[13200.0,31.4,100.4,72.1,0.0,3.87,3.14,4.89,3.97,3.0]	0
[13200.0,31.7,100.3,72.2,0.0,1.77,1.45,1.45,1.56,0.92]	0
[13200.0,30.2,100.1,86.3,0.0,0.41,0.31,2.05,0.92,0.75]	0
[33333.0,31.3,100.5,76.1,0.0,0.35,2.1,2.22,1.56,1.4]	0
[5.0,29.8,100.0,70.3,0.0,1.6,1.49,1.61,1.57,1.03]	0
[40001.0,33.7,101.5,65.9,0.0,0.42,1.09,0.49,0.67,0.52]	0
[142122.0,34.7,100.3,70.9,0.0,4.98,4.42,5.34,4.91,0.97]	3
[151722.0,33.8,100.3,70.9,0.0,1.3,0.57,1.5,1.12,0.96]	3
[135621.0,34.8,101.0,70.9,0.0,0.63,4.44,3.43,2.83,0.79]	3
[102732.0,34.7,100.3,70.9,0.0,0.82,1.2,1.08,1.03,0.73]	3
[38001.0,33.2,100.6,70.9,0.0,4.19,2.07,1.89,2.72,0.75]	0
[165482.0,33.9,100.4,70.9,0.0,0.41,3.76,0.2,1.46,1.03]	3
[174778.0,33.0,100.5,70.9,0.0,3.31,0.32,2.41,2.01,0.75]	3
[165455.0,31.1,99.9,70.9,0.0,1.95,0.97,1.37,1.43,1.25]	3
[61000.0,33.9,101.5,19.4,0.0,3.54,3.05,2.61,3.07,2.5]	3
[12345.0,37.3,101.0,35.9,848.0,1.58,1.87,1.15,1.53,1.31]	0
[12345.0,35.2,101.0,16.1,671.0,0.89,5.3,1.03,2.41,1.23]	0
[12345.0,35.0,101.0,20.1,675.0,1.42,4.6,2.23,2.75,1.23]	0
[12345.0,24.6,101.0,67.0,800.0,0.74,1.01,0.66,0.8,0.74]	0
[12345.0,30.0,101.0,81.0,800.0,0.19,2.74,0.57,1.17,1.0]	0
[65237.0,26.9,100.2,55.9,600.0,0.0,0.0,4.5,1.5,1.4]	3
[30001.0,28.7,100.1,56.7,600.0,0.5,2.3,3.8,2.2,1.1]	0
[20001.0,30.4,100.6,49.7,600.0,2.4,1.2,3.5,2.4,1.4]	0
[62401.0,31.8,100.1,46.4,600.0,9.2,8.6,13.5,10.4,1.4]	3
[62533.0,32.4,100.3,46.4,600.0,1.8,3.3,3.9,3.0,1.4]	3
[50001.0,32.6,100.3,42.3,600.0,0.0,4.3,2.7,2.4,1.4]	0
[50007.0,33.0,100.3,45.2,600.0,4.8,2.4,0.0,2.4,1.1]	0
[50007.0,32.9,100.5,45.2,600.0,16.1,0.2,7.9,8.1,1.1]	0
[50007.0,32.6,100.3,40.9,600.0,16.1,0.0,2.9,6.3,1.1]	0
[11007.0,27.0,100.1,61.7,600.0,3.8,1.9,3.3,3.0,1.1]	0
[20002.0,28.8,100.3,56.1,600.0,1.7,1.5,3.3,2.2,1.1]	0
[45458.0,29.6,100.3,42.6,600.0,3.0,2.5,1.8,2.5,1.1]	0
[20001.0,24.1,101.55,43.6,488.0,3.24,3.62,2.18,3.01,2.5]	0
[69500.0,24.1,101.55,43.6,803.0,3.47,3.31,3.28,3.35,2.5]	3
[104568.0,24.1,101.55,43.6,3465.0,2.51,2.63,2.4,2.51,2.5]	3
[2001.0,24.1,101.55,43.6,624.0,0.98,1.36,5.21,2.52,2.5]	0
[195554.0,24.1,101.55,43.6,2093.0,3.54,3.34,2.33,3.07,2.5]	3
[59812.0,24.1,101.55,43.6,746.0,12.32,10.28,7.66,10.09,2.5]	3
[59812.0,24.1,101.55,43.6,792.0,8.48,1.22,9.09,6.26,2.5]	3
[59812.0,24.1,101.55,43.6,765.0,11.22,7.93,6.96,8.7,2.5]	3
[59812.0,24.1,101.55,43.6,1827.0,2.54,2.34,3.6,2.83,2.5]	3
[80001.0,29.1,101.3,97.3,0.0,1.34,1.17,1.18,1.23,0.81]	3
[24550.0,29.6,101.3,80.7,0.0,1.03,1.02,1.02,1.02,0.7]	0
[40000.0,29.7,101.2,77.5,0.0,16.06,16.06,16.06,16.06,1.31]	0
[17001.0,32.5,101.9,65.9,0.0,0.76,0.78,0.79,0.78,0.75]	0
[22300.0,25.0,101.3,72.0,0.0,0.81,0.8,0.8,0.8,0.75]	0
[24550.0,25.4,101.3,72.0,0.0,0.76,0.77,0.76,0.76,0.7]	0
[50.0,24.4,101.7,69.4,0.0,0.68,0.78,0.78,0.75,0.52]	0
[12345.0,28.2,101.0,62.0,800.0,1.45,0.64,0.06,0.72,0.54]	0
[12345.0,30.4,101.0,54.0,800.0,2.71,1.0,2.61,2.11,1.06]	0
[12345.0,29.6,101.0,62.0,800.0,3.57,0.69,1.3,1.85,0.97]	0
[12345.0,35.9,101.0,52.0,829.0,1.27,3.55,0.71,1.84,0.97]	0
[12345.0,31.9,101.0,68.0,708.0,3.62,3.34,3.1,3.35,1.54]	0
[12345.0,30.9,101.0,52.0,1000.0,5.7,6.02,0.13,3.95,0.91]	0
[12345.0,32.3,101.0,52.0,725.0,1.65,2.89,0.18,1.57,1.07]	0
[12345.0,32.7,101.0,80.0,583.0,1.5,1.55,1.34,1.46,1.13]	0
[12345.0,32.0,101.0,80.0,0.0,1.9,2.91,1.63,2.15,1.13]	0
[12345.0,32.8,101.0,68.0,928.0,2.01,0.53,0.95,1.16,0.81]	0
[12345.0,23.0,101.0,50.0,800.0,0.87,0.9,0.91,0.89,0.88]	0
[12345.0,22.0,101.0,52.0,800.0,5.76,1.27,0.87,2.63,2.08]	0
[12345.0,22.0,101.0,54.0,800.0,0.07,0.08,4.65,1.6,1.54]	0
[12345.0,25.0,101.0,52.0,800.0,0.13,0.31,3.28,1.24,1.17]	0
[12345.0,27.0,101.0,52.0,800.0,0.79,1.09,1.49,1.12,1.04]	0
[12345.0,29.0,101.0,45.0,800.0,2.83,1.54,0.45,1.61,1.38]	0
[12345.0,28.0,101.0,58.0,800.0,5.19,0.12,0.11,1.81,1.33]	0
[12345.0,29.0,101.0,50.0,800.0,320.21,0.1,0.11,106.81,2.64]	0
[12345.0,28.0,101.0,48.0,800.0,0.25,2.78,2.86,1.96,1.42]	0
[12345.0,28.0,101.0,50.0,800.0,2.66,3.21,2.33,2.73,1.46]	0
[12345.0,27.0,101.0,48.0,800.0,4.95,0.32,2.22,2.5,1.4]	0
[40000.0,25.5,100.1,56.3,0.0,5.1,3.9,3.3,4.1,0.7]	0
[12345.0,29.7,101.1,74.4,800.0,0.14,8.23,3.35,3.91,2.5]	0
[12345.0,32.5,101.1,59.7,800.0,5.0,3.27,0.55,2.94,2.5]	0
[12345.0,27.4,101.1,82.4,800.0,5.19,3.52,0.03,2.91,2.5]	0
[12345.0,30.0,101.1,99.0,800.0,2.7,2.26,3.84,2.93,2.5]	0
[12345.0,28.8,101.1,99.0,800.0,4.81,3.33,2.62,3.59,2.5]	0
[12345.0,35.9,101.1,65.6,800.0,2.2,2.45,3.01,2.55,2.5]	0
[62101.0,25.4,99.6,33.0,800.0,2.4,0.1,1.9,1.5,1.3]	3
[20000.0,21.2,99.2,78.7,800.0,2.8,1.4,0.7,1.6,1.4]	0
[60000.0,31.3,98.3,38.0,800.0,2.1,1.8,1.6,1.9,1.3]	3
[152500.0,25.5,101.3,60.5,800.0,1.8,2.6,0.4,1.6,1.3]	3
[10000.0,32.8,100.9,95.0,800.0,4.4,2.9,2.2,3.2,3.0]	0
[50200.0,35.8,101.3,67.6,800.0,2.6,2.5,2.5,2.5,1.1]	0
[65201.0,36.4,101.1,83.9,800.0,1.1,1.1,4.5,2.2,1.6]	3
[53419.0,34.3,101.0,78.6,800.0,3.6,3.5,3.5,3.5,1.5]	0
[46103.0,36.1,101.3,77.0,508.0,2.4,1.0,7.5,3.6,3.0]	0
[70000.0,32.2,100.9,82.6,781.0,0.6,0.6,3.4,1.5,1.1]	3
[87545.0,33.4,101.5,89.4,810.0,0.8,0.8,3.4,1.7,1.5]	3
[30159.0,23.4,100.7,83.4,0.0,0.0,0.0,0.0,0.0,1.5]	0
[72169.0,34.5,100.0,85.2,0.0,1.44,1.26,3.49,2.06,1.5]	3
[61028.0,30.7,99.7,84.8,0.0,11.92,8.7,5.82,8.81,0.8]	3
[82917.0,26.4,100.0,84.8,0.0,1.14,0.0,0.0,0.0,1.4]	3
[94135.0,30.1,100.2,84.8,0.0,0.0,0.0,0.0,0.0,1.5]	3
[20025.0,21.5,101.1,56.2,0.0,1.7,1.7,1.9,1.7,1.6]	0
[10354.0,21.5,101.1,56.2,0.0,1.6,1.9,1.8,1.7,0.7]	0
[25841.0,21.5,101.1,56.2,0.0,0.8,0.9,0.9,0.9,0.7]	0
[30001.0,21.5,101.1,56.2,0.0,1.6,2.1,1.4,1.7,0.8]	0
[69000.0,21.5,101.1,56.2,0.0,1.2,2.1,1.9,1.8,1.3]	3
[10042.0,21.5,101.1,56.2,0.0,2.1,1.7,2.0,1.9,1.2]	0
[52456.0,21.5,101.1,56.2,0.0,1.2,1.3,2.2,1.6,1.4]	0
[50001.0,21.5,101.1,56.2,0.0,1.5,1.4,1.4,1.4,1.3]	0
[65584.0,21.5,101.1,56.2,0.0,1.3,1.4,1.7,1.5,1.3]	3
[70001.0,21.5,101.1,56.2,0.0,1.9,1.7,1.8,1.8,1.7]	3
[70052.0,21.5,101.1,56.2,0.0,1.6,2.1,2.1,1.9,1.3]	3
[26598.0,29.3,109.8,38.2,600.0,1.6,1.1,1.9,1.5,1.3]	0
[85101.0,28.5,110.8,49.0,600.0,4.5,1.1,0.6,2.0,1.7]	3
[31410.0,27.0,101.9,47.0,600.0,1.4,1.5,1.0,1.3,1.3]	0
[92100.0,28.1,109.8,51.4,600.0,0.2,1.0,3.9,1.7,1.7]	3
[152429.0,27.2,109.9,52.9,1062.0,2.1,2.1,1.0,1.7,1.4]	3
[200764.0,26.1,102.0,52.1,707.0,5.2,3.7,2.2,3.7,2.5]	3
[91780.0,25.5,101.9,49.4,829.0,1.6,1.6,1.5,1.6,1.4]	3
[117940.0,27.8,109.9,51.2,751.0,8.6,3.7,4.9,5.7,2.5]	3
[354835.0,28.4,109.9,50.3,532.0,1.8,4.5,1.4,2.6,2.5]	2
[71200.0,24.7,110.0,55.2,0.0,2.6,2.9,3.0,2.9,1.1]	3
[66854.0,27.7,110.0,54.4,538.0,2.6,2.6,2.5,2.6,1.4]	3
[80489.0,27.3,109.9,51.5,0.0,1.9,2.0,2.6,2.1,1.4]	3
[38749.0,27.4,109.9,51.6,821.0,6.3,3.0,1.7,3.6,3.0]	0
[285625.0,27.3,109.9,43.8,713.0,8.3,2.4,0.1,3.6,3.0]	2
[123669.0,28.0,110.0,52.7,0.0,1.4,2.8,1.5,1.9,1.7]	3
      

  

轉載于:https://www.cnblogs.com/RHadoop-Hive/p/10142384.html