LIBLINEARã®ãã©ã¡ã¼ã¿ãã°ãªãããµã¼ãããã¹ã¯ãªããæ¸ãã
LIBLINEARã®ãã©ã¡ã¼ã¿ï¼cost, biasï¼ãã°ãªãããµã¼ããã¦ãããã¹ã¯ãªãããgrid_with_bias_and_solver.pyããæ¸ãã¾ããï¼
ã¤ãã§ã«ã½ã«ãã¼ãæé©ãªãã®ãé¸æãã¦ããã¾ãï¼
ã½ã¼ã¹ã³ã¼ã
Gistã«ããã¦ããã¾ããï¼
使ãæ¹
ã½ã¼ã¹ã³ã¼ãä¸é¨ã®ã³ã¡ã³ãã«æ¸ãã¦ããéãï¼
以ä¸ã§ã¯ä½¿ãæ¹ã®ä¸ä¾ãç´¹ä»ãã¾ãï¼
1. grid.pyã®å ¥æ
â»DLæ¸ã®å ´åã¯é£ã°ãã¦ãã ããï¼
LIBSVMã«ä»å±ããã¦ããï¼LIBSVMã®ãã©ã¡ã¼ã¿ãã°ãªãããµã¼ãããã¹ã¯ãªããgrid.py
ãDLãã¾ãï¼
LIBLINEARã®ãã©ã¡ã¼ã¿ã®ã°ãªãããµã¼ãã«ãå©ç¨ã§ããåªããã®ã§ãï¼ãã ãcostã®ã¿ï¼ï¼
grid.py
ã¯ä»¥ä¸ã®ãµã¤ãããLIBSVMãDLã§ãã¾ãï¼
解åãã¦å±éããããã£ã¬ã¯ããªå
ã®tools
ãã£ã¬ã¯ããªã«grid.py
ãããã¾ãï¼
2. grid.pyããããã£ã¬ã¯ããªãæå®
grid_with_bias_and_solver.py
ã®37è¡ç®ã®GRID_DIRPATH
ã«ï¼grid.py
ããããã£ã¬ã¯ããªãæå®ãã¦ãã ããï¼
3. å®è¡ï¼
以ä¸ã®ã³ãã³ãã§ã°ãªãããµã¼ããå®è¡ã§ãã¾ãï¼ ãªãï¼ä»¥ä¸ã®ç°å¢ã§å®è¡ãããã®ã¨ãã¾ãï¼
- LIBLINEARã®
train
ã³ãã³ãããããã£ã¬ã¯ããªã«PATHãéã£ã¦ããï¼ grid_with_bias_and_solver.py
ã¯ã«ã¬ã³ããã£ã¬ã¯ããªã«åå¨ï¼- å¦ç¿ãã¼ã¿ã¯LIBLINEARã«ä»å±ãã¦ãã
heart_scale
ã¨ãï¼ãããã«ã¬ã³ããã£ã¬ã¯ããªã«åå¨ï¼
$ python grid_with_bias_and_solver.py -i heart_scale
ä¸è¨ã³ãã³ããå®è¡ããã¨ã°ãªãããµã¼ããå§ã¾ãã¾ãï¼
ãã°ãããã¦å®è¡ãå®äºããã¨ï¼ä»¥ä¸ã®ããã«Accuracyãé«ãã£ããã©ã¡ã¼ã¿Top10ã表示ãã¦ããã¾ãï¼
ï¼çµã¿åãããå¤ãã£ããï¼å¦ç¿ãã¼ã¿ã大ããã¨ããªãæéããããããããã¾ããï¼
======= Results (Top10) ======= (solver, bias, cost, accuracy) ('4', 1.0, 0.125, 84.8148) ('0', 1.0, 0.25, 84.4444) ('1', 0.1, 4.0, 84.4444) ('1', 1.0, 0.03125, 84.4444) ('2', 0.1, 0.5, 84.4444) ('2', 1.0, 0.03125, 84.4444) ('3', 0.0001, 0.125, 84.4444) ('3', 0.001, 0.125, 84.4444) ('3', 0.01, 0.125, 84.4444)
solver=4ï¼bias=1.0ï¼cost=0.125ãæé©ã®ããã§ãï¼
å¾ã¯ï¼ãã®ãã©ã¡ã¼ã¿ã§å®éã«ã¢ãã«ãå¦ç¿ããã°OKã§ãï¼
å©ç¨ä¸ã®æ³¨æ
ã½ã«ãã¼ããã¸ã¹ãã£ãã¯å帰ï¼0,6,7ï¼ã®ãã®ã§ããåä½ã¯æ¤è¨¼ãã¦ãã¾ãã*1ï¼
å©ç¨æã¯èªå·±è²¬ä»»ã§ãé¡ããã¾ãï¼
*1:ä¸é¨ã®ã½ã«ãã¼ã使ãã¨ï¼ä¾å¤ãçºçãã¦éä¸ã§ã¹ã¯ãªãããçµäºãã¦ãã¾ãã£ã½ãã§ãâ¦