Examples of computeCost()


Examples of org.apache.spark.mllib.clustering.KMeansModel.computeCost()

    System.out.println("Cluster centers:");
    for (Vector center : model.clusterCenters()) {
      System.out.println(" " + center);
    }
    double cost = model.computeCost(points.rdd());
    System.out.println("Cost: " + cost);

    System.exit(0);
  }
}
View Full Code Here

Examples of org.apache.spark.mllib.clustering.KMeansModel.computeCost()

    System.out.println("Cluster centers:");
    for (Vector center : model.clusterCenters()) {
      System.out.println(" " + center);
    }
    double cost = model.computeCost(points.rdd());
    System.out.println("Cost: " + cost);

    sc.stop();
  }
}
View Full Code Here

Examples of rinde.sim.pdptw.common.ObjectiveFunction.computeCost()

        .add(ImmutableList.<ParcelDTO> of(d, d))
        .build();

    final StatisticsDTO stats = Solvers.computeStats(state, routes);
    final ObjectiveFunction objFunc = new Gendreau06ObjectiveFunction();
    final double cost = objFunc.computeCost(stats);

    final double cost0 = objFunc.computeCost(Solvers.computeStats(
        state.withSingleVehicle(0),
        ImmutableList.of(routes.get(0))));
    final double cost1 = objFunc.computeCost(Solvers.computeStats(
View Full Code Here

Examples of rinde.sim.pdptw.common.ObjectiveFunction.computeCost()

    final StatisticsDTO stats = Solvers.computeStats(state, routes);
    final ObjectiveFunction objFunc = new Gendreau06ObjectiveFunction();
    final double cost = objFunc.computeCost(stats);

    final double cost0 = objFunc.computeCost(Solvers.computeStats(
        state.withSingleVehicle(0),
        ImmutableList.of(routes.get(0))));
    final double cost1 = objFunc.computeCost(Solvers.computeStats(
        state.withSingleVehicle(1),
        ImmutableList.of(routes.get(1))));
View Full Code Here

Examples of rinde.sim.pdptw.common.ObjectiveFunction.computeCost()

    final double cost = objFunc.computeCost(stats);

    final double cost0 = objFunc.computeCost(Solvers.computeStats(
        state.withSingleVehicle(0),
        ImmutableList.of(routes.get(0))));
    final double cost1 = objFunc.computeCost(Solvers.computeStats(
        state.withSingleVehicle(1),
        ImmutableList.of(routes.get(1))));
    assertEquals(cost, cost0 + cost1, 0.001);
  }
View Full Code Here

Examples of rinde.sim.pdptw.gendreau06.Gendreau06ObjectiveFunction.computeCost()

      final GlobalStateObject solverInput = dsc.solver.getInputs().get(0);
      final ImmutableList<ImmutableList<ParcelDTO>> solverOutput = dsc.solver
          .getOutputs().get(0);

      assertEquals(obj.computeCost(results.results.get(0).stats),
          objValInMinutes, 0.2);

      final StatisticsDTO stats = Solvers.computeStats(solverInput,
          solverOutput);
      assertTrue(stats.toString(), obj.isValidResult(stats));
View Full Code Here

Examples of rinde.sim.pdptw.gendreau06.Gendreau06ObjectiveFunction.computeCost()

          objValInMinutes, 0.2);

      final StatisticsDTO stats = Solvers.computeStats(solverInput,
          solverOutput);
      assertTrue(stats.toString(), obj.isValidResult(stats));
      assertEquals(objValInMinutes, obj.computeCost(stats), 0.1);
      assertEquals(objValInMinutes,
          decomposedCost(solverInput, solverOutput, obj), 0.01);
    }
  }
View Full Code Here

Examples of rinde.sim.pdptw.gendreau06.Gendreau06ObjectiveFunction.computeCost()

      final double travelTime = obj.travelTime(stats);

      assertEquals(arrOverTime, obj.overTime(stats), 0.001);
      assertEquals(arrTravelTime, travelTime, 0.01);
      assertEquals(arrTardiness, tardiness, 0.001);
      assertEquals(arrObjVal, obj.computeCost(stats), 0.01);
      assertEquals(arrObjVal,
          decomposedCost(solverInput, solverOutput, obj), 0.01);
    }
  }
View Full Code Here

Examples of rinde.sim.pdptw.gendreau06.Gendreau06ObjectiveFunction.computeCost()

        .add(ImmutableList.<ParcelDTO> of(d, d))
        .build();

    final StatisticsDTO stats = Solvers.computeStats(state, routes);
    final ObjectiveFunction objFunc = new Gendreau06ObjectiveFunction();
    final double cost = objFunc.computeCost(stats);

    final double cost0 = objFunc.computeCost(Solvers.computeStats(
        state.withSingleVehicle(0),
        ImmutableList.of(routes.get(0))));
    final double cost1 = objFunc.computeCost(Solvers.computeStats(
View Full Code Here

Examples of rinde.sim.pdptw.gendreau06.Gendreau06ObjectiveFunction.computeCost()

    final StatisticsDTO stats = Solvers.computeStats(state, routes);
    final ObjectiveFunction objFunc = new Gendreau06ObjectiveFunction();
    final double cost = objFunc.computeCost(stats);

    final double cost0 = objFunc.computeCost(Solvers.computeStats(
        state.withSingleVehicle(0),
        ImmutableList.of(routes.get(0))));
    final double cost1 = objFunc.computeCost(Solvers.computeStats(
        state.withSingleVehicle(1),
        ImmutableList.of(routes.get(1))));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.