You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spark.apache.org by hagersaleh <ha...@gmail.com> on 2018/10/01 09:55:49 UTC

why y.size is 65536 but y size in new dataset is 1000

please help me, code write in spark by python
error is

Caused by: java.lang.IllegalArgumentException: requirement failed:
BLAS.dot(x: Vector, y:Vector) was given Vectors with non-matching sizes:
x.size = 1000, y.size = 65536

why y.size is 65536 but y size in new dataset is 1000

1-I train model on spark using sentiment140 dataset and LogisticRegression
2- I save model on computer
lrModel.save("hager")
3- when I load model to test new data set 
from pyspark.ml.classification import LogisticRegressionModel
loadmodel=LogisticRegressionModel.load("hager")
4-when I calculate accuracy
predictions=loadmodel.transform(df)
from pyspark.ml.evaluation import BinaryClassificationEvaluator
evaluator = BinaryClassificationEvaluator(rawPredictionCol="rawPrediction")
evaluator.evaluate(predictions)

#accurcy
accuracy = predictions.filter(predictions.label ==
predictions.prediction).count() / float(val_set.count())
accuracy



--
Sent from: http://apache-spark-developers-list.1001551.n3.nabble.com/

---------------------------------------------------------------------
To unsubscribe e-mail: dev-unsubscribe@spark.apache.org