Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(16)  |  Call(12)  |  Derive(0)  |  Import(4)

src/d/s/DS_GA_NYC-HEAD/DS_NYC3_sample_code/lesson_13/python-recsys-master/recsys/utils/svdlibc.py   DS_GA_NYC(Download)
import csv
from numpy import array
from divisi2.ordered_set import OrderedSet
from csc.divisi2.dense import DenseMatrix
from recsys.algorithm.factorize import SVD
 
        #Check no duplicated IDs!!!
        assert(len(U_idx) == len(OrderedSet(U_idx))), 'There are duplicated row IDs!'
        assert(len(U_idx) == U.shape[0]), 'There are duplicated (or empty) row IDs!'
        assert(len(V_idx) == len(OrderedSet(V_idx))), 'There are duplicated col IDs!'
            sys.stdout.write('Creating SVD() class\n')
        svd = SVD()
        svd._U = DenseMatrix(U, OrderedSet(U_idx), None)
        svd._S = S
        svd._V = DenseMatrix(V, OrderedSet(V_idx), None)

src/d/s/DS_GA_NYC-HEAD/DS_NYC3_sample_code/lesson_13/python-recsys-master/recsys/algorithm/factorize.py   DS_GA_NYC(Download)
from divisi2 import DenseVector
from divisi2 import DenseMatrix
from divisi2.ordered_set import OrderedSet
 
from recsys.algorithm.baseclass import Algorithm
                idx = [ idx.strip() for idx in zip.read('.row_ids').split('\n') if idx]
            #self._U = DenseMatrix(vectors) 
            self._U = DenseMatrix(vectors, OrderedSet(idx), None)
        try:
            self._V = loads(zip.read('.V'))
                idx = [ idx.strip() for idx in zip.read('.col_ids').split('\n') if idx]
            #self._V = DenseMatrix(vectors) 
            self._V = DenseMatrix(vectors, OrderedSet(idx), None)
 
        self._S = loads(zip.read('.S'))

src/p/y/python-recsys-HEAD/recsys/utils/svdlibc.py   python-recsys(Download)
import csv
from numpy import array
from divisi2.ordered_set import OrderedSet
from csc.divisi2.dense import DenseMatrix
from recsys.algorithm.factorize import SVD
 
        #Check no duplicated IDs!!!
        assert(len(U_idx) == len(OrderedSet(U_idx))), 'There are duplicated row IDs!'
        assert(len(U_idx) == U.shape[0]), 'There are duplicated (or empty) row IDs!'
        assert(len(V_idx) == len(OrderedSet(V_idx))), 'There are duplicated col IDs!'
            sys.stdout.write('Creating SVD() class\n')
        svd = SVD()
        svd._U = DenseMatrix(U, OrderedSet(U_idx), None)
        svd._S = S
        svd._V = DenseMatrix(V, OrderedSet(V_idx), None)

src/p/y/python-recsys-HEAD/recsys/algorithm/factorize.py   python-recsys(Download)
from divisi2 import DenseVector
from divisi2 import DenseMatrix
from divisi2.ordered_set import OrderedSet
 
from recsys.algorithm.baseclass import Algorithm
                idx = [ idx.strip() for idx in zip.read('.row_ids').split('\n') if idx]
            #self._U = DenseMatrix(vectors) 
            self._U = DenseMatrix(vectors, OrderedSet(idx), None)
        try:
            self._V = loads(zip.read('.V'))
                idx = [ idx.strip() for idx in zip.read('.col_ids').split('\n') if idx]
            #self._V = DenseMatrix(vectors) 
            self._V = DenseMatrix(vectors, OrderedSet(idx), None)
 
        self._S = loads(zip.read('.S'))