Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于支持向量机选择变量的问题 #6

Open
flag2freefish opened this issue Jul 19, 2018 · 1 comment
Open

关于支持向量机选择变量的问题 #6

flag2freefish opened this issue Jul 19, 2018 · 1 comment

Comments

@flag2freefish
Copy link

def _select_two_parameters(self):
    '''
    按照书上7.4.2选择两个变量
    '''
    
    index_list = [i for i in xrange(self.N)]

    i1_list_1 = filter(lambda i: self.alpha[i] > 0 and self.alpha[i] < self.C, index_list)
    i1_list_2 = list(set(index_list) - set(i1_list_1))

    i1_list = i1_list_1
    i1_list.extend(i1_list_2)

    这部分输出结果i1_list是选择的所有index,没有进行筛选;这部分代码的意义是啥?
    而且分出来的i1_list_1中包含的index也是0-N-1,没看懂,求解
@a411919924
Copy link

路过,刚刚看到你的提问,不知道是否解决了
作者是先把索引集合分成两部分,最后把满足范围(0, C)的索引放到前面,不满足的放到后面。
SMO中也是先遍历该范围中,没有找到合适的再遍历全部。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants