<commit_before><commit_msg>Added LPP python modular example<commit_after>from tools.load import LoadMatrix

lm=LoadMatrix()
data = lm.load_numbers('../data/fm_train_real.dat')

parameter_list = [[data,10],[data,20]]

def converter_localitypreservingprojections_modular(data,k):
	from shogun.Features import RealFeatures
	from shogun.Converter import LocalityPreservingProjections
	
	features = RealFeatures(data)
		
	converter = LocalityPreservingProjections()
	converter.set_target_dim(1)
	converter.set_k(k)
	converter.set_tau(2.0)
	converter.apply(features)

	return features


if __name__=='__main__':
	print 'LocalityPreservingProjections'
	converter_localitypreservingprojections_modular(*parameter_list[0])

{'fraction_non_alphanumeric': 0.09523809523809523, 'fraction_numerical': 0.011204481792717087, 'mean_word_length': 8.050632911392405, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6350290', 'n_tokens_mistral': 250, 'n_tokens_neox': 231, 'n_words': 38}