<commit_before>from math import log
from scipy import stats 

def LikelihoodRatioTest(null_model, alt_model):
	chisq = -2.0 * null_model.loglikelihood() + 2.0 * alt_model.loglikelihood()
	df = alt_model.df - null_model.df 
	res = LikelihoodRatioTestResult(chisq)

class LikelihoodRatioTestResult(object):
	def __init__(self, statistic, df, distribution):
		self.statistic = statistic
		self.df = df
		self.distribution = distribution
	
	@property
	def pvalue(self):
		return self.distribution.sf(self.statistic, self.df)

	@property
	def lod(self):
		return self.statistic / (2.0 * log(10.0))<commit_msg>actually return the object we made, and make it with the right parameters. the dangers of programming at 4:45pm<commit_after>from math import log
from scipy import stats 

def LikelihoodRatioTest(null_model, alt_model):
	chisq = -2.0 * null_model.loglikelihood() + 2.0 * alt_model.loglikelihood()
	df = null_model.df - alt_model.df # Null model has more DFs
	res = LikelihoodRatioTestResult(chisq, df, stats.chi2)
	return res

class LikelihoodRatioTestResult(object):
	def __init__(self, statistic, df, distribution):
		self.statistic = statistic
		self.df = df
		self.distribution = distribution
	
	@property
	def pvalue(self):
		return self.distribution.sf(self.statistic, self.df)

	@property
	def lod(self):
		return self.statistic / (2.0 * log(10.0))
{'fraction_non_alphanumeric': 0.10228108903605593, 'fraction_numerical': 0.016188373804267846, 'mean_word_length': 4.787234042553192, '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': '6172104', 'n_tokens_mistral': 490, 'n_tokens_neox': 447, 'n_words': 120}