(data_file_name)
return (prob_y, prob_x)
svm_read_problem(data_file_name) -> [y, x]

	Read LIBSVM-format data from data_file_name and return labels y
	and data instances x.
svm_read_problem(data_file_name) -> [y, x]
svm_read_problem ( data_file_name ) - > [ y x ]
def svm_read_problem(data_file_name):
	"""
	svm_read_problem(data_file_name) -> [y, x]

	Read LIBSVM-format data from data_file_name and return labels y
	and data instances x.
	"""
	prob_y = []
	prob_x = []
	for line in open(data_file_name):
		line = line.split(None, 1)
		# In case an instance with all zero features
		if len(line) == 1: line += ['']
		label, features = line
		xi = {}
		for e in features.split():
			ind, val = e.split(":")
			xi[int(ind)] = float(val)
		prob_y += [float(label)]
		prob_x += [xi]
	return (prob_y, prob_x)
def svm_read_problem ( data_file_name ) : prob_y = [ ] prob_x = [ ] for line in open ( data_file_name ) : line = line . split ( None , 1 ) # In case an instance with all zero features if len ( line ) == 1 : line += [ '' ] label , features = line xi = { } for e in features . split ( ) : ind , val = e . split ( ":" ) xi [ int ( ind ) ] = float ( val ) prob_y += [ float ( label ) ] prob_x += [ xi ] return ( prob_y , prob_x )