MCPcopy Index your code
hub / github.com/apachecn/ailearning / selectJrand

Function selectJrand

src/python/6.SVM/svm-complete.py:112–124  ·  view source on GitHub ↗

随机选择一个整数 Args: i 第一个alpha的下标 m 所有alpha的数目 Returns: j 返回一个不为i的随机数,在0~m之间的整数值

(i, m)

Source from the content-addressed store, hash-verified

110
111
112def selectJrand(i, m):
113 """
114 随机选择一个整数
115 Args:
116 i 第一个alpha的下标
117 m 所有alpha的数目
118 Returns:
119 j 返回一个不为i的随机数,在0~m之间的整数值
120 """
121 j = i
122 while j == i:
123 j = int(random.uniform(0, m))
124 return j
125
126
127def selectJ(i, oS, Ei): # this is the second choice -heurstic, and calcs Ej

Callers 1

selectJFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected