mahout-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mirko Gontek <mirko.gon...@uni-koeln.de>
Subject FileDataModel throws UnsupportedOperationException
Date Wed, 22 Apr 2009 08:59:20 GMT
Hi,
I experiment with Taste's FileDataModel to get a simple file-based  
example running. Getter methods are working, but getPreference() and  
removePreference() throw java.lang.UnsupportedOperationExceptions. Do  
I get something wrong here? Here is my test code:

File f = new File("input/data.csv");
logger.debug(f.canWrite()); // true
DataModel model = new FileDataModel(f);
logger.debug("items "+ model.getNumItems()); // 3
logger.debug("users "+ model.getNumUsers()); // 3
Object[] prefs = model.getPreferencesForItemAsArray("evolution");
logger.debug("prefs for evolution: "+prefs.length); // 1

model.setPreference("tom", "physics", new Double(0.1)); // THROWS  
EXCEPTION
// model.removePreference("tom","evolution"); // THROWS EXCEPTION

java.lang.UnsupportedOperationException
	at  
org 
.apache 
.mahout 
.cf 
.taste.impl.model.file.FileDataModel.setPreference(FileDataModel.java: 
322)

The content of input/data.csv is:

tom,evolution,1
anna,human,0
tim,biology,1

Thanks for your help! Mirko


Mime
View raw message