Example #1
0
def data_sparse(filename, nbr_features):
    ''' This function takes as argument a file representing a sparse matrix
    sparse_matrix[i][j] = "a:b" means matrix[i][a] = basename and load it with the loadsvm load_svmlight_file
    '''
    return data_converter.file_to_libsvm(filename=filename,
                                         data_binary=False,
                                         n_features=nbr_features)
Example #2
0
def data_binary_sparse(filename, nbr_features):
    ''' This fuction takes as argument a file representing a sparse binary matrix 
    sparse_binary_matrix[i][j] = "a"and transforms it temporarily into file svmlibs format( <index2>:<value2>)
    to load it with the loadsvm load_svmlight_file
    '''
    return data_converter.file_to_libsvm(filename=filename,
                                         data_binary=True,
                                         n_features=nbr_features)
Example #3
0
def data_binary_sparse(filename, nbr_features):
    ''' This fuction takes as argument a file representing a sparse binary matrix 
    sparse_binary_matrix[i][j] = "a"and transforms it temporarily into file svmlibs format( <index2>:<value2>)
    to load it with the loadsvm load_svmlight_file
    '''
    return data_converter.file_to_libsvm(filename=filename, data_binary=True, n_features=nbr_features)
Example #4
0
def data_sparse(filename, nbr_features):
    ''' This function takes as argument a file representing a sparse matrix
    sparse_matrix[i][j] = "a:b" means matrix[i][a] = basename and load it with the loadsvm load_svmlight_file
    '''
    return data_converter.file_to_libsvm(filename=filename, data_binary=False, n_features=nbr_features)