public void setFileName ( ) { String type = "" ; // lenskit does not provide a factorizer class. This check is to actually see if it's a Mahout or Lenskit SVD. if ( properties . containsKey ( RecommendationRunner . FACTORIZER ) || properties . containsKey ( RecommendationRunner . SIMILARITY ) ) { if ( properties . containsKey ( RecommendationRunner . FACTORIZER ) ) { type = properties . getProperty ( RecommendationRunner . FACTORIZER ) ; } else { type = properties . getProperty ( RecommendationRunner . SIMILARITY ) ; } type = type . substring ( type . lastIndexOf ( "." ) + 1 ) + "." ; } String num = "" ; if ( properties . containsKey ( RecommendationRunner . FACTORS ) || properties . containsKey ( RecommendationRunner . NEIGHBORHOOD ) ) { if ( properties . containsKey ( RecommendationRunner . FACTORS ) ) { num = properties . getProperty ( RecommendationRunner . FACTORS ) ; } else { num = properties . getProperty ( RecommendationRunner . NEIGHBORHOOD ) ; } num += "." ; } String trainingSet = properties . getProperty ( RecommendationRunner . TRAINING_SET ) ; trainingSet = trainingSet . substring ( trainingSet . lastIndexOf ( "/" ) + 1 , trainingSet . lastIndexOf ( "_train" ) ) ; fileName = trainingSet + "." + properties . getProperty ( RecommendationRunner . FRAMEWORK ) + "." + properties . getProperty ( RecommendationRunner . RECOMMENDER ) . substring ( properties . getProperty ( RecommendationRunner . RECOMMENDER ) . lastIndexOf ( "." ) + 1 ) + "." + type + num + "tsv" ; System . out . println ( fileName ) ; }
Create the file name of the output file .