Upgrade to Pro — share decks privately, control downloads, hide ads and more …

予約データから未来の客数を予測する:第22回 Machine Learning 15minut...

予約データから未来の客数を予測する:第22回 Machine Learning 15minutes! / Predict number of customers in restaurants

トレタの保持する飲食店の予約データを使って、未来のお客様の数を予測するモデルを構築します。予約データの特性と時系列モデリングの導入から説明します。
本資料は下記の勉強会で発表いたしました。
2018年3月31日「第22回 Machine Learning 15minutes! 」
https://machine-learning15minutes.connpass.com/event/78109/

Tetsuro Shimada

March 31, 2018
Tweet

More Decks by Tetsuro Shimada

Other Decks in Technology

Transcript

  1. 5PSFUB *OD"MMSJHIUSFTFSWFE τϨλͷ໾ׂ   w τϨλ͸ҿ৯ళͷόοΫϘʔϯͱͯ͠ɺҿ৯ళͷ༧໿ΦϖϨʔγϣϯΛࢧ͍͑ͯ·͢ ͓٬༷ ҿ৯ళ τϨλ

    ϝσΟΞ ݕࡧྲྀೖ Ϛε޿ࠂ ωοτ༧໿ ༧໿ΦϖϨʔγϣϯ αϙʔτ ి࿩༧໿ τϨλωοτ༧໿ ༧໿৘ใ ސ٬৘ใ ళฮ৘ใ
  2. 5PSFUB *OD"MMSJHIUSFTFSWFE ༧໿σʔλͷಛੑ   ༧໿ ೔ɹɹ෇ ࣌ɹɹؒ ਓɹɹ਺ ໊ɹɹલ

    ి࿩൪߸ ళɹɹฮ ςʔϒϧ ίʔε ɹ d ໊ τϨλଠ࿠  ϨετϥϯτϨλ ൪ςʔϒϧ τϨλίʔε ϋογϡ*%ʹͯ͠ ಗ໊Ճ޻ ΢ΥʔΫΠϯ ٬਺ ʴ ʹ ೔ɹɹ෇ ࣌ɹɹؒ ਓɹɹ਺ ళɹɹฮ ςʔϒϧ ɹ d ໊ ϨετϥϯτϨλ ൪ςʔϒϧ ✴༧໿ແ͠Ͱདྷళ͢Δ͓٬༷ ✴τϨλͷ৔߹ɺΦϖϨʔγϣϯ্ͷೖྗ
 ·ͨ͸104࿈ܞͰσʔλԽ͞ΕΔ ੮਺ ʽ
  3. 5PSFUB *OD"MMSJHIUSFTFSWFE ༧໿σʔλͷಛੑ       

           ະདྷͷσʔλ ࠓ೔ աڈͷσʔλ
  4. 5PSFUB *OD"MMSJHIUSFTFSWFE ༧ଌϞσϧͷߏங ࢖༻͢ΔٙࣅσʔλΛੜ੒      

                                       ʴ ʴ ٬਺ͷฏۉ िͷมಈ قઅมಈ
  5. 5PSFUB *OD"MMSJHIUSFTFSWFE ༧ଌϞσϧͷߏங Ϟσϧͷબఆ   ঢ়ଶۭؒϞσϧ "3*."Ϟσϧ ༩͑ΒΕͨσʔλʹରͯ͠֊ࠩʢ϶:U:U:Uʣ ΛऔΓɺτϨϯυΛআڈͯ͠ఆৗੑΛ֬อ্ͨ͠

    Ͱ"3."ϞσϧΛద༻͢Δɻ"3."Ϟσϧ͸"3 Ϟσϧͱ."ϞσϧΛϛοΫεͨ͠΋ͷͰɺʮকདྷ ͷ:͸ɺաڈͷ:ͱաڈͷޡࠩʹΑͬͯઆ໌͞ΕΔʯ ͱ͢ΔϞσϧͷ͜ͱɻ ࣌ؒʹԊͬͯมԽ͢Δʮঢ়ଶʯͱɺঢ়ଶ͔ΒϊΠ ζΛ൐ͬͯ஋͕ʮ؍ଌʯ͞ΕΔͱ͢ΔϞσϧɻ໨ తม਺ʹର͢Δઆ໌ม਺ͷӨڹͷղऍ͕༰қͰɺ σʔλ఺ʹܽଛ͕͋ͬͨ৔߹Ͱ΋ϞσϧԽͰ͖Δɻ yt = 0.85yt 1 + 0.23yt 2 + ✏t 1 + · · · <latexit sha1_base64="itPa1b/VC3z3HFMOGl8kHfZeUDc=">AAACHHicbVDLSsNAFL3xWeur6tJNVARBGpKKWBeC6MalgrWFtpTJ9KYOnUzizEQoIR/iyk/RjaCIK0HwQ9w7fSy0emDgcM653LnHjzlT2nU/rYnJqemZ2dxcfn5hcWm5sLJ6paJEUqzQiEey5hOFnAmsaKY51mKJJPQ5Vv3uad+v3qJULBKXuhdjMyQdwQJGiTZSq7DXa6U6O3Kd8n6fFb1s13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sV4j/eb1UhWdeTnmSKuBkOihMmaViq0jE6lMBRLFME0wE1X+1yBALTJTOraZTaM7uPE+ck8Z5o3lj11uXZRxVtI8O0BFqolPUQteojRxE0CN6Rq/ozXgyXox342NaWjHKnl30B8bnD9+amSw=</latexit> µt = µt 1 + ⌘t <latexit sha1_base64="VhCuoI49ttBxPIJ8kwbpIA78Kos=">AAACA3icbVA9SwNBEJ2LXzF+Re20OQ1CQAw5G7UQgjaWETwTyIWwt5lLluztnbt7QjgCVv4UK0ERW8H/YOUPsXfzUWj0wTCP92bYnefHnCldLn9amZnZufmF7GJuaXlldS2/vnGtokRSdGnEI1n3iULOBLqaaY71WCIJfY41v3c+9Gu3KBWLxJXux9gMSUewgFGijdTKb3lh0kr14HTcD5zBvoeaDKVWvlAulUew/xJnQgqVneLXOwBUW/kPrx3RJEShKSdKNQKON6KZEqkZ5TjIeYnCmNAe6WDDUEFCVM10dMTA3jNK2w4iaUpoe6T+3EhJqFQ/9M1kSHRXTXtD8T+vkejguJkyEScaBR0/FCTc1pE9TMRuM4lU874hhEpm/mrTLpGEapNbzqTgTN/8l7iHpZOSc2nSOIMxsrANu1AEB46gAhdQBRco3MEDPMGzdW89Wi/W63g0Y012NuEXrLdv8aWazQ==</latexit> <latexit sha1_base64="Jps0U1ADiJim1dk2qNfvw17azig=">AAACA3icbVDLSsNAFJ34rPUVdaebaBEqYkncqAuh6MZlBWsLTQiT6U07dDKJMxOhhIIrt/6FK0ERt278BVd+iHunj4W2Hrjcwzn3MnNPkDAqlW1/GVPTM7Nz87mF/OLS8sqqubZ+LeNUEKiSmMWiHmAJjHKoKqoY1BMBOAoY1ILOed+v3YKQNOZXqpuAF+EWpyElWGnJNzfdKPUz1Tsd9gOnt++Cwn3JNwt2yR7AmiTOiBTK28Xvjwd3r+Kbn24zJmkEXBGGpWyEDG64l2GhKGHQy7uphASTDm5BQ1OOI5BeNjiiZ+1qpWmFsdDFlTVQf29kOJKyGwV6MsKqLce9vvif10hVeOxllCepAk6G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j4yPb8eJmq8=</latexit> ঢ়ଶʢЖʣʹϊΠζʢЏʣ͕ՃΘͬͯ஋ ͕؍ଌʢZʣ͞ΕΔ ঢ়ଶ͸ɺ࣌ࠁલͷঢ়ଶʹϊΠζʢБʣ ͕ՃΘͬͯߋ৽͞ΕΔ ঢ়ଶʢЖʣʹϊΠζʢЏʣ͕ՃΘͬͯ஋ ͕؍ଌʢZʣ͞ΕΔ ঢ়ଶ͸ɺ࣌ࠁલͷঢ়ଶʹτϨϯυ߲ ʢЌʣͱϊΠζʢБʣ͕ՃΘͬͯߋ৽͞ ΕΔ τϨϯυ߲͸࣌ࠁલͷτϨϯυʹϊΠ ζʢАʣ͕ՃΘͬͯߋ৽͞ΕΔ पظతͳมಈΛμϛʔม਺ͱͯ͠ද ݱͯ͠Ϟσϧʹ૊ΈࠐΉ 4FBTPOBMͱͳ͍ͬͯΔ͕ɺࠓճͷ৔ ߹͸िͷपظతͳมಈΛઆ໌͢Δͨ Ίʹ4FBTPOBMΛ࢖༻͢Δ $ZDMF͸4FBTPOBMΑΓ௕ظతͳϏδ ωεαΠΫϧΛදݱ͢ΔͨΊʹϞσ ϧʹ૊Έࠐ·ΕΔ ࠓճ͸قઅมಈΛઆ໌͢ΔͨΊʹ࢖ ༻͢Δ
  7. 5PSFUB *OD"MMSJHIUSFTFSWFE ༧ଌϞσϧͷߏங ֶशͷ࣮ߦ   w ֶश͸਺ߦͷίʔυͰ׬ྃ͢Δ w -PDBMMFWFMͰΦϓγϣϯແ͠ͷ৔߹Λ࣮ߦͯ͠ΈΔ

    1 ts_training = daily_customers['2017'] 2 3 model = sm.tsa.UnobservedComponents(ts_training['customers'].to_frame(), level='local level') 4 5 result = model.fit() 6 7 print(result.summary()) 8 9 rcParams['figure.figsize'] = 15, 20 10 fig = result.plot_components() ߦ໨ɿ೥ʹظؒΛݶఆֶͯ͠शσʔλΛ༻ҙ͢Δ ߦ໨ɿֶशσʔλͱΦϓγϣϯΛࢦఆͯ͠ɺঢ়ଶۭؒϞσϧΛΠϯελϯεԽ ɹɹɹɹࠓճ͸ϩʔΧϧϨϕϧϞσϧͰΦϓγϣϯແ͠ ߦ໨ɿσʔλʹରͯ͠ύϥϝʔλͷֶशΛ࣮ߦ ߦ໨ɿֶश݁ՌͷαϚϦΛίϯιʔϧʹग़ྗ ߦ໨ɿঢ়ଶۭؒϞσϧͷߏ੒ཁૉΛඳը -PDBM MFWFM
  8. 5PSFUB *OD"MMSJHIUSFTFSWFE ༧ଌϞσϧͷߏங ֶशͷ࣮ߦʢճ໨ʣ   w -PDBMMJOFBSUSFOEͰTFBTPOBMɺDZDMF5SVFͰ࣮ߦͯ͠ΈΔ 1 ts_training

    = daily_customers['2017'] 2 3 model = (sm.tsa.UnobservedComponents(ts_training['customers'].to_frame(), level='local linear trend' 4 , seasonal=7, cycle=True, cycle_period_bounds=(30,500))) 5 6 result = model.fit() 7 8 print(result.summary()) 9 10 rcParams['figure.figsize'] = 15, 30 11 fig = result.plot_components() ߦ໨ɿมߋ఺͸ɺMFWFMʹʮMPDBMMJOFBSUSFOEʯΛࢦఆͯ͠ɺTFBTPOBMͱDZDMFͷΦϓγϣϯΛ෇͚ͨ͜ͱ ɹɹɹɹDZDMF@QFSJPE@CPVOET͸DZDMFͷपظΛ୳ࡧ͢ΔϨϯδ -PDBM MJOFBS USFOE  TFBTPOBM  DZDMF
  9. 5PSFUB *OD"MMSJHIUSFTFSWFE ༧ଌϞσϧͷߏங Ϟσϧߏ੒ཁૉͷ֬ೝ   -FWFM 5SFOE 4FBTPOBM $ZDMF

    ঢ়ଶۭؒϞσϧͷʮঢ়ଶʯͷมԽ τϨϯυͷมԽ σʔλશମΛ௨ͯ͠ಉ͡܏޲ʹ͋Δཁૉ͕ දݱ͞ΕΔ͜ͱ͕๬·͍͠ 4FBTPOBMΛ೔पظͱઃఆͨͨ͠Ί िʹΑΔมಈ͕දݱ͞Ε͍ͯΔ μϛʔม਺ͷͨΊɺपظత͕ͩಉҰि಺Ͱ͸ෆنଇ $ZDMF͸ࡾ֯ؔ਺Ͱදݱ͞ΕΔͨΊ ඇৗʹنଇਖ਼͍͠पظੑ͕දݱ͞ΕΔ قઅมಈΛදݱ͢ΔͨΊʹ͸ ਺೥ʹ౉Δσʔλ͕ඞཁͦ͏
  10. 5PSFUB *OD"MMSJHIUSFTFSWFE ༧ଌϞσϧͷߏங ֶशͷ਍அ   -PDBM MFWFM -PDBM MJOFBS

    USFOE  TFBTP OBM  DZDMF ࢒ࠩͷ෼෍ ࢒ࠩ͸ϞσϧͰදݱ͖͠Ε ͳ͔ͬͨ෦෼ͳͷͰɺϗϫ ΠτϊΠζʢఆৗ෼෍ʣ͕ ๬·͍͠ ͜͜ʹ໌Β͔ͳ܏޲͕࢒ͬ ͍ͯΔ৔߹͸ɺϞσϧʹͦ ͷ܏޲Λදݱ͢Δม਺Λ௥ Ճ͢΂͖ ࢒ࠩͷίϨϩάϥϜ ࣗݾ૬ؔΛ֬ೝ͢Δάϥϑ σϑΥϧτͰMBH·Ͱͷ ίϨϩάϥϜ͕දࣔ͞ΕΔ ࣗݾ૬͕ؔ͋Δ৔߹ɺ͋Δ ࣌఺ͷ஋͸ɺաڈͷ஋ʹ૬ ؔؔ܎͕͋Δ஋ͱݟͳͤΔ Ϟσϧ͕આ໌Ͱ͖ͳ͔ͬͨ पظੑ͕͋Δ৔߹͸ɺࣗݾ ૬͕ؔ࢒Δ
  11. 5PSFUB *OD"MMSJHIUSFTFSWFE ༧ଌϞσϧͷߏங Ϟσϧͷબ୒   w جຊతʹ͸࣮ߦ݁ՌͰ"*$ʢ੺஑৘ใྔن४ʣͷ௿͍ϞσϧΛબ୒͢Δ Unobserved Components

    Results ==================================================================================== Dep. Variable: customers No. Observations: 365 Model: local linear trend Log Likelihood -1033.339 + stochastic seasonal(7) AIC 2076.679 + cycle BIC 2096.178 Date: Wed, 28 Mar 2018 HQIC 2084.428 Time: 19:56:21 Sample: 01-01-2017 - 12-31-2017 Covariance Type: opg ==================================================================================== coef std err z P>|z| [0.025 0.975] ------------------------------------------------------------------------------------ sigma2.irregular 14.6858 1.183 12.412 0.000 12.367 17.005 sigma2.level 6.23e-10 0.219 2.84e-09 1.000 -0.429 0.429 sigma2.trend 0.0024 0.002 1.551 0.121 -0.001 0.005 sigma2.seasonal 0.0061 0.015 0.393 0.694 -0.024 0.036 frequency.cycle 0.1024 0.017 5.893 0.000 0.068 0.136 =================================================================================== Ljung-Box (Q): 33.60 Jarque-Bera (JB): 2.78 Prob(Q): 0.75 Prob(JB): 0.25 Heteroskedasticity (H): 0.95 Skew: -0.15 Prob(H) (two-sided): 0.78 Kurtosis: 3.32 =================================================================================== Warnings: [1] Covariance matrix calculated using the outer product of gradients (complex-step).
  12. 5PSFUB *OD"MMSJHIUSFTFSWFE ༧ଌੑೳʹ͍ͭͯ ධՁࢦඪ   MAPE = 100 n

    ⇥ n X i=1 | ࣮ଌ஋i ༧ଌ஋i | ࣮ଌ஋i <latexit sha1_base64="LW7fseL7eqD7VNZtaIXRf5bt2aA=">AAACtnicfVLBTttAEB27hdJAIdBjL6sGJA40srlQDkjQqlIvrVKpgUhJiNabcVix3rV214jI+N6/6E/10r/pxInaEKTOytbb9+Z51jOb5Eo6H0W/g/DZ87X1FxsvG5tbr7Z3mrt7l84UVmBXGGVsL+EOldTY9dIr7OUWeZYovEpuP870qzu0Thr93U9zHGZ8omUqBfdEmWYKA8ggAQP3UMIXuIAOfIIKzohPwQIHQXwMEa2KkKY3I82DJB+Cq3cOCtqNSJfkjCnnein333celqv1f+qjzj7lzH0VvFtWv/5YUR/q+v/zV6NmK2pHdbCnIF6AFiyiM2r+GoyNKDLUXijuXD+Ocj8sufVSKKwaB4PCYc7FLZ9gn6DmGbphWbe9YgfEjFlqLD3as5ptLDlKnjk3zRLKzLi/cavajPyrPS7l0/fDUuq88KjFvFJaKOYNmw2RjaVF4dWUABdW0mmZuOGWC0+jblAb4tWffgq6x+3Tdvwtap1/WPRjA97AWzik+Z3AOXymm9AFERwHvYAHSXgajkIMJ/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owrxyS1thuFueuV1DjBJK+CrbiwPKfsnt7yLkJFM257ZT3OimwhMyCpNpjKkZoNpipKmlk7zBJ0ZtTd2VltRL5qb1u5dL9XCpUXjis27pQWkjhNRsshA2E4c3KIgDIj8LWE3VFDmcMVBjiGaPbT70Fnt3XQin6FzZPTyTyWYBO+wDfczB6cwDm0oQPMC7zQO/AO/XV/zz/yj8dW35vUfIY34Z//B1Neq6A=</latexit> ਫ਼౓Λޡࠩͷύʔηϯτͱͯ͠ද͢ ͜ͷछͷதͰ͸Ұൠతʹར༻͞ΕΔ ਫ਼౓Λޡࠩͱಉ͡୯ҐͰද͢ ޡࠩͷྔΛ֓೦Խ͢Δͷʹ໾ཱͭ ෼ࢄ΍ඪ४ภࠩʹ͍ۙܭࢉࣜͱͳ͍ͬͯΔͨΊɺ ྨࣅͨ͠஋ͱଊ͑Δ͜ͱ͕Ͱ͖Δ ޡࠩͷࠩΛೋ৐͍ͯ͠ΔͨΊɺޡ͕ࠩେ͖͍৔߹ ʹڧௐͯ͠ܭࢉ͞Εɺ֎Ε஋ͷӨڹΛड͚΍͍͢ ฏۉઈରύʔηϯτޡࠩ ʢ."1&ʣ ฏۉઈରภࠩ ʢ."%ʣ ฏۉฏํภࠩ ʢ.4%ʣ ධՁࢦඪ ܭࢉࣜ ֓ཁ
  13. 5PSFUB *OD"MMSJHIUSFTFSWFE ༧ଌੑೳʹ͍ͭͯ ೥݄ͷ༧ଌൺֱ   w ࠇઢ͕࣮੷Ͱɺ੺ઢ͕༧ଌ  

        -PDBMMFWFM -PDBMMJOFBSUSFOE 4FBTPOBM $ZDMF -PDBMMFWFM 4FBTPOBM "*$ ."1& "*$ ."1& "*$ ."1& w ࣌ܥྻσʔλ͸͋Δ࣌఺Ͱαϯϓϧ਺ͷσʔλͷͨΊɺ༧ଌ͸؆୯ʹ౰ͨΒͳ͍ w ֶश࣌ͷධՁࢦඪ͸ඞͣ͠΋༧ଌ࣌ͷੑೳΛ୲อ͠ͳ͍ w ༧ଌ࣌ʹ͸࣮ࡍͷΞΫγϣϯΛݟਾ͑ͨධՁࢦඪʢྫ͑͹ച্ʣΛઃఆ͢΂͖
  14. 5PSFUB *OD"MMSJHIUSFTFSWFE   σʔλΛ࢖ͬͯʮ৯ͷ࢓ࣄΛɺ͓ ΋͠Ζ͘ʯ͢Δ஥ؒΛืू w ը૾ॲཧʢྉཧ΍͓ళͷࣸਅʣ w ࣗવݴޠॲཧʢϝχϡʔɺϨ

    Ϗϡʔɺ104ʣ w Ϧίϝϯσʔγϣϯ w ࣌ܥྻϞσϧʢधཁ༧ଌʣ σʔλαΠΤϯςΟετืूத ҿ৯ۀσʔλϏδωεల։த ໿ສళฮɺ೥ؒສ݅ͷ༧ ໿σʔλΛ࢖ͬͯɺ৽͍͠Ϗδω εΛى͜͢ύʔτφʔΛืू w ϚʔέςΟϯάϦαʔν w धཁ༧ଌ w ༧໿࠷దԽ
  15. 5PSFUB *OD"MMSJHIUSFTFSWFE "QQFOEJY   1 import numpy as np

    2 import pandas as pd 3 4 from matplotlib import pylab as plt 5 from matplotlib.pylab import rcParams 6 %matplotlib inline 7 8 import statsmodels.api as sm ࣮ߦ؀ڥ w .BD04)JHI4JFSSB w 1ZUIPO w +VQZUFS w /VNQZ w 1BOEBT w .BUQMPUMJC w 4UBUTNPEFMT ϥΠϒϥϦ
  16. 5PSFUB *OD"MMSJHIUSFTFSWFE "QQFOEJY ٙࣅσʔλੜ੒   1 start = pd.datetime(2017,

    1, 1) 2 end = pd.datetime(2018, 1, 31) 3 date_index = pd.date_range(start=start, end=end) 4 5 mu = 40 6 mu_week = [-2, -4, 0, 1, 7, 8, 3] 7 s = 4 8 9 10 def mu_season(x): 11 if (x % 365) < 31: 12 return -0.3*(x % 365) + 10 13 elif 31 <= (x % 365) < 90: 14 return 0.15*((x % 365)-31) 15 elif 90 <= (x % 365) < 212: 16 return -0.09*((x % 365)-90) + 10 17 elif 212 <= (x % 365) < 243: 18 return 0.3*((x % 365)-212) 19 elif 243 <= (x % 365) < 273: 20 return -0.3*((x % 365)-243)+10 21 elif 273 <= (x % 365): 22 return 0.11*((x % 365)-273) 23 24 25 Y = [] 26 np.random.seed(1234) 27 for i in range(len(date_index)): 28 Y.append(np.absolute(np.floor(np.random.normal(loc=mu + mu_week[i % 7] + mu_season(i), scale=s)))) 29 30 daily_customers = pd.DataFrame(data={'date': date_index, 'customers': Y}, index=date_index) ٙࣅσʔλ ੜ੒ 1 ax = daily_customers['customers'].plot(figsize=(8, 4), grid=True, color='black') 2 ax.set_ylabel('customers') 3 fig = ax.get_figure() ඳը
  17. 5PSFUB *OD"MMSJHIUSFTFSWFE "QQFOEJY Ϟσϧͷֶश   1 ts_training = daily_customers['2017']

    2 3 model = sm.tsa.UnobservedComponents(ts_training['customers'].to_frame(), level='local level') 4 5 result = model.fit() 6 7 print(result.summary()) -PDBMMFWFM NPEFMͷֶश 1 ts_training = daily_customers['2017'] 2 3 model = (sm.tsa.UnobservedComponents(ts_training['customers'].to_frame(), level='local linear trend' 4 , seasonal=7, cycle=True, cycle_period_bounds=(30,500))) 5 6 result = model.fit() 7 8 print(result.summary()) -PDBMMJOFBS USFOE  TFBTPOBM  DZDMFNPEFM ͷֶश 1 ts_training = daily_customers['2017'] 2 3 model = (sm.tsa.UnobservedComponents(ts_training['customers'].to_frame(), level='local linear trend', seasonal=7)) 4 5 result = model.fit() 6 7 print(result.summary()) -PDBMMFWFM  TFBTPOBM NPEFMͷֶश
  18. 5PSFUB *OD"MMSJHIUSFTFSWFE "QQFOEJY Ϟσϧͷ֬ೝɾ༧ଌͷ࣮ߦͱ."1&ͷࢉग़   1 rcParams['figure.figsize'] = 25,

    20 2 fig = result.plot_diagnostics() NPEFMͷ DPNQPOFOU TΛඳը 1 rcParams['figure.figsize'] = 15, 30 2 fig = result.plot_components() NPEFMͷ਍அ Λඳը 1 pred = result.predict(pd.to_datetime('2017-12-31'), pd.to_datetime('2018-01-31')) 2 3 ax = daily_customers['customers'].plot(figsize=(8, 4), grid=True, color='black') 4 ax.set_xlim([pd.datetime(2017, 12, 30), pd.datetime(2018, 1, 31)]) 5 ax.set_ylabel('customers') 6 ax = pred.plot(figsize=(8, 4), grid=True, color='red') 7 fig = ax.get_figure() ༧ଌͷ࣮ߦͱ ඳը 1 eval_test = daily_customers['customers']['2018'] 2 eval_pred = pred['2018'] 3 4 mape = 100 * np.sum(np.absolute(eval_test - eval_pred) / eval_test) / eval_test.shape[0] 5 print("MAPE = {0:.3f}".format(mape)) ."1&ͷࢉग़