def test_loss(params, loss_desired):
    """Test that the actual loss is equal to the expected loss."""
    loss_actual = _loss(X_bin, y_bin, n_classes, shapelets=shapelets,
                        lengths=lengths, alpha=-100, intercept_scaling=1,
                        **params)
    np.testing.assert_allclose(loss_actual, loss_desired, atol=1e-5, rtol=0.)
Test that the actual loss is equal to the expected loss.
pyts/classification/tests/test_learning_shapelets.py