Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add update_task to proglearn for data streaming #501

Open
KevinWang905 opened this issue Oct 15, 2021 · 2 comments
Open

Add update_task to proglearn for data streaming #501

KevinWang905 opened this issue Oct 15, 2021 · 2 comments
Assignees
Labels
ndd Neuro Data Design

Comments

@KevinWang905
Copy link

KevinWang905 commented Oct 15, 2021

Part of #34: Add a function that updates previous tasks based on new data with task labels

@PSSF23 PSSF23 added the ndd Neuro Data Design label Oct 18, 2021
@nhahn7
Copy link

nhahn7 commented Jan 25, 2022

@PSSF23 Can you assign me to this issue? Thanks

@PSSF23
Copy link
Member

PSSF23 commented May 18, 2022

@nhahn7 I also save the test here in case the test file is changed in the future.

def test_update_task(self):
   np.random.seed(1)

   l2f = LifelongClassificationForest()

   X = np.concatenate((np.zeros(100), np.ones(100))).reshape(-1, 1)
   y = np.concatenate((np.zeros(100), np.ones(100)))

   l2f.add_task(X, y)
   u1 = l2f.predict_proba(np.array([0]).reshape(1, -1), task_id=0)
   u2 = l2f.predict_proba(np.array([1]).reshape(1, -1), task_id=0)

   X2 = np.concatenate((np.zeros(100), np.ones(100))).reshape(-1, 1)
   y2 = np.concatenate((np.zeros(100), np.ones(100)))

   X3 = np.concatenate((X, X2))
   y3 = np.concatenate((y, y2))

   l2f.update_task(X2, y2, task_id=0)

  assert np.array_equiv(l2f.task_id_to_X[0], X3)
   assert np.array_equiv(l2f.task_id_to_y[0], y3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ndd Neuro Data Design
Projects
None yet
Development

No branches or pull requests

3 participants