Skip to content

Commit

Permalink
new file: tests/test_dsm.py
Browse files Browse the repository at this point in the history
  • Loading branch information
chiragnagpal committed Oct 27, 2020
1 parent 9fdbbf0 commit d167b48
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/test_dsm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import unittest

from dsm import DeepSurvivalMachines
from dsm import datasets

import numpy as np

class TestDSM(unittest.TestCase):

def test_dsm(self):

x, t, e = datasets.load_dataset('SUPPORT')

self.assertIsInstance(x, np.ndarray)
self.assertIsInstance(t, np.ndarray)
self.assertIsInstance(e, np.ndarray)

self.assertEqual(x.shape, (9105, 44))
self.assertEqual(t.shape, (9105,))
self.assertEqual(e.shape, (9105,))

model = DeepSurvivalMachines()
self.assertIsInstance(model, dsm.dsm_api.DeepSurvivalMachines)
model.fit(x, t, e, iters=10)
self.assertIsInstance(model.torch_model,
dsm.dsm_torch.DeepSurvivalMachinesTorch)

0 comments on commit d167b48

Please sign in to comment.