Slightly confused on the usage of VectorIndexer or OneHotEncoder , when dealing with categorical variables as input to ML algorithms in Spark. Is it that when I need to know the