エントリーの編集
![loading...](https://b.st-hatena.com/bdefb8944296a0957e54cebcfefc25c4dcff9f5f/images/v4/public/common/loading@2x.gif)
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
PythonでNaiveBayesを実装してみた - nokunoの日記
記事へのコメント1件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
![アプリのスクリーンショット](https://b.st-hatena.com/bdefb8944296a0957e54cebcfefc25c4dcff9f5f/images/v4/public/entry/app-screenshot.png)
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
PythonでNaiveBayesを実装してみた - nokunoの日記
解説は後日…しないかも. #!/usr/bin/env python #encoding: utf-8 from sys import stdin from optpars... 解説は後日…しないかも. #!/usr/bin/env python #encoding: utf-8 from sys import stdin from optparse import OptionParser from collections import defaultdict 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 = {} for feature in document.split(" "): key, value =