{"image_url":null,"provider_name":"Hatena Blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhironsan.hatenablog.com%2Fentry%2Fkeras-to-categorical\" title=\"\u300cKeras\u306eto_categorical\u306e\u6319\u52d5\u3063\u3066\u3061\u3087\u3063\u3068\u5909\u308f\u3063\u3066\u308b\u3088\u306d\u300d\u3068\u3044\u3046\u8a71 - Ahogrammer\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_title":"Ahogrammer","author_url":"https://blog.hatena.ne.jp/Hironsan/","height":"190","author_name":"Hironsan","provider_url":"https://hatena.blog","categories":["Keras"],"width":"100%","blog_url":"https://hironsan.hatenablog.com/","published":"2018-06-18 20:40:02","description":"\u4eca\u65e5\u306f\u30de\u30cb\u30a2\u30c3\u30af\u306a\u8a71\u3002 Keras\u3092\u4f7f\u3063\u3066\u3044\u308b\u4eba\u306a\u3089\u3001to_categorical\u95a2\u6570\u3092\u4f7f\u3063\u305f\u3053\u3068\u304c\u3042\u308b\u4eba\u306f\u591a\u3044\u306e\u3067\u306f\u306a\u3044\u304b\u3068\u601d\u3046\u3002to_cateogorical\u95a2\u6570\u3092\u3044\u3064\u4f7f\u3046\u304b\u3068\u3044\u3046\u3068\u3001\u6b63\u89e3\u30af\u30e9\u30b9\u3092one-hot\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3057\u3066\u51fa\u529b\u306b\u4e0e\u3048\u305f\u3044\u3068\u304d\u306b\u4f7f\u3046\u3053\u3068\u304c\u591a\u3044\u3002Keras 2.2.0\u3060\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u52d5\u4f5c\u3059\u308b\u3002 >>> from keras.utils.np_utils import to_categorical >>> to_categorical([[1, 3]], num_classes=4) array([[[0., 1., 0., 0.], [0., 0., 0., 1.]]]\u2026","version":"1.0","type":"rich","url":"https://hironsan.hatenablog.com/entry/keras-to-categorical","title":"\u300cKeras\u306eto_categorical\u306e\u6319\u52d5\u3063\u3066\u3061\u3087\u3063\u3068\u5909\u308f\u3063\u3066\u308b\u3088\u306d\u300d\u3068\u3044\u3046\u8a71"}