Package io.prediction.examples.java.recommendations.tutorial1

Examples of io.prediction.examples.java.recommendations.tutorial1.Model


      // create a new ArrayList because subList() returns view and not serialzable
      List<TrainingData.Rating> trainingRatings =
        new ArrayList<TrainingData.Rating>(ratings.subList(0, trainingEndIndex));
      List<TrainingData.Rating> testRatings = ratings.subList(trainingEndIndex, testEndIndex);
      TrainingData td = new TrainingData(trainingRatings);
      List<Tuple2<Query, Float>> qaList = prepareValidation(testRatings);

      data.add(new Tuple3<Object, TrainingData, Iterable<Tuple2<Query, Float>>>(
        null, td, qaList));
    }
View Full Code Here


    /**
     * Find the Model of a ressource (UML2 Model)
     */
    public static Model findModel(final UML2Resource resource)
    {
        Model model = (Model)EcoreUtil.getObjectByType(
                resource.getContents(),
                EcorePackage.eINSTANCE.getEObject());
        if (logger.isDebugEnabled())
        {
            logger.debug("Model found: " + model);
View Full Code Here

            null);
        final ModelAccessFacade modelFacade = repository.getModel();
        assertNotNull(modelFacade);
        assertNotNull(modelFacade.getModel());
        assertTrue(modelFacade.getModel() instanceof UML2Resource);
        Model model = (Model)EcoreUtil.getObjectByType(
            ((UML2Resource)repository.getModel().getModel()).getContents(),
            EcorePackage.eINSTANCE.getEObject());
        assertEquals(
            "Test Model",
            model.getName());
        Collection elements = UML2Util.findNamedElements(
                model.eResource(),
                "Test Model::testPackage::Top",
                true);
        org.eclipse.uml2.Class umlClass = (org.eclipse.uml2.Class)elements.iterator().next();
        assertEquals(
            "Top",
View Full Code Here

    }
    return null;
  }

  private Package addPackage(String name, ModelAccessFacade model) {
    Model m = (Model) ((UML2Resource) model.getModel()).getContents()
        .get(0);
    return m.createNestedPackage(name);
  }
View Full Code Here

TOP

Related Classes of io.prediction.examples.java.recommendations.tutorial1.Model

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.