def load_mldataset(filename):
    """Not particularly fast code to parse the text file and load it into three NDArray's
    and product an NDArrayIter
    """
    user = []
    item = []
    score = []
    with open(filename) as f:
        for line in f:
            tks = line.strip().split('\t')
            if len(tks) != 4:
                continue
            user.append(int(tks[0]))
            item.append(int(tks[1]))
            score.append(float(tks[2]))
    user = mx.nd.array(user)
    item = mx.nd.array(item)
    score = mx.nd.array(score)
    return gluon.data.ArrayDataset(user, item, score)
def load_mldataset ( filename ) : user = [ ] item = [ ] score = [ ] with open ( filename ) as f : for line in f : tks = line . strip ( ) . split ( '\t' ) if len ( tks ) != 4 : continue user . append ( int ( tks [ 0 ] ) ) item . append ( int ( tks [ 1 ] ) ) score . append ( float ( tks [ 2 ] ) ) user = mx . nd . array ( user ) item = mx . nd . array ( item ) score = mx . nd . array ( score ) return gluon . data . ArrayDataset ( user , item , score )
Not particularly fast code to parse the text file and load it into three NDArray's
    and product an NDArrayIter