Created
September 16, 2015 21:25
-
-
Save kudkudak/b676d68b2dd60df01d57 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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