<commit_before>
var regression = P(SettableMathOutput, function(_, super_) {
	_.klass = ['regression'];
	_.mode = 'linear';
	_.function_of = 'x';
	_.helpText = "<<regression <[data]>>>\nWill find the best fit to the supplied data for the specified regression type:\nLinear: y = m*x + b\nPolynomial: y = a<sub>n</sub> * x<sup>n</sup> + ... + a<sub>2</sub> * x<sup>2</sup> + a<sub>1</sub> * x + a<sub>0</sub>\nPower: y = m * x ^ b\nExponential: y = a * e^(b * x)\nLogarithmic: y = a * ln(x) + b\nLogit Model: y'(x) is best fit to data for x<sub>0</sub>, x<sub>0</sub>+1, x<sub>0</sub>+2, ... with y(x<sub>0</sub>) = y<sub>0</sub>";
	_.savedProperties = ['mode'];

	_.innerHtml = function() {
		var html = '<div class="' + css_prefix + 'focusableItems" data-id="0"><span class="firstline">x</span><sub>data</sub><span class="equality">&#8801;</span>' + focusableHTML('MathQuill',  'xdata') + helpBlock() + '</div>'
	 	+ '<div class="' + css_prefix + 'focusableItems hide_logit" data-id="1">y<sub>data</sub><span class="equality">&#8801;</span>' + focusableHTML('MathQuill',  'ydata') + '</div>'
	 	+ '<div class="' + css_prefix + 'focusableItems hidden show_polynomial" data-id="2" style="display:none;">polynomial&nbsp;order&nbsp;' + focusableHTML('MathQuill',  'order') + '</div>'
	 	+ '<div class="' + css_prefix + 'focusableItems hidden show_logit" data-id="3" style="display:none;">x<sub>0</sub><span class="equality">&#8801;</span>' + focusableHTML('MathQuill',  'xo') + '</div>'
	 	+ '<div class="' + css_prefix + 'focusableItems hidden show_logit" data-id="4" style="display:none;">y(x<sub>0</sub>)<span class="equality">&#8801;</span>' + focusableHTML('MathQuill',  'yo') + '</div>'
	  + '<div class="' + css_prefix + 'focusableItems" data-id="5">' + focusableHTML('SelectBox',  'regression_type') + '</div>';
	  return this.toWrap('regression', html);
	}
	_.postInsertHandler = function() {
		this.xdata = registerFocusable(MathQuill, this, 'xdata', { ghost: 'data', handlers: {
			enter: this.enterPressed(this),
			blur: this.submissionHandler(this)
		}});
		this.ydata = registerFocusable(MathQuill, this, 'ydata', { ghost: 'data', handlers: {
			enter: this.enterPressed(this),
			blur: this.submissionHandler(this)
		}});
		this.order = registerFocusable(MathQuill, this, 'order', { ghost: 'n', handlers: {
			enter: this.enterPressed(this),<commit_msg>Fix regression bug referring to wrong parent function<commit_after>
var regression = P(SettableMathOutput, function(_, super_) {
	_.klass = ['regression'];
	_.mode = 'linear';
	_.function_of = 'x';
	_.helpText = "<<regression <[data]>>>\nWill find the best fit to the supplied data for the specified regression type:\nLinear: y = m*x + b\nPolynomial: y = a<sub>n</sub> * x<sup>n</sup> + ... + a<sub>2</sub> * x<sup>2</sup> + a<sub>1</sub> * x + a<sub>0</sub>\nPower: y = m * x ^ b\nExponential: y = a * e^(b * x)\nLogarithmic: y = a * ln(x) + b\nLogit Model: y'(x) is best fit to data for x<sub>0</sub>, x<sub>0</sub>+1, x<sub>0</sub>+2, ... with y(x<sub>0</sub>) = y<sub>0</sub>";
	_.savedProperties = ['mode'];

	_.innerHtml = function() {
		var html = '<div class="' + css_prefix + 'focusableItems" data-id="0"><span class="firstline">x</span><sub>data</sub><span class="equality">&#8801;</span>' + focusableHTML('MathQuill',  'xdata') + helpBlock() + '</div>'
	 	+ '<div class="' + css_prefix + 'focusableItems hide_logit" data-id="1">y<sub>data</sub><span class="equality">&#8801;</span>' + focusableHTML('MathQuill',  'ydata') + '</div>'
	 	+ '<div class="' + css_prefix + 'focusableItems hidden show_polynomial" data-id="2" style="display:none;">polynomial&nbsp;order&nbsp;' + focusableHTML('MathQuill',  'order') + '</div>'
	 	+ '<div class="' + css_prefix + 'focusableItems hidden show_logit" data-id="3" style="display:none;">x<sub>0</sub><span class="equality">&#8801;</span>' + focusableHTML('MathQuill',  'xo') + '</div>'
	 	+ '<div class="' + css_prefix + 'focusableItems hidden show_logit" data-id="4" style="display:none;">y(x<sub>0</sub>)<span class="equality">&#8801;</span>' + focusableHTML('MathQuill',  'yo') + '</div>'
	  + '<div class="' + css_prefix + 'focusableItems" data-id="5">' + focusableHTML('SelectBox',  'regression_type') + '</div>';
	  return this.wrapHTML('regression', html);
	}
	_.postInsertHandler = function() {
		this.xdata = registerFocusable(MathQuill, this, 'xdata', { ghost: 'data', handlers: {
			enter: this.enterPressed(this),
			blur: this.submissionHandler(this)
		}});
		this.ydata = registerFocusable(MathQuill, this, 'ydata', { ghost: 'data', handlers: {
			enter: this.enterPressed(this),
			blur: this.submissionHandler(this)
		}});
		this.order = registerFocusable(MathQuill, this, 'order', { ghost: 'n', handlers: {
			enter: this.enterPressed(this),
{'fraction_non_alphanumeric': 0.22170997485331098, 'fraction_numerical': 0.014668901927912825, 'mean_word_length': 5.432614555256064, 'pattern_counts': {'":': 0, '<': 113, '<?xml version=': 0, '>': 113, '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': '3417986', 'n_tokens_mistral': 1831, 'n_tokens_neox': 1723, 'n_words': 348}