<commit_before>package model

type Classifier struct {
	Icpt float32
	Coef []float32
}

func NewClassifier() *Classifier {
	clf := new(Classifier)
	clf.Icpt = -2.564655
	clf.Coef = []float32{
		2.6330943470553763,
		-1.055620498492281,
		-1.1791692175767425,
		-0.1644597268750564,
		-2.0474822790109095,
		0.8264562236664308,
		0.5796067597139994,
		-0.7906790307239042,
		-1.2721849221036212,
		-1.0813978066826195,
		0.8748609300757766,
		-0.40294408964596545,
		3.04562711239094,
		-0.7249611044008284,
		0.35081846466329564,
		0.8604955483481149,
		-1.3499771414463204,
		0.47092944215919597,
		-2.1138131135328733,
		0.41930575382621343,
		-2.705813957056376,
		1.505147928736571,
		0.4730664317182804,
		-5.585533335879726,
		1.2280588196915974,
		0.6055665817297022,
		0.15364892850366443,
		1.2922652864844202,
		1.004968425011026,
		0.7761271996659317,
		-2.136901845550296,
		2.5654189389539175,
		0.1649155211521799,
		1.1438496103779283,
		1.8383404820533162,
		-0.5639874728897193,
		-1.0055716484163062,
		1.4737962314389035,
		-0.6261395550769238,
	}
	return clf
}

// Score returns the feature score, bigger is better.
func (clf *Classifier) Score(ftr *Feature) float32 {
	score := clf.Icpt
	for i := range ftr {
		score += (ftr[i] * clf.Coef[i])
	}
	return score
}

// Predict returns true if a feature vector presumably is a part of the
// article text.
func (clf *Classifier) Predict(x *Feature) bool {
	return clf.Score(x) > 0.0
}<commit_msg>renamed struct fields<commit_after>package model

type Classifier struct {
	Intercept    float32
	Coefficients []float32
}

func NewClassifier() *Classifier {
	clf := new(Classifier)
	clf.Intercept = -2.564655
	clf.Coefficients = []float32{
		2.6330943470553763,
		-1.055620498492281,
		-1.1791692175767425,
		-0.1644597268750564,
		-2.0474822790109095,
		0.8264562236664308,
		0.5796067597139994,
		-0.7906790307239042,
		-1.2721849221036212,
		-1.0813978066826195,
		0.8748609300757766,
		-0.40294408964596545,
		3.04562711239094,
		-0.7249611044008284,
		0.35081846466329564,
		0.8604955483481149,
		-1.3499771414463204,
		0.47092944215919597,
		-2.1138131135328733,
		0.41930575382621343,
		-2.705813957056376,
		1.505147928736571,
		0.4730664317182804,
		-5.585533335879726,
		1.2280588196915974,
		0.6055665817297022,
		0.15364892850366443,
		1.2922652864844202,
		1.004968425011026,
		0.7761271996659317,
		-2.136901845550296,
		2.5654189389539175,
		0.1649155211521799,
		1.1438496103779283,
		1.8383404820533162,
		-0.5639874728897193,
		-1.0055716484163062,
		1.4737962314389035,
		-0.6261395550769238,
	}
	return clf
}

// Score returns the feature score, bigger is better.
func (clf *Classifier) Score(ftr *Feature) float32 {
	score := clf.Intercept
	for i := range ftr {
		score += (ftr[i] * clf.Coefficients[i])
	}
	return score
}

// Predict returns true if a feature vector presumably is a part of the
// article text.
func (clf *Classifier) Predict(ftr *Feature) bool {
	return clf.Score(ftr) > 0.0
}
{'fraction_non_alphanumeric': 0.11275167785234899, 'fraction_numerical': 0.45436241610738254, 'mean_word_length': 3.9683333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '615027', 'n_tokens_mistral': 2224, 'n_tokens_neox': 1413, 'n_words': 218}