You are using it correctly. I think the API is a little bad in that the method is only declared on the abstract superclass of common implementations, and not in the interfaces. So, your cast is needed, but maybe shouldn't be.
In general, I would advise you to avoid preference transforms. They are there mostly because some papers suggested this transformation, but I think it rarely gives a benefit worth the computation cost. Still, yes, you are using it correctly, and if it works well for you, go ahead. On Thu, Aug 18, 2011 at 7:23 PM, Alan Said <[email protected]> wrote: > Hi all, > I'm trying to figure out what the correct way of using a > PreferenceTransform is. > > Having looked into the JavaDoc's I've got something which seems to generate > ok results, not quite sure whether this is correct though. Would appreciate > a comment on if this actually is the correct way to use it, and if not a > pointer to where I could find information on this. > > What I do currently is apply the transform on the similarity class like so > > PreferenceTransform iuf = new InverseUserFrequency(**dataModel, logBase); > UserSimilarity pearsonSim = new PearsonCorrelationSimilarity(**dataModel); > ((**PearsonCorrelationSimilarity)**pearsonSim).setPrefTransform(**iuf); > > After this I pass the similarity to my neighborhood and recommender. > Without the cast on the last line it won't compile. > > Thanks, > > Alan > -- > ***************************************** > M.Sc.(Eng.) Alan Said > Competence Center Information Retrieval& Machine Learning > Technische Universität Berlin DAI-Labor Sekr. TEL 14 Ernst-Reuter-Platz 7 > 10587 Berlin / Germany > Phone: 0049 - 30 - 314 74072 > Fax: 0049 - 30 - 314 74003 > E-mail: [email protected] > http://www.dai-labor.de > ***************************************** > >
