Home > other >  Spark run logistic Regression parameter number does not match
Spark run logistic Regression parameter number does not match

Time:10-07

I am a novice, now run by spark logistic Regression has encountered the following problems, my personal problem: my training set is 5 column data, I set up the user. The log is also five arguments, why would say do not match, the great spirit guide, specific information is as follows,

Scala> Val data=https://bbs.csdn.net/topics/spark.sparkContext.
| textFile (" file:////media/sf_shared_file/train.csv ").
| map (_. The split () ", ").
| map (p=& gt; User_log (Vectors. Dense (p (0). ToDouble, p (1). ToDouble, p (2). ToDouble, p (3). ToDouble, p (4). The toString))). ToDF ()
: 35: error: not enough arguments for method apply: (the features: org. Apache. Spark. Ml. Linalg. Vector, lable: Double) user_log in object user_log.
Unspecified value parameter lable.
The map (p=& gt; User_log (Vectors. Dense (p (0). ToDouble, p (1). ToDouble, p (2). ToDouble, p (3). ToDouble, p (4). The toString))). ToDF ()
^

Class user_log
Case class user_log (the features: org. Apache. Spark. Ml. Linalg. Vector, lable: Double)

"Train". CSV:
User_id age_range gender merchant_id label
34176 6 0 944-1
34176 6 0 412-1
34176 6 0 1945-1
6 0 4752-1 34176

CodePudding user response:

The map (p=& gt; User_log ( Vectors. Dense (p (0). ToDouble, p (1). ToDouble, p (2). ToDouble, p (3). ToDouble) , p (4). The toString)))
  • Related