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

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


     * this.setModel(model); </code>
     *
     *
     */
    public Model createAndSetModel() {
        Model newValue = new Model();
        this.setModel(newValue);
        return newValue;
    }
View Full Code Here


  public boolean acceptFeature(Feature feature) {
    return this.styleFilter.match(feature);
  }

  public Model getKmlModel(Feature feature, Point point) {
    Model kmlModel = KmlFactory.createModel()
        .withId(feature.getName().toString())
        .withAltitudeMode(getAltitudeMode(feature, point));
    kmlModel.createAndSetLocation().withLongitude(point.getCoordinate().x)
        .withLatitude(point.getCoordinate().y)
        .withAltitude(getAltitude(feature, point));
    kmlModel.createAndSetOrientation()
        .withHeading(
            getGenericRotationValue(feature, model.getHeading()))
        .withTilt(getGenericRotationValue(feature, model.getTilt()))
        .withRoll(getGenericRotationValue(feature, model.getRoll()));
    kmlModel.createAndSetLink()
        .withHref(
            styleFilter.getExpressionValue(model.getHref(), feature))
        .withRefreshMode(RefreshMode.ON_CHANGE);
    return kmlModel;
  }
View Full Code Here

  public Kml getKml() {
    return kml;
  }

  private void addPoint(Feature feature, Point point, List<KmlModel> kmlModels) {
    Model kmlModel = getKmlModel(feature, point, kmlModels);
    if (kmlModel != null) {
      Placemark placemark = new Placemark().withName(feature.getName()
          .toString());
      placemark.createAndSetLookAt()
          .withLongitude(point.getCoordinate().x)
View Full Code Here

  }

  public static void runComponents(String filePath) {
    JavaEngineParams engineParams = new JavaEngineParamsBuilder()
      .dataSourceParams(new DataSourceParams(filePath))
      .addAlgorithmParams("MyRecommendationAlgo", new AlgoParams(0.2)) // Add Algorithm Params
      .build();

    JavaWorkflow.runEngine(
      (new HalfBakedEngineFactory()).apply(),
      engineParams,
View Full Code Here

public class Runner3 {

  public static void runEvaluation(String filePath) {
    JavaEngineParams engineParams = new JavaEngineParamsBuilder()
      .dataSourceParams(new DataSourceParams(filePath))
      .addAlgorithmParams("MyRecommendationAlgo", new AlgoParams(0.2))
      .build();

    JavaWorkflow.runEngine(
      (new EngineFactory()).apply(),
      engineParams,
View Full Code Here

public class Runner5 {

  public static void runEvaluation(String filePath) {
    JavaEngineParams engineParams = new JavaEngineParamsBuilder()
      .dataSourceParams(new DataSourceParams(filePath))
      .addAlgorithmParams("MyMahoutRecommendationAlgo",
        new MahoutAlgoParams("LogLikelihoodSimilarity"))
      .build();

    JavaWorkflow.runEngine(
View Full Code Here

    }
  }

  public static void runComponents(String filePath) {
    JavaEngineParams engineParams = new JavaEngineParamsBuilder()
      .dataSourceParams(new DataSourceParams(filePath))
      .build();

    JavaWorkflow.runEngine(
      (new HalfBakedEngineFactory()).apply(),
      engineParams,
View Full Code Here

    }
  }

  public static void runComponents(String filePath) {
    JavaEngineParams engineParams = new JavaEngineParamsBuilder()
      .dataSourceParams(new DataSourceParams(filePath))
      .addAlgorithmParams("MyRecommendationAlgo", new AlgoParams(0.2)) // Add Algorithm Params
      .build();

    JavaWorkflow.runEngine(
      (new HalfBakedEngineFactory()).apply(),
View Full Code Here

public class Runner3 {

  public static void runEvaluation(String filePath) {
    JavaEngineParams engineParams = new JavaEngineParamsBuilder()
      .dataSourceParams(new DataSourceParams(filePath))
      .addAlgorithmParams("MyRecommendationAlgo", new AlgoParams(0.2))
      .build();

    JavaWorkflow.runEngine(
      (new EngineFactory()).apply(),
View Full Code Here

  private List<Tuple2<Query, Float>> prepareValidation(List<TrainingData.Rating> testRatings) {
    List<Tuple2<Query, Float>> validationList = new ArrayList<Tuple2<Query, Float>>();

    for (TrainingData.Rating r : testRatings) {
      validationList.add(new Tuple2<Query, Float>(
        new Query(r.uid, r.iid),
        r.rating));
    }

    return validationList;
  }
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.