IBMPredictiveAnalytics / K_Means_with_MLlib

SPSS Modeler Extension to execute PySpark MLlib implementation of K-Means Clustering
Apache License 2.0
2 stars 5 forks source link

building model without any predictors should report an appropriate error #2

Closed ghost closed 7 years ago

ghost commented 8 years ago

With no predictor fields defined in the node, the error is currently:

[2016-05-12 11:36:35] AEQAE4805E: Execution failed. Reason: Traceback (most recent call last): File "/home/niallm/Tools/modelerclient_18.0.0.0.51/tmp/17267/ae/154a48a14ec-49c61f00a4784257/as.py", line 249, in model = KMeans.train(lp,k=k_param,epsilon=epsilon_param,maxIterations=max_iterations_param,seed=seed_param,runs=runs_param,initializationSteps=initialization_steps_param,initializationMode=initialization_mode_param)

File "/home/niallm/Tools/modelerclient_18.0.0.0.51/spark/python/lib/pyspark.zip/pyspark/serializers.py", line 263, in dump_stream vs = list(itertools.islice(iterator, batch)) File "/home/niallm/Tools/modelerclient_18.0.0.0.51/tmp/17267/ae/154a48a14ec-49c61f00a4784257/as.py", line 100, in mapFn predictor_index = lookup[predictor] KeyError: '' We should have the script throw an error which explains the problem and how to fix it.
ghost commented 7 years ago

Fixed. The UI now defines the predictor list as a required field, and prevents execution whilst it is empty