Package org.apache.mahout.cf.taste.impl.model

Examples of org.apache.mahout.cf.taste.impl.model.GenericItemPreferenceArray


    itemIDsFromUser456.add(2L);

    List<Preference> prefs = Lists.newArrayList();
    prefs.add(new GenericPreference(123L, 1L, 1.0f));
    prefs.add(new GenericPreference(456L, 1L, 1.0f));
    PreferenceArray preferencesForItem1 = new GenericItemPreferenceArray(prefs);

    DataModel dataModel = EasyMock.createMock(DataModel.class);
    EasyMock.expect(dataModel.getPreferencesForItem(1L)).andReturn(preferencesForItem1);
    EasyMock.expect(dataModel.getItemIDsFromUser(123L)).andReturn(itemIDsFromUser123);
    EasyMock.expect(dataModel.getItemIDsFromUser(456L)).andReturn(itemIDsFromUser456);
View Full Code Here


        qitems = new OpenIntObjectHashMap<PreferenceArray>(
                dataModel.getNumItems());
        list = (IntArrayList) dataModel.getItemIDs();
        for (int i = 0; i < list.size(); i++) {
            int key = list.get(i);
            PreferenceArray value = new GenericItemPreferenceArray(key,
                    parameter_k);
            qitems.put(key, value);
        }
    }
View Full Code Here

                dataModel.getNumItems());
        y = new OpenIntObjectHashMap<PreferenceArray>(dataModel.getNumItems());
        list = (IntArrayList) dataModel.getItemIDs();
        for (int i = 0; i < list.size(); i++) {
            int key = list.get(i);
            PreferenceArray value = new GenericItemPreferenceArray(key,
                    parameter_k);
            qitems.put(key, value);

            value = new GenericItemPreferenceArray(key, parameter_k);
            y.put(key, value);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.mahout.cf.taste.impl.model.GenericItemPreferenceArray

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.