[SPARK-4494] IDFModel.transform() add support for single vector

I improved `IDFModel.transform` to allow using a single vector.

[[SPARK-4494] IDFModel.transform() add support for single vector - ASF JIRA](https://issues.apache.org/jira/browse/SPARK-4494)
It might be good to support native Python vector/array types, as in pyspark's LogisticRegressionModel.predict method in classification.py