[11206] 2017-04-05_学点算法搞安全之SVM

文档创建者:s7ckTeam
浏览次数:4
最后更新:2025-01-18
2017-04-05_学点算法搞安全之SVM S V M   F r e e B u f   2 0 1 7 - 0 4 - 0 5 * F r e e b u f   V S   W A F I P S 0 d a y N d a y S c i k i t - l e a r n S c i k i t - l e a r n 线 p y t h o n P y t h o n   ( > =   2 . 6   o r   > =   3 . 3 ) , N u m P y   ( > =   1 . 6 . 1 ) , S c i P y   ( > =   0 . 9 ) . p i p   i n s t a l l   s c i k i t - l e a r n S V M S V M 使 广 S V M H M M
线 线 l i n e a r   s e p a r a b l e 线 l i n e a r   i n s e p a r a b l e 线 线 S u p p r o t   V e r c t o r 线 s u p e r v i s e d   l e a r n i n g u n s u p e r v i s e d   l e a r n i n g S V M
[ [ 0 ,   0   ] ,   [ 1 ,   1 ] ]   [ 0 ,   1 ]   [ 2 . ,   2 . ] f r o m   s k l e a r n   i m p o r t   s v m X   =   [ [ 0 , 0 ] ,   [ 1 , 1 ] ] y   =   [ 0 , 1 ] c l f   =   s v m . S V C ( ) c l f . f i t ( X ,   y ) p r i n t   c l f . p r e d i c t ( [ [ 2 . , 2 . ] ] ) a r r a y ( [ 1 ] ) X S S S V M   &   w e b 访 X S S w e b W A V S E P 使 W V S X S S X S S w e b &
X S S w e b        
使 m i n _ m a x _ s c a l e r   =   p r e p r o c e s s i n g . M i n M a x S c a l e r ( ) x _ m i n _ m a x = m i n _ m a x _ s c a l e r . f i t _ t r a n s f o r m ( x ) X S S 使 c r o s s _ v a l i d a t i o n . t r a i n _ t e s t _ s p l i t 使 4 0 % 6 0 % x _ t r a i n ,   x _ t e s t ,   y _ t r a i n ,   y _ t e s t   =   c r o s s _ v a l i d a t i o n . t r a i n _ t e s t _ s p l i t ( x , y ,   t e s t _ s i z e = 0 . 4 ,   r a n d o m _ s t a t e = 0 ) 使 s c i k i t - l e a r n S V M S V M S V C 使 l i n e a r c l f   =   s v m . S V C ( k e r n e l = ' l i n e a r '   ,   C = 1 ) . f i t ( x ,   y ) j o b l i b . d u m p ( c l f , " x s s - s v m - 2 0 0 0 0 0 - m o d u l e . m " ) c l f = j o b l i b . l o a d ( " x s s - s v m - 2 0 0 0 0 0 - m o d u l e . m " ) y _ t e s t = [ ] y _ t e s t = c l f . p r e d i c t ( x ) p r i n t   m e t r i c s . a c c u r a c y _ s c o r e ( y _ t e s t ,   y ) 2 0 0 0 0 0 5 0 0 0 0
8 0 % C D N & W A F 9 0 % S V M X S S X S S X S S S Q L
, ? 使 ; 使 * F r e e b u f
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则