ðAdaBoost (Adaptive Boosting) ã¢ã«ãŽãªãºã ã¯ã匱åŠç¿åšãçµã¿åãããŠããã匷ãåŠç¿åšãäœæããã¢ã³ãµã³ãã«åŠç¿ææ³ã®äžã€ã§ãã
ãã®ã¢ã«ãŽãªãºã ã¯ãåé¡åé¡ã«å¯ŸããŠç¹ã«æå¹ã§ããããã®ã·ã³ãã«ããšå¹æã®é«ããããæ©æ¢°åŠç¿ã®åéã§åºã䜿çšãããŠããŸããAdaBoostã®åºæ¬çãªã¢ã€ãã¢ã¯ãé£ç¶çã«åŠç¿åšãé©çšããåã®åŠç¿åšãééãããµã³ãã«ã«çŠç¹ãåœãŠãããšã§ãã¢ãã«ã®æ§èœãåŸã ã«åäžãããããšã§ãã
AdaBoostã®åºæ¬çãªããã»ã¹
åæå: ãã¬ãŒãã³ã°ã»ããã®åããŒã¿ãã€ã³ãã«åãéã¿ãå²ãåœãŠãŸãã
å埩åŠç:
匱åŠç¿åšããã¬ãŒãã³ã°ããŒã¿ã«é©çšããŸããååã®å埩ã§ã¯ããã¹ãŠã®ããŒã¿ãã€ã³ãã«çããéã¿ãäžããããŸããã次ã®å埩以éã§ã¯ã誀ã£ãŠåé¡ãããããŒã¿ãã€ã³ãã®éã¿ãå¢å ããŸãã
å匱åŠç¿åšã®æ§èœãè©äŸ¡ãããã®åŠç¿åšã«å¯ŸããŠéã¿ãèšç®ããŸãã誀åé¡çãäœãåŠç¿åšã«ã¯ããé«ãéã¿ãå²ãåœãŠãããŸãã
ãã¬ãŒãã³ã°ããŒã¿ã»ããã®åããŒã¿ãã€ã³ãã«å¯Ÿããéã¿ãæŽæ°ããŸãã誀ã£ãŠåé¡ãããããŒã¿ãã€ã³ãã®éã¿ã¯å¢å ããæ£ããåé¡ãããããŒã¿ãã€ã³ãã®éã¿ã¯æžå°ããŸãã
ãã®ããã»ã¹ãæå®ãããæ°ã®å埩ãŸãã¯ã¢ãã«ã®æ§èœãååã«é«ããªããŸã§ç¹°ãè¿ããŸãã
æçµã¢ãã«ã®æ§ç¯: åå埩ã§åŸããã匱åŠç¿åšãšãã®éã¿ãçµã¿åãããŠãæçµçãªã¢ãã«ãæ§ç¯ããŸããæçµçãªã¢ãã«ã¯ãåã ã®åŒ±åŠç¿åšã®äºæž¬ã«åºã¥ããŠéã¿ä»ããããå€æ°æ±ºãè¡ãããšã§ãæ°ããããŒã¿ãã€ã³ãã®åé¡ãè¡ããŸãã
ç¹åŸŽãšå©ç¹
é å¥æ§: AdaBoostã¯ãã·ã³ãã«ã§ãããªãã匷åãªåé¡åšãçæããèœåããããŸãã
æè»æ§: ä»»æã®åé¡åšã匱åŠç¿åšãšããŠäœ¿çšã§ããŸããäžè¬çã«ã¯ã決å®æšã䜿çšãããŸãããä»ã®ã¢ã«ãŽãªãºã ãé©çšå¯èœã§ãã
èªåçãªç¹åŸŽéžæ: 匱åŠç¿åšãšããŠæ±ºå®æšã䜿çšããå ŽåãAdaBoostã¯éèŠãªç¹åŸŽãèªåçã«éžæããç¡é¢ä¿ãŸãã¯ãã€ãºã®å€ãç¹åŸŽãç¡èŠããŸãã
éåŠç¿ãžã®æµææ§: é©åãªåæ¢æ¡ä»¶ãèšå®ããããšã§ãAdaBoostã¯éåŠç¿ã«å¯ŸããŠæ¯èŒçæµæåããããŸãã
from sklearn.ensemble import AdaBoostClassifier
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
# ãµã³ãã«ããŒã¿ã®çæ
X, y = make_classification(n_samples=1000, n_features=20, n_informative=2, n_redundant=10, random_state=42)
# ããŒã¿ããã¬ãŒãã³ã°ã»ãããšãã¹ãã»ããã«åå²
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=42)
# AdaBoostã¯ã©ã¹åé¡åšã®ã€ã³ã¹ã¿ã³ã¹ãäœæ
ada_clf = AdaBoostClassifier(n_estimators=100, random_state=42)
# ã¢ãã«ããã¬ãŒãã³ã°ããŒã¿ã«ãã£ããããã
ada_clf.fit(X_train, y_train)
# ãã¹ãããŒã¿ã䜿ã£ãŠã¢ãã«ã®ç²ŸåºŠãè©äŸ¡
y_pred = ada_clf.predict(X_test)
print(f"Accuracy: {accuracy_score(y_test, y_pred):.2f}")
adaboostã¯ã¢ã³ãµã³ãã«åŠç¿ã®äžçš®ã§ãããïŒã©ã³ãã ãã©ã¬ã¹ããšã®éããæããŠãã ãã
ã¯ããAdaBoostã¯ã¢ã³ãµã³ãã«åŠç¿ã®äžçš®ã§ããã¢ã³ãµã³ãã«åŠç¿ã¯ãè€æ°ã®åŠç¿åšïŒã¢ãã«ïŒãçµã¿åãããŠãåäžã®åŠç¿åšãããåªããäºæž¬æ§èœãç®æãææ³ã§ããAdaBoostãšã©ã³ãã ãã©ã¬ã¹ãã¯å
±ã«ã¢ã³ãµã³ãã«åŠç¿ã®ææ³ã§ããããã®ã¢ãããŒããšç¹åŸŽã«ã¯ããã€ãã®éèŠãªéãããããŸãã
AdaBoost
ã¢ãããŒã: AdaBoostã¯ããŒã¹ãã£ã³ã°ææ³ã®äžã€ã§ãè€æ°ã®åŒ±åŠç¿åšãé次çã«èšç·ŽããŠãããŸããåã¹ãããã§ãæ°ãã匱åŠç¿åšã¯åã®åŠç¿åšã誀åé¡ããããŒã¿ãã€ã³ãã«çŠç¹ãåœãŠããããã®ããŒã¿ãã€ã³ãã®éã¿ãå¢å ãããŸããããã«ãããé£ããã±ãŒã¹ã«å¯ŸããåŠç¿åšã®é©å¿èœåãåäžããŸãã
匱åŠç¿åš: ããã©ã«ãã§ã¯æ±ºå®æšïŒéåžžã¯æ·±ãã1ã®æ±ºå®æšïŒã䜿çšãããŸãããä»»æã®åŠç¿ã¢ã«ãŽãªãºã ã匱åŠç¿åšãšããŠäœ¿çšããããšãã§ããŸãã
éã¿ä»ã: åŠç¿éçšã§åããŒã¿ãã€ã³ããšåŠç¿åšã«éã¿ãä»ãããããããã®éã¿ãçšããŠã¢ãã«ã®æŽæ°ãšæçµçãªäºæž¬ãè¡ãããŸãã
ã©ã³ãã ãã©ã¬ã¹ã
ã¢ãããŒã: ã©ã³ãã ãã©ã¬ã¹ãã¯ãã®ã³ã°ææ³ã®äžã€ã§ãå€æ°ã®æ±ºå®æšã䞊åã«èšç·ŽããŸããå決å®æšã¯ãã¬ãŒãã³ã°ããŒã¿ã®ã©ã³ãã ãªãµãã»ããã䜿çšããŠèšç·Žãããæçµçãªäºæž¬ã¯å šãŠã®æ±ºå®æšã®äºæž¬ã®å¹³åïŒååž°ã®å ŽåïŒãå€æ°æ±ºïŒåé¡ã®å ŽåïŒã«ãã£ãŠè¡ãããŸãã
ããŒã¿ã®ã©ã³ãã æ§: ã©ã³ãã ãã©ã¬ã¹ãã§ã¯ãå決å®æšã®èšç·Žã«äœ¿ãããŒã¿ã»ãããããŒãã¹ãã©ãããµã³ããªã³ã°ïŒåŸ©å æœåºïŒã«ãã£ãŠçæããŸããããã«ãååå²ïŒããŒãïŒã§ã®ç¹åŸŽéã®éžæãã©ã³ãã ãªãµãã»ããããè¡ãããŸãã
å€æ§æ§ã®è¿œæ±: ã©ã³ãã ãã©ã¬ã¹ãã¯ãå決å®æšã®äºæž¬ã®å€æ§æ§ãé«ããããšã§ãéåŠç¿ãé²ãã€ã€ãã¢ãã«ã®æ±åæ§èœãåäžãããããšãç®æããŸãã
äž»ãªéã
åŠç¿ã®é²ãæ¹: AdaBoostã¯åŠç¿åšãé次çã«èšç·ŽããŠãããåã¹ãããã§åã®åŠç¿åšã®èª€ããä¿®æ£ããããšããŸããäžæ¹ãã©ã³ãã ãã©ã¬ã¹ãã¯å€æ°ã®æ±ºå®æšã䞊åã«èšç·ŽããŸãã
ããŒã¿ãžã®ã¢ãããŒã: AdaBoostã¯åŠç¿éçšã§ããŒã¿ãã€ã³ãã«éã¿ãã€ããããã䜿ã£ãŠã¢ãã«ãé©å¿ãããŠãããŸããã©ã³ãã ãã©ã¬ã¹ãã¯å決å®æšã«ç°ãªãããŒã¿ãµã³ãã«ïŒããŒãã¹ãã©ãããµã³ãã«ïŒã䜿çšããŸãã
å€æ§æ§ã®å°å ¥æ¹æ³: AdaBoostã¯èª€ãã«çŠç¹ãåœãŠãããšã§å€æ§æ§ãå°å ¥ããã©ã³ãã ãã©ã¬ã¹ãã¯ããŒã¿ãµã³ããªã³ã°ãšç¹åŸŽéã®ã©ã³ãã éžæã«ãã£ãŠå€æ§æ§ã確ä¿ããŸãã
é©çšæ§ãšæ§èœ
éåŠç¿ãžã®å¯Ÿå¿: AdaBoostã¯ããŒã¿ããã€ãºãå€ãå«ãå Žåãå€ãå€ãååšããå Žåã«ã¯éåŠç¿ããããåŸåããããŸããããã¯ãé£ããã±ãŒã¹ã«å¯ŸããŠéã¿ãå¢ããç¶ãããããã¢ãã«ãéå°ã«é©å¿ããŠããŸãããã§ããäžæ¹ã§ãã©ã³ãã ãã©ã¬ã¹ãã¯å€ãã®ç¬ç«ããã¢ãã«ããã®äºæž¬ãçµã¿åããããããéåŠç¿ã«å¯ŸããŠãã匷ãèæ§ãæã¡ãŸãã
èšç®ã³ã¹ã: AdaBoostã®åŠç¿ããã»ã¹ã¯é次çã§ããããã倧èŠæš¡ãªããŒã¿ã»ããã«å¯ŸããŠã¯æéããããããšããããŸããã©ã³ãã ãã©ã¬ã¹ãã¯æ±ºå®æšã䞊åã«èšç·Žã§ãããããèšç®è³æºãå¹ççã«äœ¿çšã§ãã倧èŠæš¡ãªããŒã¿ã»ããã«å¯ŸããŠãæ¯èŒçè¿ éã«åŠçããããšãå¯èœã§ãã
調æŽãã¹ããã€ããŒãã©ã¡ãŒã¿: AdaBoostã§ã¯åŠç¿çã匱åŠç¿åšã®æ°ãªã©ã®ãã€ããŒãã©ã¡ãŒã¿ãé©åã«èšå®ããå¿ èŠããããŸããã©ã³ãã ãã©ã¬ã¹ãã§ã¯ã決å®æšã®æ°ãç¹åŸŽéã®æ°ãæšã®æ·±ããªã©ã®ãã©ã¡ãŒã¿ãæ§èœã«åœ±é¿ãäžããŸãã