I nd o ne s ia n J o urna l o f   E lect rica l En g ineering   a nd   Co m p u t er   Science   Vo l.   1 2 ,   No .   1 ,  Octo b er   201 8 ,   p p .   1 5 5 ~ 1 6 0   I SS N:  2502 - 4752 ,   DOI : 1 0 . 1 1 5 9 1 / i j ee cs . v 1 2 .i 1 . p p 155 - 1 6 0           155       J o ur na l ho m ep a g e :  h ttp : //ia e s co r e. co m/jo u r n a ls /in d ex . p h p / ijeec s   Neig hbo r Weigh t ed K - Nea res t  Nei g hbo r f o r Sa m ba t  O nlin e  Cla ss ificatio n       Anni s y a   April ia   P ra s a nti,   M .   Ali F a uzi,  M .   T a nzil F urqo n   F a c u lt y   o f   Co m p u ter S c ien c e ,   Bra w ij a y a   Un iv e rsit y ,   M a lan g ,   In d o n e sia       Art icle  I nfo     AB ST RAC T   A r ticle  his to r y:   R ec eiv ed   Ma y   6 ,   2 0 1 8   R ev i s ed   Ma y   2 9 ,   2 0 1 8   A cc ep ted   J u n   1 6 ,   2 0 1 8       S a m b a t   On li n e   is  o n e   o f   th e   i m p l e m e n tatio n   o f   E - G o v e rn m e n t  f o r  c o m p lain ts  m a n a g e m e n t  p ro v id e d   b y   M a lan g   Cit y   G o v e rn m e n t.   A ll   o f   th e   c o m p lain ts   w il l  b e   c las sif ied   in to   it s  in ten d e d   d e p a rtm e n t.   In   th is  stu d y ,   a u to m a ti c   c o m p lain t  c las sif ic a ti o n   sy ste m   u sin g   Ne ig h b o r  W e ig h ted   K - Ne a re st   Ne ig h b o r  (NW - KN N)  is  p o p o se d   b e c a u se   S a m b a t  On li n e   h a s  im b a lan c e d   d a ta.  T h e   s y ste m   d e v e lo p e d   is  c o m p o se d   o f   th re e   m a jo r  p h a se s  in c lu d i n g   p re p ro c e ss in g ,   N - G ra m   f e a tu re   e x trac ti o n ,   a n d   c las sif ic a ti o n   u s in g   NW - KN N.  Ba se d   o n   t h e   e x p e rim e n t   r e su lt s,  it   c a n   b e   re su m e d   th a t  th e   NW - KN N   a lg o rit h m   is  a b le  to   c las sify   th e   i m b a lan c e d   d a ta  w e ll   w it h   th e   m o st  o p ti m a l  k - n e ig h b o r  v a lu e   is  3   a n d   u n ig ra m   a s  th e   b e st  f e a tu re s  b y   7 7 . 8 5 %   p re c isio n ,   7 4 . 1 8 %   re c a ll ,   a n d   7 5 . 2 5 %   f - m e a su re   v a lu e .   Co m p a re d   to   th e   c o n v e n ti o n a l   KN N,  NW - KN N  a lg o rit h m   a lso   p ro v e d   to   b e   b e tt e r  f o r  im b a lan c e d   d a ta  p ro b lem s  w it h   v e r y   slig h t  d iff e re n c e s.   K ey w o r d s :   T ex t Cl ass i f icat io n   Sa m b at  O n li n e   N - Gr a m   NW - KNN   Neig h b o r   W eig h ted   K - Nea r e s t   Neig h b o r .   Co p y rig h t  ©   2 0 1 8   In stit u te o f  A d v a n c e d   E n g i n e e rin g   a n d   S c ien c e .    Al l  rig h ts  re se rv e d .   C o r r e s p o nd ing   A uth o r :   M.   A li Fa u zi   Facu lt y   o f   C o m p u ter   Scien ce ,   B r a w ij ay a  U n i v er s it y ,     Ma lan g ,   I n d o n esia.   E - m a il:  m o c h . ali. f au zi @ u b . ac . id       1.   I NT RO D UCT I O N   E lectr o n ic  g o v er n m e n t  ( e - g o v er n m e n t)   h as  b ec o m e  a n   e m er g i n g   tr e n d   f o r   th e   p ast  t w o   d ec ad es.   No w ad a y s ,   e - g o v er n m e n t  is   n o t  li m ited   to   th e  d ev elo p ed   co u n tr ie s .   T h er e  ar e   s o m e  i n n o v ativ e  e - g o v er n m en t   ap p licatio n   in   th e  d ev elo p in g   co u n tr ies,  as  I C T s   ar e  b ein g   g r o w i n g l y   u s ed   b y   g o v er n m en t  an d   co n n ec t  it   m o r e  c l o s el y   w it h   t h eir   cit ize n s .   W it h   t h e  ap p licatio n   o f   e - g o v er n m e n t,  t w o - w a y   co m m u n ica tio n   b et w ee n   citizen s   an d   g o v er n m e n t  ca n   b e  d ev elo p ed   ea s il y .   C itizen s   ca n   co n v e y   th e ir   asp ir atio n ,   c r itics ,   o r   o p in io n   to   th e  g o v er n m en t  w ith o u t  an y   d if f icu lties   [ 1 ] .   SA MB A T   On li n e  is   o n e  o f   t h e  i m p le m en tati o n   o f   e - g o v er n m e n t   p r o v id ed   b y   Di s k o m i n f o   ( C o m m u n icatio n   an d   I n f o r m ati o n   Dep ar t m e n t)   o f   Ma lan g   cit y   g o v er n m en t.   S A MB A T   On li n e  is   an   ap p licatio n   f o r   co m p lai n t  s y s te m   th at  en ab le  p eo p le   o f   Ma lan g   cit y   to   ex p r ess   th ei r   o p in io n s ,   s u g g esti o n s ,   cr itic i s m s ,   q u e s tio n s   o r   co m p lai n t s   ab o u t  t h e  p er f o r m an ce   o f   p u b lic  f ac i liti e s   o r   s er v ices  h eld   b y   t h e  g o v er n m en t.  F u r th er m o r e,   Di s k o m i n f o   w il l  v er i f y   an d   ac ce p t  all  i n c o m in g   co m p lai n t s .   T h ey   al s o   h av e  to   s o r t  an d   cl ass i f y   t h e  co m p lai n ts   b ased   o n   th e  i n te n d ed   d ep ar tm en t  m a n u al l y .   Ob v io u s l y ,   w it h   th e   lar g e   n u m b er   o f   in co m i n g   co m p lai n ts ,   t h is   p r o ce s s   is   e x p en s i v e  a n d   ta k es   a  lo t  o f   ti m e.   He n ce ,   a n   au to m at ic  co m p lai n ts   cla s s i f ic atio n   is   r eq u ir ed .   Sa m b at  On lin e  clas s i f icatio n   ca n   b e  co n s id er ed   as  to p ica l  tex t  class i f icat io n .   Var io u s   tr ad itio n al  m ac h in e  lear n in g   m e th o d s   h av e  b ee n   ap p lied   to   s o lv e  th is   p r o b lem   s u ch   as  Naï v e  B a y es  [ 2 - 6 ] ,   Su p p o r t  Vec to r   Ma ch in e s   [ 7 - 8 ] .   K - N ea r est  Neig h b o r s   [ 9 - 1 2 ] ,   Neu r al  Net w o r k   [ 1 3 - 1 4 ] .   T h ese  m et h o d s   h a v e  b ee n   s h o w n   to   p r o v id e  e x ce lle n t  p er f o r m a n ce   in   tex t  clas s i f ic atio n .   Ho w e v er ,   Sa m b at   o n l in e  d atase t  is   a n   i m b alan ce d   d ata.   T h e  p er f o r m an ce   o f   th e s e  m e th o d s   h a s   en co u n ter ed   a  s ig n i f ican t  d r aw b ac k   w h e n   d ea lin g   w it h   i m b ala n ce d   d ata  [ 1 5 - 1 6 ] .   T h e  i m b ala n ce   d ata  is s u e  r is e s   f r eq u en t l y   i n   cl u s ter i n g   an d   class i f ica tio n   s ce n ar io s   w h e n   th e  a m o u n t o f   d ata  w it h   a  p ar ticu lar   cla s s   i s   m u c h   m o r e  th a n   t h e  d ata  in   t h e  o th er   class e s   [ 1 7 ] .   Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   2 5 0 2 - 4752   I n d o n esia n   J   E lec  E n g   &   C o m p   Sci,   Vo l .  1 2 ,   No .   1 ,  Octo b er   201 8   :    1 5 5   –   160   156   T r a d itio n al  m ac h in e  lear n in g   m et h o d s   ten d   to   b e  f lo o d ed   b y   t h e  m aj o r   class   an d   n eg lect   th e  m i n o r   o n es  as  th e y   ar e  ap p lied   to   s u ch   s k e w e d   d ata  [ 1 8 ] .   On e  o f   th e  i m p r o v ed   m ac h i n e  lear n in g   m et h o d s   d ev o ted   t o   tack le  t h e  is s u e  o f   i m b a lan ce d   d ata  is   Neig h b o r   W eig h ted   K - Nea r es t  Neig h b o r   ( NW - KNN) .   NW - KNN  is   an   i m p r o v ed   K - Nea r est  Neig h b o r   ( KNN)   m et h o d   p r o p o s ed   b y   T an   [ 1 9 ]   th at  ad d in g   a  w ei g h ti n g   s tag e   to   s o lv e  i m b a lan ce d   d ata  p r o b le m s .   T h is   m et h o d   ass i g n s   a  s m all  w ei g h t  v al u e  to   th e  n ei g h b o r s   co m i n g   f r o m   th e  m aj o r it y   class   a n d   ass i g n s   a  lar g er   w eig h t   v alu e  to   t h e  n ei g h b o r s   f r o m   m i n o r it y   cla s s e s .   T h is   m et h o d   p r o v e n   to   o b tain   s ig n if ican t  i m p r o v ed   p er f o r m a n ce   o n   i m b ala n ce d   d ata.   I n   th is   s tu d y ,   w e  i m p le m e n t  t h e  NW - KNN  m et h o d   f o r   Sam b at  On lin e  clas s i f icatio n .   W e  u s e  co s i n e   s i m ilar it y   f o r   m ea s u r i n g   te x t  p r o x i m it y   to   d eter m i n e  n ei g h b o r s   in   NW - KNN.   W e  al s o   u s e  N - g r a m   f ea t u r es   to   i m p r o v e  t h e   p er f o r m a n ce   o f   t h is   clas s i f icatio n   m et h o d   d u e   to   it s   p r o m is in g   p er f o r m a n ce   as  co m b in ed   w it h   co s in e  s i m ilar it y   [ 2 0 ] .   B y   ap p ly in g   th e   NW - K NN  m et h o d   s u p p o r ted   b y   N - g r a m   f ea t u r e  ex tr ac tio n ,   i t  i s   ex p ec ted   th at  t h e  class if ica tio n   s y s te m   ca n   h a n d le  th e  i m b al an ce   d ata  class i f icatio n   p r o b lem   w ell.         2.   RE S E ARCH   M E T H O D   As  d ep icted   in   Fi g u r e  1 ,   Sa m b at  On li n e  clas s i f icatio n   in   t h i s   s tu d y   is   co m p s ed   o f   th r ee   m aj ir   p h ases :   1 )   p r e p r o ce s s in g ; 2 )   N - g r a m   f ea tu r e  ex tr ac tio n ; a n d   3 )   class i f icatio n   u s in g   NW - KNN.             Fig u r e  1 .   Sa m b at  On lin e  C las s if icatio n   S y s te m   Ma i n   Flo w c h ar t       2 . 1 .   Do cu m ent   P re pro ce s s i ng   P r ep r o ce s s in g   i s   a  p r o ce s s   t h a t  ai m s   to   p r ep ar e  r a w   d o cu m e n ts   b ef o r e  b ein g   p r o ce s s ed ,   ei th er   f r o m   tr ain i n g   d o cu m e n ts   o r   test   d o cu m e n ts .   T h er e  ar e  s o m e  s tep s   in cl u d ed   in   d o cu m e n t  p r ep r o ce s s in g   s ta g e  in cu d i n g   to k e n izatio n ,   f il ter in g ,   a n d   s te m m i n g .   I n   th e  f ir s t  s tep ,   th e  d o cu m en t  is   s p li tted   in to   s m aller   u n it s   ca lled   to k en s   o r   ter m s   [ 2 1 - 2 2 ] .   I n   th is   s tep ,   all  o f   ch ar ac ter s   ar e  co n v er ted   in to   lo w er ca s e  an d   p u n ctu at io n ,   n u m b er s ,   h t m l  ta g   a n d   ch ar a cter s   o u ts id e  o f   t h e  alp h ab et  ar e  also   r e m o v ed .   T h e  n ex t   s tep   is   f il ter in g   o r   r e m o v i n g   u n i n f o r m ati v e  w o r d s   ca lled   s to p lis t  b ased   o n   a n   ex is tin g   s to p lis t  d ictio n ar y   b y   T ala  [ 2 3 ] .   T h e  f o u r t h   s tep   is   s te m m i n g .   I n   s t e m m in g ,   ev er y   w o r d s   is   co n v er ted   to   its   r o o t  [ 2 4 - 25] .  Fo r   ex a m p le,   t h e  w o r d s   „ j alan ‟ ,   „ d ij alan k a n ‟ ,   an d   „ p er j alan an ‟   w i ll b e  co n v er ted   to   th e  s a m e  w o r d   „ j alan ‟ .     2 . 2 .   N - G ra m   F ea t ures E x t ra ct io n   N - Gr a m   is   a  s lice  o f   n - w o r d   o b tain ed   f r o m   a  d o cu m e n t  [ 2 6 ] .   T h e  n   ca n   v ar ies  f r o m   1   ( u n i g r a m ) ,   2   ( b ig r a m ) ,   3   ( tig r a m ) ,   4 ,   an d   s o   o n .   I n   t h i s   w o r k ,   w e   u s e  u n i g r a m ,   b ig r a m ,   a n d   co m b i n atio n   o f   t h e m .   Fo r   ex a m p le,   if   w e  h av e   a  d o cu m en t  t h at  co n tain   a  s e n te n ce :   “w e   ea t  r ice” ,   t h en   t h e  N - g r a m   f ea t u r es  o f   t h is   d o cu m en t is p r esen ted   in   T ab l e  1 .   Evaluation Warning : The document was created with Spire.PDF for Python.
I n d o n esia n   J   E lec  E n g   &   C o m p   Sci     I SS N:  2502 - 4752       N eig h b o r   W eig h ted   K - N ea r e s t   N eig h b o r   fo r   S a mb a t O n lin e  C la s s i fica tio n   ( M.  A li F a u z i )   157   T ab le  1 .   N - Gr a m   Feat u r e  E x tr ac tio n   R es u lt   U n i g r a m   B i g r a m   C o mb i n a t i o n   o f   U n i g r a m  a n d   B i g r a m   we   e a t   w e   e a t   e a t   r i c e   we   e a t   r i c e     r i c e   w e   e a t   e a t   r i c e       Fu r t h er m o r e,   w e  r ep r esen t  th e   f ea t u r es  w i th   T F.I DF  w ei g h ti n g .   T F.I DF  is   th e   m o s t  h ig h l y   e m p lo y ed   ter m   w ei g h tin g   al g o r ith m   i n   d o cu m e n t  clas s i f icatio n   [ 2 7 ] .   T F. I DF  in co r p o r ate   ter m   f r eq u en c y   ( T F)  an d   in v er s e  d o cu m e n t  f r eq u e n c y   ( I DF) .   T h e  T F.I DF  w eig h t  o f   ter m   f ea tu r e  t  in   d o cu m e n t  d   is   f o r m u lated   a s   f o llo w s :     ) l o g 1 ( ) l o g 1 ( ) , ( , t d d t df N f d t I D F TF     W h er e  d t f ,   is   t h e  n u m b er   o f   o cc u r r en ce s   o f   f ea t u r e  t  i n   d o cu m en t  d   an d   d N   is   t h e  n u m b er   o f   d o cu m en t  i n   d ataset  .   an d   t df   is   th e  n u m b er   o f   d o cu m e n t  in   d ataset  t h at  co n tai n s   f ea t u r e  t.  T h is   f ea tu r e  r ep r esen tati o n   w il l  b e  u s ed   in   th e  cla s s i f ica tio n   s ta g e.     2 . 3 .   Cla s s if ica t io n us i ng   NW - K NN   T h e  last   s tag e  is   d o cu m en t  class i f icatio n   u s i n g   Ne ig h b o r   W eig h ted   K - Nea r est  Ne ig h b o r   ( NW - KNN) .   E ac h   co m p lain t  w ill  b e  class i f ied   b ased   o n   th e  i n te n d ed   d ep ar tm e n t.  NW - KN N  is   a  m o d if icat io n   o f   KNN  alg o r it h m   to   s o lv e  th e  p r o b lem   o f   i m b ala n ce d   d ata.   T h e  i n itia l  s tag e  is   f i n d in g   k   n e ar est  n ei g h b o r s   b y   ca lcu lati n g   th e  d i s tan ce   o r   s i m ilar it y   b et w ee n   th e  te s ti n g   a n d   tr ain i n g   d ata.   C o s i n e  s i m il ar it y   is   u s ed   i n   t h i s   s tu d y   f o r   th o s e  tas k .   T h e  ap p licatio n   o f   NW - KNN  al g o r it h m   is   n o t  m u ch   d i f f er en t  f r o m   tr ad itio n al  K NN   a lg o r ith m .   T h e  o n l y   d if f er e n c e  b et w ee n   t h e  t w o   alg o r it h m s   lies   in   t h e  ca lcu latio n   clas s   weig h t.  I n   tr ad itio n al  KNN,   ea ch   c lass   h a s   t h e  s a m e   w ei g h t.  O n   t h e  o th er   h a n d ,   N W - KNN  g i v e  t h e  m in o r it y   cla s s   a  g r ea ter   w ei g h t,   w h ile  t h e  m aj o r it y   clas s   w ill b e  g iv e n   s m aller   w ei g h t.  T h e  w eig h t o f   ea ch   cla s s   i s   ca lcu la te d   as f o llo w s :                     (      (       ) (     {      (       )                       } ) )            W h er e                is   t h e  w ei g h t  o f   class     ,       (       )   is   t h e  n u m b er   o f   tr ain in g   d ata  i n   clas s     ,      {      (       )                       }   is   t h e  least  n u m b er   o f   d ata  tr ain i n g   i n   ea c h   cla s s ,   an d          is   a  co n s ta n t  m ag i c   n u m b er   th at  i ts   v a lu e  u s u all y   m o r e  t h a n   1 .   I n   th is   s tu d y ,   w e  u s e  2   as t h e         v al u e.     T h is   w ei g h t,  alo n g s id e  w it h   t h e  k   n ea r est  n eig h b o r s ,   w il l  b e  u s ed   to   ca lcu late  th e  s co r e  f o r   ea ch   class .   T h e  clas s   w i th   h i g h est  s co r e  w ill b e  t h e  c lass   o f   t h e  te s t d ata.   T h e  ca lcu la tio n   o f   t h e  s co r es o f   ea c h   cla s s   ca n   b e  ca lcu lated   as  f o llo w s :             (         )               ( ∑     (        )   (          )           (   ) )     w h er e        (         )   is   t h e  s co r e  o f   clas s       f o r   test i n g   d ata    ,               i s   th e  w ei g h t  o f   cla s s     ,            (   )   is   a  s e t  o f   tr ai n i n g   d ata  th at   l o ca ted   th e  k   n ea r est  n ei g h b o r   o f   th e   test   d ata    ,   an d       (        )   is   th e  s i m ilar it y   b et w ee n   tr ain i n g   d ata       an d   test in g   d ata    .   W e   em p lo y   co s i n e  s i m ilar it y   f o r   th is   m ea s u r e.   Me an w h ile,     (          )   is   th e  b in ar y   w ei g h t  th at  h as  v al u e  o f   1   if   tr ain i n g   d ata       is   b elo n g   to   class     .  Oth er w h is e,   its   w eig h t   w ill   b e  0 .   B y   u s i n g   t h is   f o r m u la,   N W - KNN  ca n   h a n d le  m aj o r ity   class   d o m in a n ce   in   i m b alan ce d   d ata  b ec au s e  it  g i v e  lo w er   w eig h t  f o r   m aj o r ity   cl ass   an d   h ig h er   clas s   f o r   th e  m i n o r it y   o n e.       Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   2 5 0 2 - 4752   I n d o n esia n   J   E lec  E n g   &   C o m p   Sci,   Vo l .  1 2 ,   No .   1 ,  Octo b er   201 8   :    1 5 5   –   160   158   3.   RE SU L T S AN D  AN AL Y SI S   T h e  d ata  u s ed   in   th is   s t u d y   is   tak en   f r o m   S A MB A T   On lin e.   T h e  tex t  o f   th e  co m p lai n t  is   t ak en   f r o m   3   d ep a r tm e n t s   in cl u d in g   Dep ar t m en t  o f   T r an s p o r tatio n   o r   Din as  P er h u b u n g an   ( DI SHU B ) ,   Dep a r tm e n t  o f   San itat io n   a n d   P ar k s   o r   Di n as  Keb er s ih a n   d an   P er ta m a n a n   ( DKP ) ,   an d   Dep ar t m en t   o f   P u b lic  W o r k s ,   Ho u s in g   an d   B u ild in g   Su p er v is io n   o r   Din as  P ek er j aa n   U m u m ,   P er u m a h a n   d an   P en g a w a s an   B a n g u n an   ( DP UP P B ) .   T o tal  d ata  u s ed   is   3 1 0   d iv id ed   in t o   2 3 7   tr ain in g   d ata  an d   7 3   test   d ata.   T h e  tr ain in g   d at a  co n s is t  o f   2 7   d ata  f o r m   DKP   class ,   4 9   d ata  f o r m   DP UP P B   class   an d   1 6 1   d a ta  f r o m   DI SHUB .   Me an w h i le ,   th e  test   d ata  u s ed   co n s is t o f   1 3   d ata  f r o m a  D KP   class ,   2 1   d ata  f r o m   DP UP PB   a n d   3 9   d ata  f r o m   DI SHUB   cla s s .   T h er e  ar e  th r ee   ex p er im e n t  s c en ar io s   p er f o r m ed   o n   t h is   s tu d y .   F ir s tl y ,   th e  e x p er i m e n t  i s   f o cu s ed   o n   th e  ef f ec t  o f   k   v al u es  o f   NW - KNN  a n d   f i n d i n g   t h e  m o s t  o p ti m al  v alu e  o f   k .   h e  f o llo w i n g   e x p er i m e n t  i s   i s   f o cu s ed   o n   th e  e f f ec t  o f   N - Gr a m   as  f ea t u r es  f o r   clas s f ic itio n   u s i n g   NW - KNN.   I n   th e  last   o n e,   w e  w ill   co m p ar e  th e  p er f o r m a n ce   o f   NW - KNN  an d   co n v en tio n al  KNN  m et h o d .   W e  u s e  p r ec is io n ,   r ec all,   an d   f - m ea s u r e  f o r   ev al u atio n   in   all  o f   th e s e  ex p er i m en ts .     3 . 1 .   K   Va lue V a ria t io n E x peri ment   I n   th is   e x p er i m e n t,  w e  p er f o r m ed   a  co m p ar is o n   o f   k   v al u es   v ar iatio n s   o f   1 ,   3 ,   5 ,   7   an d   1 5 .   Un ig r a m   ( B ag   o f   W o r d )   is   u s ed   f o r   th is   ex p er i m e n t.  T ab le   2   s h o w s   th e  r esu l t  o f   th is   e x p er i m e n t.  T h e  r esu lts   d ep icts   th at  g e n er all y   th e   p er f o r m a n c e  o f   t h is   clas s i f icatio n   s y s te m   is   d ec r ea s i n g   as   th e   v a lu e   o f   k   i s   g etti n g   h ig h er .   T h is   is   b ec au s e  t h e  h ig h er   t h e   v al u e  o f   k ,   t h e  h ig h er   t h e  p r o b ab ilit y   o f   n ei g h b o r s   t h at  h a v e  f u r th er   d is ta n ce s   ar e  also   co n s id er ab ly   ta k en   i n to   co n s id er atio n .   T h is   f ar   n eig h b o r s   ca n   b e  th e  ir r elev an t  f o r   ch o o s in g   th e  r i g h t   class .   T h e  v alu e  o f   k =3   h as  t h e  m o s t  o p ti m al  p er f o r m a n ce   with   7 7 . 8 5 %  p r ec is io n ,   7 4 . 1 8 % r ec all,   an d   7 5 . 2 5 %   f - m ea s u r e  v al u e.   Ho w e v er ,   th e  v alu e  o f   k =1   h a s   t h e  m o s t  in f er io r   p er f o r m a n ce   w it h   f - m ea s u r e  v al u e  o n l y   6 5 . 5 1 %  b ec au s e  it o n l y   co n s id er   o n e  n eig h b o r   th at  ca n   b e  v e r y   b ia s ed .       T ab le  2 .   K  Valu e  Var iatio n   E x p er im e n t  R es u lt.   K   V a l u e   P r e c i so n   R e c a l l   F - M e a su r e   1   6 9 . 6 0 %   6 3 . 5 1 %   6 5 . 5 1 %   3   7 7 . 8 5 %   7 4 . 1 8 %   7 5 . 2 5 %   5   7 5 . 1 3 %   6 8 . 3 1 %   7 0 . 6 0 %   7   7 6 . 5 1 %   6 8 . 3 1 %   7 0 . 9 5 %   15   7 4 . 0 2 %   6 4 . 5 0 %   6 7 . 0 2 %       3 . 2 .   N - G ra m   Va ria t io n  E x peri ment   I n   th is   e x p er i m e n t,  t h e  v ar iet y   o f   N - Gr a m   u s ed   w er e  u n i g r a m ,   b ig r a m   a n d   co m b i n atio n   o f   b o th   a s   f ea u r e s .   T h is   ex p er i m en t  is   co n d u ce ted   u s in g   k =3   as  T ab le  3   s h o w s   th e  r esu lt.  As  s ee n   o n   T ab le  3 ,   u n ig r a m   f ea t u r e  s h o w s   th e   b est  p er f o r m an ce   co m p ar ed   to   t h e  o t h er s   w it h   7 7 . 8 5 %  p r ec is io n ,   7 4 . 1 8 %  r ec all,   an d   7 5 . 2 5 %  f - m ea s u r e  v al u e.   Me an w h ile,   th e  w o r s t  p er f o r m a n ce   is   o b tain ed   w h e n   b ig r a m   i s   e m p lo y ed   w i th   f - m ea s u r e  v al u e  o n l y   4 8 . 5 1 %.  T h is   is   b ec au s e  m an y   o f   B ig r a m ' s   ter m s ,   w h ich   i s   a  co m b i n atio n   o f   t w o   w o r d s ,   r ar ely   ap p ea r   o n   m o r e   th a n   o n e  d o cu m e n t.  I t   is   o f te n   o n l y   o cc u r s   i n   th e   d o cu m en t   w h er e  t h e  ter m   i s   lo ca ted .   I t  is   v er y   d if f er en t  f r o m   u n ig r a m   f ea t u r e  th at  o n l y   co n s i s t  o n e  w o r d .   I t  m a k es  t h is   f e tau r e s   ca n   b e  o cc u r s   in   a  lo t o f   d o cu m e n ts .       T ab le  3 .   N - G r a m   Var iatio n   E x p er im e n t  R es u lt.   K   V a l u e   P r e c i so n   R e c a l l   F - M e a su r e   U n i g r a m   7 7 . 8 5 %   7 4 . 1 8 %   7 5 . 2 5 %   B i g r a m   5 5 . 8 5 %   4 6 . 4 4 %   4 8 . 5 1 %   C o mb i n a t i o n   o f   U n i g r a m  a n d   B i g r a m   7 0 . 5 1 %   6 9 . 5 7 %   6 9 . 5 7 %       3 . 3 .   NW - K NN  a nd   K NN  Co m pa riso n E x peri m ent   A   co m p ar i s o n   o f   KNN  a n d   NW - KNN  al g o r ith m   i s   p er f o r m ed   in   t h is   e x p er i m e n t.  T h e  u n i g r a m   f ea t u r e  is   u s ed   in   t h is   e x p er im en t  w it h   v ar iatio n s   o f   k   n ei g h b o r in g   v a lu e s   u s ed   in cl u d e  1 ,   3 ,   5 ,   7 ,   an d   1 5   as  F ig u r e  2   s h o w s   t h e  r es u lt.  T h e  r esu lt  d ep icts   t h at  g e n er al l y   NW - KNN  al g o r ith m   s h o w s   a  b etter   p er f o r m a n ce   th an   co n v e n tio n al   KNN   al g o r ith m s   a s   th e   k   v a lu e   g e tti n g   b ig g er .   T h is   i s   b ec a u s e   th e   d is tr ib u tio n   o f   th e   a m o u n t  o f   tr ai n in g   d ata  in   e ac h   class   is   im b ala n ce d .   As  th e  n ei g h b o r in g   v al u e   of   k   g r o w s   b ig g er ,   KNN  alg o r ith m te n d   to   co n s id er   f ar   n eig h b o r s   th at  o f te n   b elo n g   to   th e  class   th at  h as  th e  h ig h e s t  a m o u n t  o f   tr ain i n g   d ata.   A s   th e  r esu lt,  b y   u s i n g   KNN,   w il l  b e  a  lo t   o f   test in g   d ata  th at  class i f ied   in to   m aj o r it y   class   e v en   t h o u g h   it  s h o u ld   n o t.  Me an w h i le,   th is   p r o b l em   ca n   b e  av o id ed   b y   NW - KNN  al g o r it h m   b ec au s e  it  g i v es  lo w er   Evaluation Warning : The document was created with Spire.PDF for Python.
I n d o n esia n   J   E lec  E n g   &   C o m p   Sci     I SS N:  2502 - 4752       N eig h b o r   W eig h ted   K - N ea r e s t   N eig h b o r   fo r   S a mb a t O n lin e  C la s s i fica tio n   ( M.  A li F a u z i )   159   w ei g h ts   f o r   m aj o r ity   c lass   an d   h i g h er   w eig h t  f o r   t h e  m i n o r ity   o n e.   T h e  b est   p er f o r m a n ce   i s   s h o w ed   b y   NW - KNN  w h e n   u s in g   k   v al u e  o f   2   w it h   7 5 . 2 5 %  f - m ea s u r e  v al u e ,   w h ile  KNN  also   s h o w s   it s   b est  p er f o r m an ce   at   th e  s a m e  k   v al u e  w it h   s li g h t d if f er en ce   v a lu e  o f   f - m ea u s r e  o f   7 5 . 2 1 %.           Fig u r e  2 .   KNN  an d   NW - KNN   C o m p ar is o n   R es u lt       4.   CO NCLU SI O N   I n   t h is   w o r k ,   Nei g h b o r   W eig h ted   K - Nea r es t  Nei g h b o r   ( NW - KNN)   w as   u s ed   f o r   i m b ala n ce d   Sa m b at   On li n e  clas s i f icatio n .   T h e  s y s te m   d ev elo p ed   is   co m p o s ed   o f   t h r ee   m aj o r   p h ases   i n cl u d in g   p r ep r o ce s s in g ,   N - Gr a m   f ea t u r e  ex tr ac tio n ,   a n d   class i f icat io n   u s i n g   NW - KN N.   B ased   o n   t h e  e x p er i m e n t   r esu lt s ,   it  ca n   b e   r esu m ed   th a t  t h e  NW - KNN  a lg o r ith m   i s   ab le  to   cla s s i f y   t h e  i m b ala n ce d   d ata  w ell  w it h   t h e  m o s t  o p ti m al  k - n eig h b o r   v al u e  is   3   an d   u n i g r a m   as  t h e  b est  f ea t u r es  b y   7 7 . 8 5 %  p r ec is io n ,   7 4 . 1 8 %  r ec all,   an d   7 5 . 2 5 %  f - m ea s u r e  v al u e.   T h is   s t u d y   s h o w   t h at  g r ea ter   v al u e  o f   k   d ec r ea s e  th e  f - m ea s u r e  v al u e  o f   cl ass i f icatio n   s y s te m .   T h is   s tu d y   al s o   d ep ict  th at  th e  b ig r a m   a n d   co m b i n atio n   o f   b o th   u n i g r a m   a n d   b ig r a m   f ail  to   i m p r o v e  th e   s y s te m   p er f o r m a n ce .   C o m p ar ed   to   th e  co n v e n tio n al   KNN ,   NW - KNN  a lg o r it h m   p r o v ed   to   b e  b etter   f o r   i m b alan ce d   d ata  p r o b lem s   as   th e  v al u e  o f   k   n eig h b o r s   g e ttin g   g r ea ter   b ec au s e  it  g iv e s   lo w er   w ei g h t s   f o r   m aj o r ity   clas s   a n d   h ig h er   w e ig h t  f o r   th e   m in o r it y   o n e.   S o m e   f u t u r e  w o r k s   th at   ca n   b e  co n d u cted   i s   t h e   d etec tio n   o f   ab b r ev iated   w o r d s   an d   s la n g   w o r d s   b ec au s e   m a n y   co m p lai n ts   i n   Sa m b at  O n li n e  ar e  w r itte n   u s in g   th at  k in d   o f   w o r d s .       RE F E R E NC E S   [1 ]     A n a n d it a   N.  “ El e m e n   S u k se s  E  –   G o v e rn m e n t:   S tu d i  Ka su s  L a y a n a n   A sp iras i  Da n   P e n g a d u a n   On li n e   Ra k y a t   (L a p o r! )  Ko ta Ba n d u n g ” .   Un iv e rsitas   Ka to li k   P a ra h y a n g a n ,   Ba n d u n g .   2 0 1 6 .   [2 ]     F a u z i  M A ,   A ri f in   A Z,   G o sa ria  S C.   “ In d o n e sia n   Ne w s  Clas sif i c a ti o n   Us in g   Na ïv e   Ba y e s  a n d   Tw o - P h a se   F e a tu re   S e lec ti o n   M o d e l.   In d o n e sia n ”.   J o u rn a l  o f  El e c trica l  E n g i n e e rin g   a n d   Co mp u ter   S c ien c e   ( IJ EE CS ) .   2 0 1 7   De c   1 ;8 ( 3 ):6 1 0 - 5.   [3 ]     A n ti n a sa ri  P ,   P e r d a n a   RS ,   F a u z i  M A .   “ A n a li sis  S e n ti m e n   Ten tan g   Op in i  F il m   P a d a   D o k u m e n   Tw it ter  Be rb a h a sa   In d o n e sia   M e n g g u n a k a n   Na iv e   Ba y e s  De n g a n   P e rb a ik a n   Ka ta  T id a k   Ba k u ” .  J u rn a l  Pe n g e mb a n g a n   T e k n o l o g i   In fo rm a si   d a n   Ilm u   K o mp u ter .   2 0 1 7 ;  1 (1 2 ): 1 7 3 3 - 41.   [4 ]     G u n a w a n   F ,   F a u z i  M A ,   A d ik a r a   P P .   “ A n a li sis  S e n ti m e n   P a d a   Ula sa n   A p li k a si  M o b il e   M e n g g u n a k a n   Na iv e   B a y e s  Da n   No rm a li sa si  Ka t a   Be rb a sis   Lev e n sh tein   Dista n c e   (S tu d i  Ka su s  A p li k a si  BC A   M o b il e ) ” .  S y ste mic :  In fo rm a ti o n   S y ste m a n d   In f o rm a ti c s Jo u rn a l .   2 0 1 7   De s 3 1 ;  3 (2 ): 1 - 6.   [5 ]     F a u z i  M A ,   Af iri a n to   T .   “ I m p ro v in g   S e n ti m e n t  A n a l y sis  o f   S h o rt  In f o rm a l  In d o n e sia n   P r o d u c t  Re v ie w s  u sin g   S y n o n y m   Ba se d   F e a tu re   Ex p a n s io n ” .  T E L KOM NIKA  ( T e lec o mm u n ica ti o n   Co mp u ti n g   El e c tro n ics   a n d   C o n tr o l) .  2 0 1 8   J u n   1 ;1 6 (3 ) .   [6 ]     F a n issa   S ,   F a u z i  M A ,   A d in u g ro h o   S .   “ A n a li sis  S e n ti m e n   P a riw is a ta  d i  Ko ta  M a lan g   M e n g g u n a k a n   M e to d e   Na iv e   Ba y e s  d a n   S e le k si  F it u r  Qu e ry   Ex p a n sio n   Ra n k in g ” .  J u rn a l  Pen g e mb a n g a n   T e k n o l o g i  I n fo r ma si  d a n   Ilmu   Ko mp u ter . 2 0 1 8 ;   2 ( 8 ):2 7 6 6 - 7 0 .   [7 ]     Ro f iq o h   U,  P e r d a n a   RS ,   F a u z i  M A .   “ A n a li sis  S e n ti m e n   T in g k a t  K e p u a sa n   P e n g g u n a   P e n y e d ia  L a y a n a n   T e le k o m u n ik a si  S e lu ler  I n d o n e si a   P a d a   T w it ter  De n g a n   M e to d e   S u p p o rt  V e c to r  M a c h in e   d a n   L e x ico n   Ba se d   F e a tu re s ” .  J u rn a l   Pen g e mb a n g a n   T e k n o l o g i   In f o rm a si  d a n   Ilmu   Ko mp u ter .   2 0 1 7 ;  1 (1 2 ): 1 7 2 5 - 32.   [8 ]     Jo a c h im s  T .   “ T e x t  c a te g o riza ti o n   w it h   su p p o rt  v e c to r  m a c h in e s:  L e a rn in g   w it h   m a n y   re l e v a n t   f e a tu re s ” .  In   Eu ro p e a n   c o n fer e n c e   o n   ma c h in e   lea rn i n g   1 9 9 8   A p r  2 1   ( p p .   1 3 7 - 1 4 2 ).   S p ri n g e r,   Be rli n ,   He id e lb e rg .   1 2 3 4 5 KNN 6 5 . 5 1 7 5 . 2 1 7 0 . 8 3 6 2 . 5 1 6 2 . 1 5 N W - K N N 6 5 . 5 1 7 5 . 2 5 7 0 . 6 7 0 . 9 5 6 7 . 0 2 0 20 40 60 80 F - M e a su r e   K N e a r e st   N e i g h b o r s   K NN  v s  NW - K NN   Com p ar is on   KNN N W - K N N Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   2 5 0 2 - 4752   I n d o n esia n   J   E lec  E n g   &   C o m p   Sci,   Vo l .  1 2 ,   No .   1 ,  Octo b er   201 8   :    1 5 5   –   160   160   [9 ]     Nu rjan a h   W E,   P e rd a n a   RS ,   F a u z i  M A .   “ A n a li sis   S e n ti m e n   Terh a d a p   T a y a n g a n   T e le v isi  Be r d a sa rk a n   Op in i  M a s y a ra k a t  p a d a   M e d ia  S o sia l   Tw it ter  m e n g g u n a k a n   M e to d e   K - Ne a re st  Ne ig h b o r  d a n   P e m b o b o tan   Ju m lah   Re twe e t ” .  J u rn a l  Pen g e mb a n g a n   T e k n o lo g i  I n fo rm a si d a n   Ilmu   K o mp u ter .   2 0 1 7 ;  1   ( 1 2 ),   1 7 5 0 - 5 7 .   [1 0 ]     S u h a r n o   CF ,   F a u z i  M A ,   P e rd a n a   RS .   “ Kla si f i k a si  T e k s   Ba h a sa   In d o n e sia   P a d a   Do k u m e n   P e n g a d u a n   S a m b a t  On li n e   M e n g g u n a k a n   M e to d e   K - Ne a re st  Ne ig h b o rs  d a n   Ch i - S q u a re ” .  S y ste mic :  In fo rm a ti o n   S y ste m  a n d   In fo rm a t ics   J o u rn a l .   2 0 1 7   De c   7 ; 3 (1 ): 2 5 - 32.   [1 1 ]     M e n tari  ND ,   F a u z i  M A ,   M u f li k h a h   L .   “ A n a li sis  S e n ti m e n   Ku rik u lu m   2 0 1 3   P a d a   S o sia l  M e d ia  Tw it ter   M e n g g u n a k a n   M e to d e   K - Ne a re st  Ne i g h b o r  d a n   F e a t u re   S e lec ti o n   Q u e ry   Ex p a n sio n   Ra n k in g ” .  J u rn a l   Pen g e mb a n g a n   T e k n o lo g i  In fo rm a si d a n   I lmu   K o mp u ter .   2 0 1 8 ;  2   ( 8 ):2 7 3 9 - 4 3 .   [1 2 ]     Clau d y   YI,   P e rd a n a   RS ,   F a u z i  M A .   “ Kla si f ik a si  Do k u m e n   Tw it ter  Un tu k   M e n g e tah u i  Ka ra k ter  Ca lo n   Ka r y a w a n   M e n g g u n a k a n   A lg o rit m e   K - Ne a re st  Ne ig h b o r  (KN N) ” .  J u rn a l  Pen g e mb a n g a n   T e k n o lo g i  I n fo r ma si  d a n   I lm u   Ko mp u ter .   2 0 1 8 ;  2 ( 8 ): 2 7 6 1 - 65.   [1 3 ]     M u n ir   M M ,   F a u z i  M A ,   P e rd a n a   RS .   “ Im p le m e n tas i  M e to d e   Ba c k p ro p a g a ti o n   Ne u ra l  Ne tw o rk   b e rb a sis  L e x ico n   Ba se d   F e a tu re s  d a n   Ba g   o f   W o rd s  Un t u k   Id e n ti f i k a si  Uja ra n   Ke b e n c ian   P a d a   T w it ter ” .  J u rn a l  P e n g e mb a n g a n   T e k n o lo g i  I n fo rm a si d a n   Ilmu   K o mp u ter   e - IS S N.  2 0 1 7 ;2 5 4 8 :9 6 4 X .   [1 4 ]     L a m   S L ,   Lee   D L .   “ F e a tu re   re d u c ti o n   f o r  n e u ra l  n e tw o rk   b a se d   tex t  c a teg o riza ti o n ” .  In Da t a b a se   S y ste ms   fo r  Ad v a n c e d   Ap p li c a t io n s,  1 9 9 9 .   Pro c e e d in g s. ,   6 t h   I n ter n a ti o n a l   Co n fer e n c e   o n   1 9 9 9   ( p p .   1 9 5 - 2 0 2 ).   IE EE .   [1 5 ]     S u n   Y,  W o n g   A K,  K a m e l   M S .   “ Clas si f ica ti o n   o f   i m b a lan c e d   d a ta:  A  re v ie w ” .  In ter n a ti o n a l  J o u rn a l  o f  P a tt e r n   Rec o g n it io n   a n d   Arti fi c i a l  In telli g e n c e .   2 0 0 9   J u n ; 2 3 ( 0 4 ) :6 8 7 - 7 1 9 .   [1 6 ]     F ra n k   E,   Bo u c k a e rt  RR.   “ Na i v e   b a y e s  f o r  te x t  c l a ss i f ica ti o n   w it h   u n b a la n c e d   c las se s ” .  In Eu ro p e a n   Co n fer e n c e   o n   Prin c ip les   o f  Da t a   M in i n g   a n d   K n o wled g e   Disc o v e ry   2 0 0 6   S e p   1 8   (p p .   5 0 3 - 5 1 0 ).   S p ri n g e r,   Be rli n ,   He id e lb e rg .   [1 7 ]     L iu   Y,  L o h   HT ,   S u n   A .   “ I m b a lan c e d   tex t  c las sif ic a ti o n :  A   term   w e i g h ti n g   a p p r o a c h ” .  Exp e r t  sy ste ms   wit h   Ap p li c a ti o n s .   2 0 0 9   Ja n   1 ; 3 6 (1 ): 6 9 0 - 7 0 1 .   [1 8 ]     Ch a w la  NV ,   Ja p k o w icz   N,  Ko t c z   A .   “ S p e c ial  issu e   o n   lea rn i n g   f ro m   i m b a lan c e d   d a ta  se ts ” .  ACM   S i g k d d   Exp lo ra ti o n s Ne wsle tt e r .   2 0 0 4   Ju n   1 ; 6 (1 ) :1 - 6.   [1 9 ]     T a n   S .   “ Ne ig h b o r - w e ig h ted   k - n e a re st  n e ig h b o r  f o r  u n b a la n c e d   te x t  c o rp u s ” .  Exp e rt  S y ste ms   wit h   Ap p li c a ti o n s .  2 0 0 5   M a y   1 ;2 8 (4 ): 6 6 7 - 7 1 .   [2 0 ]     Ro si  F ,   F a u z i  M A ,   P e rd a n a   RS .   “ P re d ik si  Ra ti n g   P a d a   Re v ie w   P ro d u k   Ke c a n ti k a n   M e n g g u n a k a n   M e to d e   Na ïv e   Ba y e s   d a n   Ca teg o rica l   P ro p o r t i o n a l  Diff e re n c e   (CP D) ” .  J u rn a l   Pen g e mb a n g a n   T e k n o l o g i  In fo r ma si  d a n   Ilm u   Ko mp u ter .   2 0 1 8 ;  2 ( 5 ): 1 9 9 1 - 97.   [2 1 ]     L e sta ri  A R,   P e rd a n a   RS ,   F a u z i  M A .   “ A n a li sis  S e n ti m e n   T e n tan g   Op in i   P il k a d a   Dk i  2 0 1 7   P a d a   D o k u m e n   Tw it ter  Be rb a h a sa   In d o n e sia   M e n g g u n a k a n   Nä iv e   Ba y e s  d a n   P e m b o b o tan   Em o ji ” .  J u rn a l  Pen g e mb a n g a n   T e k n o lo g i   In fo rm a si   d a n   Ilm u   K o mp u ter .   2 0 1 7 ;  1 (1 2 ): 1 7 1 8 - 24.   [2 2 ]     F a u z i  M A ,   A ri f in   A ,   Yu n iarti  A .   “ T e r m   Weig h ti n g   Be rb a sis  In d e k s  Bu k u   d a n   Ke las   u n tu k   P e ra n g k in g a n   Do k u m e n   Be rb a h a sa   A r a b ” .  L o n ta r K o mp u t e r: Ju rn a l  Ilmi a h   T e k n o l o g i  In fo r ma si .   2 0 1 3 .   [2 3 ]     T a la F Z.   “ A   stu d y   o f   ste m m in g   e ff e c ts  o n   in f o rm a ti o n   re tri e v a l  in   Ba h a sa   In d o n e sia ” .  In stit u te f o r L o g ic,  L a n g u a g e   a n d   Co m p u t a ti o n ,   Un ive rs it e it   v a n   Amste rd a m ,   T h e   Ne th e rlan d s.  2 0 0 3   Ju l.   [2 4 ]     P ra m u k a n to ro   ES ,   F a u z i  M A .   “ C o m p a ra ti v e   a n a l y sis   o f  strin g   si m il a rit y   a n d   c o rp u s - b a se d   sim il a rit y   f o r  a u to m a ti c   e ss a y   sc o rin g   s y ste m   o n   e - lea r n in g   g a m i f ica ti o n ” .  In Ad v a n c e d   Co mp u ter   S c ien c e   a n d   In fo rm a ti o n   S y ste ms   ( ICACS IS ),   2 0 1 6   In ter n a ti o n a l  C o n fer e n c e   o n   2 0 1 6   Oc t  1 5   ( p p .   1 4 9 - 1 5 5 ).   IEE E.   [2 5 ]     F a u z i  M A ,   Yu n iarti  A .   “ En se m b le  M e th o d   f o r  In d o n e sia n   T w it ter  Ha te  S p e e c h   De tec ti o n ” .  In d o n e sia n   J o u rn a l  o f   El e c trica l  En g in e e rin g   a n d   Co m p u ter   S c ien c e   ( IJ EE CS ) .   2 0 1 8   Ju l   1 ;1 1 (1 ).   [2 6 ]     F a u z i  M A ,   Uto m o   DC,  S e ti a wa n   BD,  P ra m u k a n to ro   ES .   “ A u to m a ti c   Essa y   S c o rin g   S y ste m   Us i n g   N - G r a m   a n d   Co sin e   S im il a rit y   f o r  G a m i f i c a ti o n   Ba se d   E - L e a rn in g ” .  In Pr o c e e d in g s  o f  t h e   In ter n a ti o n a l  Co n fer e n c e   o n   Ad v a n c e s i n   Ima g e   Pro c e ss in g   2 0 1 7   A u g   2 5   (p p .   1 5 1 - 1 5 5 ).   A CM .   [2 7 ]     F a u z i  M A ,   A ri f in   A Z,   Yu n iarti  A .   “ Ara b ic  Bo o k   Re tri e v a l  u sin g   Clas s  a n d   Bo o k   In d e x   Ba se d   T e rm   Weig h ti n g ” .  In ter n a t io n a l  J o u rn a l  o f  E lec trica l  a n d   C o mp u ter   En g in e e rin g   ( IJ ECE ) .   2 0 1 7   De c   1 ; 7 (6 ): 3 7 0 5 - 1 0 .   Evaluation Warning : The document was created with Spire.PDF for Python.