Package org.apache.hama.ml.recommendation.cf

Examples of org.apache.hama.ml.recommendation.cf.OnlineCF$Settings


            if(select2Field == null) {
                entityLink.setRequired(getModel().isRequired());
                select2Field = Select2ChoiceUtil.newSelect2Choice(ID_AUTO_COMPLETE, model, getModel());
                setProviderAndCurrAndPending(select2Field, getModel().getActionArgsHint());
                if(!getModel().hasChoices()) {
                    final Settings settings = select2Field.getSettings();
                    final int minLength = getModel().getAutoCompleteMinLength();
                    settings.setMinimumInputLength(minLength);
                    settings.setPlaceholder(getModel().getName());
                }
                entityLink.addOrReplace(select2Field);
            } else {
                //
                // the select2Field already exists, so the widget has been rendered before.  If it is
View Full Code Here


                    }
                    setResponsePage(EntityPage.class, selectedModel.getPageParameters());
                }
            });
       
        final Settings settings = breadcrumbChoice.getSettings();
        settings.setMinimumInputLength(0);
        settings.setWidth("100%");
       
        breadcrumbChoice.setProvider(new TextChoiceProvider<EntityModel>() {

            private static final long serialVersionUID = 1L;
View Full Code Here

        if(select2Field == null) {
            select2Field = new Select2Choice<ObjectAdapterMemento>(ID_AUTO_COMPLETE, model);
            setProviderAndCurrAndPending(select2Field, getScalarModel().getActionArgsHint());
            if(!getScalarModel().hasChoices()) {
                final Settings settings = select2Field.getSettings();
                ScalarModel scalarModel = getScalarModel();
                final int minLength = scalarModel.getAutoCompleteMinLength();
                settings.setMinimumInputLength(minLength);
                settings.setPlaceholder(scalarModel.getName());
            }
            addOrReplace(select2Field);
        } else {
            //
            // the select2Field already exists, so the widget has been rendered before.  If it is
View Full Code Here

      fileOut.close();
     
      MovieLensConverter converter = new MovieLensConverter();
      assertEquals(true, converter.convert(strDataPath, null, convertedFileName));
     
      OnlineCF recommender = new OnlineCF();
      recommender.setInputPreferences(convertedFileName);
      recommender.setIteration(150);
      recommender.setMatrixRank(3);
      recommender.setSkipCount(1);
      recommender.setTaskCount(2);
      recommender.setUpdateFunction(MeanAbsError.class);
      recommender.setOutputPath(outputFileName);
      assertEquals(true, recommender.train());

      recommender.load(outputFileName, false);
      int correct = 0;
      for (Preference<Integer, Integer> test : test_prefs) {
        double actual = test.getValue().get();
        double estimated = recommender.estimatePreference(test.getUserId(), test.getItemId());
        correct += (Math.abs(actual-estimated)<0.5)?1:0;
      }

      assertEquals(test_prefs.length*0.75, correct, 1);

View Full Code Here

TOP

Related Classes of org.apache.hama.ml.recommendation.cf.OnlineCF$Settings

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.