I made a list of feature list. I want to train a model for each feature list to test which feature list is the best
Finally I want to save the model with the name of the feature list used... How to get this name???
I saw this post: In Scala, how do I get the *name* of an `object` (not an instance of a class)?
But when I do:
featureList1.getClass.getName
I get:
String = [Ljava.lang.String;
I want to get
java.lang.String = featureList1$
Here is my code:
val featureList1 = ["feature1", "feature2", "feature3"]
val featureList2 = ["feature1", "feature3", "feature4"]
val featureList3 = ["feature5", "feature6", "feature7"]
val liste_featureList_to_test = List(featureList1, featureList2, featureList3)
for (featureList <- liste_featureList_to_test) {
model_RF = trainModel (train, featureList)
nomFeaturesList = ?????
model_RF.write.overwrite.save("models/" + nomFeaturesList)
}
Thank you everyone