MNISTの手書き数字データをベイズ推計してみた:Naive Bayes Classifier


Warning: fopen(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_821a5d5d1cb3f256cbf121cd226c2b54.gif): failed to open stream: Permission denied in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 123

Warning: fputs() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 124

Warning: fclose() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 126

Warning: getimagesize(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_821a5d5d1cb3f256cbf121cd226c2b54.gif): failed to open stream: No such file or directory in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 129

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 47

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 49

Warning: fopen(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_2461ba06bc48f5aa46a4ce9fc705f5b4.gif): failed to open stream: Permission denied in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 123

Warning: fputs() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 124

Warning: fclose() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 126

Warning: getimagesize(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_2461ba06bc48f5aa46a4ce9fc705f5b4.gif): failed to open stream: No such file or directory in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 129

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 47

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 49

Warning: fopen(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_7b8b965ad4bca0e41ab51de7b31363a1.gif): failed to open stream: Permission denied in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 123

Warning: fputs() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 124

Warning: fclose() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 126

Warning: getimagesize(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_7b8b965ad4bca0e41ab51de7b31363a1.gif): failed to open stream: No such file or directory in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 129

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 47

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 49

Warning: fopen(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_865c0c0b4ab0e063e5caa3387c1a8741.gif): failed to open stream: Permission denied in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 123

Warning: fputs() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 124

Warning: fclose() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 126

Warning: getimagesize(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_865c0c0b4ab0e063e5caa3387c1a8741.gif): failed to open stream: No such file or directory in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 129

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 47

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 49

Warning: fopen(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_c957e702bad5bbe9549c5049e6380c40.gif): failed to open stream: Permission denied in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 123

Warning: fputs() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 124

Warning: fclose() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 126

Warning: getimagesize(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_c957e702bad5bbe9549c5049e6380c40.gif): failed to open stream: No such file or directory in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 129

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 47

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 49

Warning: fopen(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_f1bf0f952d57a14739368d7e0fc0bf70.gif): failed to open stream: Permission denied in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 123

Warning: fputs() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 124

Warning: fclose() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 126

Warning: getimagesize(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_f1bf0f952d57a14739368d7e0fc0bf70.gif): failed to open stream: No such file or directory in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 129

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 47

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 49

Warning: fopen(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_03c7c0ace395d80182db07ae2c30f034.gif): failed to open stream: Permission denied in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 123

Warning: fputs() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 124

Warning: fclose() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 126

Warning: getimagesize(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_03c7c0ace395d80182db07ae2c30f034.gif): failed to open stream: No such file or directory in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 129

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 47

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 49

Warning: fopen(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_9dd4e461268c8034f5c8564e155c67a6.gif): failed to open stream: Permission denied in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 123

Warning: fputs() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 124

Warning: fclose() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 126

Warning: getimagesize(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_9dd4e461268c8034f5c8564e155c67a6.gif): failed to open stream: No such file or directory in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 129

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 47

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 49

Warning: fopen(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_44e8e2a7bb39e7339f485bd5896a4e68.gif): failed to open stream: Permission denied in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 123

Warning: fputs() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 124

Warning: fclose() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 126

Warning: getimagesize(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_44e8e2a7bb39e7339f485bd5896a4e68.gif): failed to open stream: No such file or directory in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 129

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 47

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 49

Warning: fopen(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_9dd4e461268c8034f5c8564e155c67a6.gif): failed to open stream: Permission denied in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 123

Warning: fputs() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 124

Warning: fclose() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 126

Warning: getimagesize(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_9dd4e461268c8034f5c8564e155c67a6.gif): failed to open stream: No such file or directory in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 129

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 47

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 49

Warning: fopen(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_03c7c0ace395d80182db07ae2c30f034.gif): failed to open stream: Permission denied in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 123

Warning: fputs() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 124

Warning: fclose() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 126

Warning: getimagesize(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_03c7c0ace395d80182db07ae2c30f034.gif): failed to open stream: No such file or directory in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 129

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 47

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 49

Warning: fopen(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_420c5ef441e2678c53d24357c5d183b7.gif): failed to open stream: Permission denied in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 123

Warning: fputs() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 124

Warning: fclose() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 126

Warning: getimagesize(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_420c5ef441e2678c53d24357c5d183b7.gif): failed to open stream: No such file or directory in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 129

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 47

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 49

Warning: fopen(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_c19f6b6a7bae1fd5b14f578c6edc3454.gif): failed to open stream: Permission denied in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 123

Warning: fputs() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 124

Warning: fclose() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 126

Warning: getimagesize(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_c19f6b6a7bae1fd5b14f578c6edc3454.gif): failed to open stream: No such file or directory in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 129

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 47

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 49

Warning: fopen(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_91aceeab65bbc7fb652288081b4d816e.gif): failed to open stream: Permission denied in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 123

Warning: fputs() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 124

Warning: fclose() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 126

Warning: getimagesize(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_91aceeab65bbc7fb652288081b4d816e.gif): failed to open stream: No such file or directory in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 129

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 47

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 49

Warning: fopen(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_f1bf0f952d57a14739368d7e0fc0bf70.gif): failed to open stream: Permission denied in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 123

Warning: fputs() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 124

Warning: fclose() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 126

Warning: getimagesize(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_f1bf0f952d57a14739368d7e0fc0bf70.gif): failed to open stream: No such file or directory in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 129

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 47

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 49

Warning: fopen(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_6bf77b34e55b063221283b656307d8d5.gif): failed to open stream: Permission denied in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 123

Warning: fputs() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 124

Warning: fclose() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 126

Warning: getimagesize(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_6bf77b34e55b063221283b656307d8d5.gif): failed to open stream: No such file or directory in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 129

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 47

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 49

Warning: fopen(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_23368e8b963987006a66feb1d7631cb9.gif): failed to open stream: Permission denied in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 123

Warning: fputs() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 124

Warning: fclose() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 126

Warning: getimagesize(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_23368e8b963987006a66feb1d7631cb9.gif): failed to open stream: No such file or directory in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 129

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 47

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 49

Warning: fopen(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_03c7c0ace395d80182db07ae2c30f034.gif): failed to open stream: Permission denied in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 123

Warning: fputs() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 124

Warning: fclose() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 126

Warning: getimagesize(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_03c7c0ace395d80182db07ae2c30f034.gif): failed to open stream: No such file or directory in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 129

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 47

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 49

Warning: fopen(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_9dd4e461268c8034f5c8564e155c67a6.gif): failed to open stream: Permission denied in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 123

Warning: fputs() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 124

Warning: fclose() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 126

Warning: getimagesize(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_9dd4e461268c8034f5c8564e155c67a6.gif): failed to open stream: No such file or directory in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 129

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 47

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 49

Warning: fopen(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_865c0c0b4ab0e063e5caa3387c1a8741.gif): failed to open stream: Permission denied in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 123

Warning: fputs() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 124

Warning: fclose() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 126

Warning: getimagesize(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_865c0c0b4ab0e063e5caa3387c1a8741.gif): failed to open stream: No such file or directory in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 129

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 47

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 49

Warning: fopen(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_05e42209d67fe1eb15a055e9d3b3770e.gif): failed to open stream: Permission denied in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 123

Warning: fputs() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 124

Warning: fclose() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 126

Warning: getimagesize(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_05e42209d67fe1eb15a055e9d3b3770e.gif): failed to open stream: No such file or directory in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 129

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 47

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 49

Warning: fopen(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_f1bf0f952d57a14739368d7e0fc0bf70.gif): failed to open stream: Permission denied in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 123

Warning: fputs() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 124

Warning: fclose() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 126

Warning: getimagesize(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_f1bf0f952d57a14739368d7e0fc0bf70.gif): failed to open stream: No such file or directory in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 129

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 47

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 49

Warning: fopen(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_05e42209d67fe1eb15a055e9d3b3770e.gif): failed to open stream: Permission denied in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 123

Warning: fputs() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 124

Warning: fclose() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 126

Warning: getimagesize(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_05e42209d67fe1eb15a055e9d3b3770e.gif): failed to open stream: No such file or directory in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 129

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 47

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 49

Warning: fopen(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_23368e8b963987006a66feb1d7631cb9.gif): failed to open stream: Permission denied in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 123

Warning: fputs() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 124

Warning: fclose() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 126

Warning: getimagesize(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_23368e8b963987006a66feb1d7631cb9.gif): failed to open stream: No such file or directory in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 129

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 47

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 49

Warning: fopen(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_23368e8b963987006a66feb1d7631cb9.gif): failed to open stream: Permission denied in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 123

Warning: fputs() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 124

Warning: fclose() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 126

Warning: getimagesize(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_23368e8b963987006a66feb1d7631cb9.gif): failed to open stream: No such file or directory in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 129

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 47

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 49

Warning: fopen(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_05e42209d67fe1eb15a055e9d3b3770e.gif): failed to open stream: Permission denied in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 123

Warning: fputs() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 124

Warning: fclose() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 126

Warning: getimagesize(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_05e42209d67fe1eb15a055e9d3b3770e.gif): failed to open stream: No such file or directory in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 129

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 47

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 49

Warning: fopen(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_8e317c94debf0ff8b00ae7eee57a2c42.gif): failed to open stream: Permission denied in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 123

Warning: fputs() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 124

Warning: fclose() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 126

Warning: getimagesize(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_8e317c94debf0ff8b00ae7eee57a2c42.gif): failed to open stream: No such file or directory in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 129

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 47

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 49

Warning: fopen(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_e8b64534878bbeb554956afaadab5b33.gif): failed to open stream: Permission denied in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 123

Warning: fputs() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 124

Warning: fclose() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 126

Warning: getimagesize(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_e8b64534878bbeb554956afaadab5b33.gif): failed to open stream: No such file or directory in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 129

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 47

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 49

Warning: fopen(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_44e8e2a7bb39e7339f485bd5896a4e68.gif): failed to open stream: Permission denied in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 123

Warning: fputs() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 124

Warning: fclose() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 126

Warning: getimagesize(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_44e8e2a7bb39e7339f485bd5896a4e68.gif): failed to open stream: No such file or directory in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 129

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 47

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 49

Warning: fopen(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_03c7c0ace395d80182db07ae2c30f034.gif): failed to open stream: Permission denied in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 123

Warning: fputs() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 124

Warning: fclose() expects parameter 1 to be resource, bool given in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 126

Warning: getimagesize(/data/htdocs/ibot/wpibot//wp-content/plugins/latex/cache/tex_03c7c0ace395d80182db07ae2c30f034.gif): failed to open stream: No such file or directory in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 129

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 47

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/htdocs/ibot/wpibot/wp-content/plugins/latex/latex.php on line 49

この間、アソシアトロンの本を読んだりプログラムを書いたりするうちに、概念形成の場合は、アソシアトロンよりもベイズ推計のほうがパフォーマンスが良くなる可能性に思い当たった。そこで、このさい、この概念形成のベイズ推計モデルを使って、ディープラーニングなどの人工知能の性能評価に使われているMNISTの手書き数字データをベイズモデルで推計してみた。

MNISTデータは、中身を変えずに少し形式を変形して用いた。訓練用の60000個のデータで、事前確率を計算し、それをもとにテストデータ10000個で、テストした。どうせパフォーマンスはぼろぼろだろうと思ったが、84.1%の正解率だった。ディープラーニングだと90%の後半の数字が出るので(私が作ったDeep Learningのプログラムで、MNISTのテストした時には、96%にとどまったが:笑)、それから比べると相当低いが、私は正直、こんなに高い数字が出たことで、ちょう驚いた。どこか、正解を計算に使ったような、とんでもない間違いをしているのではないかと思ったくらいだ。

まず、プログラムが、ディープラーニングよりも無茶苦茶簡単なものになる。プログラムは、以下に置いてある。

https://github.com/toyowa/NaiveBayesClassifier

MNISTのデータは大きすぎて載せていないが、読み込み関数を見れば、どのようなフォーマットか理解できると思う。MNISTデータをテキストファイルとして、わかりやすいフォーマットに変えている。

プログラムの簡単さよりも遥かに大きな驚きは、60000個の学習から10000個のテストを終えるまでに、私の8コアのubuntu18.04で9秒33で終わってしまうのだ。プログラムはg++用のc++で書いている。テストは、4秒弱で終わる。データの読み込み時間がかかっているので、実際の計算はもっと短い。

これは、単純ベイズ分類器(Naive Bayes Classifier)というものだ。単純というのは、変数間の相関を考慮せず、独立であると想定していることである。独立でない場合については、のちに書く予定だ。

理論的な枠組みを示す。単純ベイズ分類器といっても、理論はそんな単純ではない。手書き数字データは、0から9までの10個の数字のラベルがつけられている。このラベルに結びついた事象をであらわす。MNISTでは1ピクセルを0から255の数値でその濃さを表しているが、ここでは正ならば1、負ならば0と変換しておく(多変量ベルヌーイ試行あるいはベルヌーイ分布にしている。これを多変量正規分布でも、試みたが色々不都合があった。機会があれば説明する)。このピクセルのベクトル(あるいは事象)をとしよう。はデータ番号(必要がないときは省略する)、はピクセル番号である。

このとき、ベイズ定理は次のように表される。

今、は、数字ラベルのときに、ピクセルベクトルが得られる確率であり、は、逆に、ベクトルが得られた時に、それが数字ラベルに属する確率、およびは、それぞれの条件に依存しない全体に対する確率である。

これは次のように変形できる。

式(1)

また、ここでは、変数(ピクセル値)の相関がないと想定しているので、は、極めて単純(Naive)な形になり、次のように求められる。

式(2)

ここで、は、ラベルがのときに、ピクセルベクトルの第番目の要素が1になる確率である。が、各ピクセルが1であったり0で会ったりする同時確率になっていることを示しているのである。すなわち、が1であるときはそのものになり、0であるときはのべき乗が0で、値が1になってしまうかわりにの冪乗が1になるという算段である。

これを用いて、(1)式の左辺の確率が最大のラベルを求めれた、それがピクセルデータから推計された数字ラベルとなる。

ただ、(2)式が784回もかけるかたちになっていて、途方も無い計算と思われるかもしれない。

計算について、もし、このような784回も積を取る形が望ましく無い場合は、自然対数をとって和のかたちにすることもあり得る。すなわち、われわれの目的は、(1)式において、を最大にするを求めることであり、各ラベルで共通する(1)式の分母は本質的役割を果たさない。そこで、(1)式の両辺を自然対数で変換変換して、(1)の右辺の分母だけを比較しても、最もあり得る数字ラベルを求めることは、理論的には全く問題ない。

ただ、実際の計算をすると、どちらも全く同じ答えを出し、自然対数を取る時間が余計にかかるだけであり、実際の計算では元々のかたちを用いている。

元々のかたちでの計算では、教育用データから事前確率を計算し、全てのテストデータを処理するのにMacPro上のUbuntu18.04 g++で8秒弱で計算を終えるのに対して、対数計算を加えると11秒かかった。計算結果は同じである。

なお、学習データは、基本60000個用いたが、1000個くらいから増やしていって、30000個くらいまでは、テストの正解率が上昇し、正解率は84.1%に達し、その後全く増加しなくなる。計算の確実性は高まっているようだが、パフォーマンスは良くならない。