Exemplo n.º 1
0
  def test_ib_recommender(self):
    ctx = blob_ctx.get()

    rating_table = expr.sparse_rand((N_USERS, N_ITEMS), 
                                    dtype=np.float64, 
                                    density=0.1, 
                                    format = "csr",
                                    tile_hint=(N_USERS, N_ITEMS/ctx.num_workers))
    model = ItemBasedRecommender(rating_table)
    model.precompute()
Exemplo n.º 2
0
    def test_ib_recommender(self):
        ctx = blob_ctx.get()

        FLAGS.opt_auto_tiling = 0
        rating_table = expr.sparse_rand(
            (N_USERS, N_ITEMS),
            dtype=np.float64,
            density=0.1,
            format="csr",
            tile_hint=(N_USERS, N_ITEMS / ctx.num_workers))
        model = ItemBasedRecommender(rating_table)
        model.precompute()
Exemplo n.º 3
0
def benchmark_ib_recommander(ctx, timer):
  print "#worker:", ctx.num_workers
  N_ITEMS = 800
  N_USERS = 8000
  rating_table = expr.sparse_rand((N_USERS, N_ITEMS), 
                                    dtype=np.float64, 
                                    density=0.1, 
                                    format = "csr")
  t1 = datetime.now()
  model = ItemBasedRecommender(rating_table)
  model.precompute()
  t2 = datetime.now()
  cost_time = millis(t1, t2)
  print "total cost time:%s ms" % cost_time
Exemplo n.º 4
0
def benchmark_ib_recommander(ctx, timer):
    print "#worker:", ctx.num_workers
    N_ITEMS = 800
    N_USERS = 8000
    rating_table = expr.sparse_rand((N_USERS, N_ITEMS),
                                    dtype=np.float64,
                                    density=0.1,
                                    format="csr")
    t1 = datetime.now()
    model = ItemBasedRecommender(rating_table)
    model.precompute()
    t2 = datetime.now()
    cost_time = millis(t1, t2)
    print "total cost time:%s ms" % cost_time