<commit_before>(function($M){
	AgentSmithDemo.addDemo('GMM',
	'In this demo, data points are given which are sampled from some probabilistic distribution and Gaussian Mixtures are estimated for that by EM algorithm',
	{
		X: {
			shape: [2, 'n_data'],
			init: $M.fromArray([
					[1, 1],
					[0, 1],
					[1, 1],
					[1, 2],
					[-1, -2],
					[1, 0.1],
					[2, 2],
					[1, 2],
					[9, 7],
					[13, 10],
					[10, 7],
					[10, 8],
					[8, 11],
					[10, 11],
					[9, 7],
				])
		}
	},
	function(plt, args){
		$M = AgentSmith.Matrix;
		$T = Trinity;

		var gmm = new Neo.Mixture.GMM(2, 100, 0.0000001);
		var X = args.X;

		// Estimate GMM
		gmm.fit(X);

		// Plot
		var x = $M.getCol(X,0);
		var y = $M.getCol(X,1);

		var covars_inv = new Array(gmm.covars.length);
		var covars_det = new Array(gmm.covars.length);
		for (var i=0 ; i<gmm.covars.length ; i++) {
			covars_det[i] = gmm.covars[i].det();
			covars_inv[i] = gmm.covars[i].inverse();
		}

		// Contour levels to show
		var levels = [];
		for (var level = 0.001 ; level < 0.2 ; level += 0.003) {
			levels.push(level);
		}

		plt.contourDesicionFunction(-2, 15, -3, 12, {levels: levels}, function(x,y){
			var datum = $M.fromArray([[x],[y]]);
			var zs = new Array(gmm.covars.length);
			for (var i=0 ; i<gmm.covars.length ; i++) {
				var mean = gmm.means[i];
				var x_sub_mean = datum.sub(mean);
				var covar_inv = covars_inv[i];<commit_msg>Reduce levels of the contour in GMM demo<commit_after>(function($M){
	AgentSmithDemo.addDemo('GMM',
	'In this demo, data points are given which are sampled from some probabilistic distribution and Gaussian Mixtures are estimated for that by EM algorithm',
	{
		X: {
			shape: [2, 'n_data'],
			init: $M.fromArray([
					[1, 1],
					[0, 1],
					[1, 1],
					[1, 2],
					[-1, -2],
					[1, 0.1],
					[2, 2],
					[1, 2],
					[9, 7],
					[13, 10],
					[10, 7],
					[10, 8],
				])
		}
	},
	function(plt, args){
		$M = AgentSmith.Matrix;
		$T = Trinity;

		var gmm = new Neo.Mixture.GMM(2, 100, 0.0000001);
		var X = args.X;

		// Estimate GMM
		gmm.fit(X);

		// Plot
		var x = $M.getCol(X,0);
		var y = $M.getCol(X,1);

		var covars_inv = new Array(gmm.covars.length);
		var covars_det = new Array(gmm.covars.length);
		for (var i=0 ; i<gmm.covars.length ; i++) {
			covars_det[i] = gmm.covars[i].det();
			covars_inv[i] = gmm.covars[i].inverse();
		}

		// Contour levels to show
		var levels = [];
		for (var level = 0.01 ; level < 0.2 ; level += 0.03) {
			levels.push(level);
		}

		plt.contourDesicionFunction(-2, 15, -3, 12, {levels: levels}, function(x,y){
			var datum = $M.fromArray([[x],[y]]);
			var zs = new Array(gmm.covars.length);
			for (var i=0 ; i<gmm.covars.length ; i++) {
				var mean = gmm.means[i];
				var x_sub_mean = datum.sub(mean);
				var covar_inv = covars_inv[i];
{'fraction_non_alphanumeric': 0.18885339013134542, 'fraction_numerical': 0.04650337238196663, 'mean_word_length': 2.6361290322580646, 'pattern_counts': {'":': 0, '<': 9, '<?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': '7420096', 'n_tokens_mistral': 1496, 'n_tokens_neox': 1170, 'n_words': 294}