Pyspark Params class has a method hasParam(paramName) which returns True if the class has a parameter by that name, but throws an AttributeError otherwise. There is not currently a way of getting a Boolean to indicate if a class has a parameter. With Spark 2.0 we could modify the existing behavior of hasParam or add an additional method with this functionality.
> AttributeError: 'NaiveBayes' object has no attribute 'notAParam'
However, in Scala: