解説は後日. #!/usr/bin/env python #encoding: utf-8 from sys import stdin from optparse import OptionParser from collections import defaultdict from random import shuffle, seed from math import sqrt def sign(x): if abs(x) return 0 elif x > 0: return 1 return -1 def clip(x, c): return sign(x) * max(0., abs(x) - c) def parse(line, bias, discount): label, document = line.strip().split(" ", 1) features = {}