Skip to content

Instantly share code, notes, and snippets.

@kudkudak
Created September 16, 2015 21:25
Show Gist options
  • Select an option

  • Save kudkudak/b676d68b2dd60df01d57 to your computer and use it in GitHub Desktop.

Select an option

Save kudkudak/b676d68b2dd60df01d57 to your computer and use it in GitHub Desktop.
# Ensure somehow we have some samples known
def fit(X, y):
while True:
indices = self._query_labels(X, y)
if not oracle(indices, y):
# No budget
break
# Refit model
self.model = GridSearch(...)
# get_known is helper function to select view of known rows of np matrix
self.model.fit(get_known(X), get_known(y))
# Report metrics
def _query_labels(self, X, y):
return self._strategy(X, y, self._estimator, self._batch_size)
# Sample oracle: just reveal labels until not gone
# Sample strategy: top k by uncertainty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment