MCPcopy Create free account
hub / github.com/modAL-python/modAL / alp_uncertainty

Function alp_uncertainty

examples/runtime_comparison.py:163–173  ·  view source on GitHub ↗
(X, y, n_queries)

Source from the content-addressed store, hash-verified

161
162@timeit()
163def alp_uncertainty(X, y, n_queries):
164 X_labeled, y_labeled = X[[0, 50, 100]], y[[0, 50, 100]]
165 estimator = LogisticRegression(solver='liblinear', n_jobs=1, multi_class='ovr')
166 estimator.fit(X_labeled, y_labeled)
167 learner = ActiveLearnerALP(strategy='least_confident')
168
169 for _ in range(n_queries):
170 query_idx = learner.rank(estimator, X, num_queries=1)
171 X_labeled = np.concatenate((X_labeled, X[query_idx]), axis=0)
172 y_labeled = np.concatenate((y_labeled, y[query_idx]), axis=0)
173 estimator.fit(X_labeled, y_labeled)
174
175
176@timeit()

Callers 1

comparisonsFunction · 0.85

Calls 1

fitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…