def features_read_svmlight_format_modular(fname):
    import os
    from modshogun import SparseRealFeatures
    from modshogun import LibSVMFile

    f = SparseRealFeatures()
    lab = f.load_with_labels(LibSVMFile(fname))
    f.save_with_labels(LibSVMFile("testwrite.light", "w"), lab)
def features_read_svmlight_format_modular(fname):
    import os
    from modshogun import SparseRealFeatures
    from modshogun import LibSVMFile

    f = SparseRealFeatures()
    lab = f.load_with_labels(LibSVMFile(fname))
    f.save_with_labels(LibSVMFile('testwrite.light', 'w'), lab)
def load_sparse_data(filename, dimension=None):
	input_file = LibSVMFile(args.dataset)
	sparse_feats = SparseRealFeatures()
	label_array = sparse_feats.load_with_labels(input_file)
	labels = BinaryLabels(label_array)

	if dimension!=None:
		sparse_feats.set_num_features(dimension)

	return {'data':sparse_feats, 'labels':labels}
def load_sparse_data(filename, dimension=None):
    input_file = LibSVMFile(args.dataset)
    sparse_feats = SparseRealFeatures()
    label_array = sparse_feats.load_with_labels(input_file)
    labels = BinaryLabels(label_array)

    if dimension != None:
        sparse_feats.set_num_features(dimension)

    return {'data': sparse_feats, 'labels': labels}
Пример #5
0
def get_features_and_labels(input_file):
	feats = SparseRealFeatures()
	label_array = feats.load_with_labels(input_file)
	labels = MulticlassLabels(label_array)
	return feats, labels
Пример #6
0
def get_features_and_labels(input_file):
	feats = SparseRealFeatures()
	label_array = feats.load_with_labels(input_file)
	labels = MulticlassLabels(label_array)
	return feats, labels