0

I currently have two separate ARFF files for use in a Java program i'm writing that uses WEKAs machine learning algorithms. The two files are in the format:

@attribute movieID numeric
@attribute title {whole, host, of, movie, titles}
@attribute genres {whole, list, of, genres}

and

@attribute movieID numeric
@attribute tags {very, long, list, of, possible, tags}
@attribute timestamp numeric

In an ideal world i am looking to 'join' these two files by their movieID's so the relevant tags would be assigned to the movies however i am not sure if this is possible? Having had a fair old search i'm not sure exactly how to go about this or in general to create a single dataset for use with the rest of the program with studies association rules. Any help would be greatly appreciated

  • This isn't a very sophisticated solution but, I would convert the two ARFF files to .csv within Weka. Then using Excel or something similar, I would open each file and sort the movieID's, then simply combine the two files by copying the different columns. After that, I would use Weka to read in the csv and resave as a .arff. – Walter Feb 25 '16 at 16:38

1 Answers1

0

foreign package in R is capable of reading and writing ARFF files.

  • You can first read both files in two different data frames in R (see here).

  • Then use the "merge" command to join the data frames in any way you need (see here).

  • Finally, you can easily write the new data frame in a new ARFF file (see here).

Community
  • 1
  • 1
TrnKh
  • 758
  • 1
  • 7
  • 13