Skip to content

Commit

Permalink
First commit of active learning
Browse files Browse the repository at this point in the history
  • Loading branch information
ianran committed Dec 13, 2023
1 parent 7d13861 commit 9b19011
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
25 changes: 25 additions & 0 deletions src/lop/active_learning/ActiveLearner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 202 Ian Rankin
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this
# software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
# to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or
# substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
# FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.

# ActiveLearner.py
# Written Ian Rankin - February 2022
#
# Active learning selection algorithms for Pairwise GP's

import numpy as np
from copy import copy
2 changes: 2 additions & 0 deletions src/lop/active_learning/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# init the active_learning subfolder

4 changes: 2 additions & 2 deletions src/lop/models/Model.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def select_best(self, candidate_pts):


## select
# This function calls the active learner and specifies the
# This function calls the active learner and specifies the number of alternatives to select
def select(self, candidate_pts, num_alts, prefer_num=-1):
return self.active_learner.select(candidate_pts, num_alts, prefer_num)

Expand All @@ -92,7 +92,7 @@ class SimplelestModel(Model):
def predict(self, X):
return X, None

def clear(self):
def reset(self):
pass


Expand Down

0 comments on commit 9b19011

Please sign in to comment.