def test_passes(self, data): n_passes = 2 model = VW(loss_function="logistic", passes=n_passes) assert getattr(model, "passes") == n_passes model.fit(data.x, data.y) weights = model.get_coefs() model = VW(loss_function="logistic") # first pass weights should not be the same model.fit(data.x, data.y) assert not np.allclose(weights.data, model.get_coefs().data)
def test_get_coefs(self, data): model = VW() model.fit(data.x, data.y) weights = model.get_coefs() assert np.allclose(weights.indices, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 116060])