Everyone knows that the content makes the question. But a good title helps too, and that's the first thing we see. It's time to turn that first impression into a program, and figure out what kinds of titles get more upvotes.
You are hereby challenged to write a program or function that takes the title of a PPCG question as input, and returns a prediction of its score.
For instance, you might receive Counting Grains of Rice
as an input, and you would be trying to return something close to the score, 59
in this case. Non-integer guesses are fine, but guesses at or below -20
are not.
Here is the data, for testing and scoring:
http://data.stackexchange.com/codegolf/query/244871/names-and-upvotes
Scoring: Your program will be run on every question in this site's (PPCG) history, not counting closed questions. The function ln(score + 20)
will then be applied to each score, and to each guess. The root-mean-squared-error between the two resultant sets of values is your score. Lower is better.
For instance, a program that guessed 0 every time would score 0.577, while one that guessed 11 every time would score 0.362.
Please calculate your score and include it in the title of your answer. Please also include your program's prediction for how many upvotes this question will get.
Restrictions:
To prevent excessive hard-coding, no more than 1000 characters.
Must run on the entire data set above in under a minute on a reasonable machine.
Standard Loopholes are closed.
Here is a tester written in Python, for your use and/or to clear up ambiguities:
import sys
import math
import csv
scores_dict = {}
with open(sys.argv[1], 'r') as csv_file:
score_reader = csv.reader(csv_file)
for score, title in score_reader:
if score == 'Score':
continue
scores_dict[title] = int(score)
def rate_guesses(guesser):
def transform(score):
return math.log(score + 20) if score > -20 else 0
off_by_total = 0
lines_count = 0
for title in scores_dict:
guessed_score = guesser(title)
real_score = scores_dict[title]
off_by_total += (transform(real_score) - transform(guessed_score)) ** 2
return (off_by_total/len(scores_dict)) ** .5
def constant11(title):
return 11
print(rate_guesses(constant11))
[closed]
and[on hold]
, where applicable? \$\endgroup\$