def test_attributes_tsbf(X, y, params):
    """Test the attributes of a fitted instance of TSBF."""
    n_samples = X.shape[0]
    n_classes = np.unique(y).size
    n_estimators = params.get('n_estimators',
                              TSBF().get_params()['n_estimators'])
    bins = params.get('bins', TSBF().get_params()['bins'])
    n_bins = bins if isinstance(bins, (int, np.integer)) else len(bins) - 1
    n_features = (n_bins + 1) * n_classes
    clf = TSBF(**params)

    # Training phase
    clf.fit(X, y)
    assert isinstance(clf.estimator_, DecisionTreeClassifier)
    np.testing.assert_array_equal(clf.classes_, np.unique(y))
    assert len(clf.estimators_) == n_estimators
    assert clf.feature_importances_.shape == (n_features,)
    assert clf.interval_indices_.ndim == 2
    assert isinstance(clf.min_subsequence_size_, (int, np.integer))
    assert clf.n_features_in_ == n_features
    if params.get('oob_score', TSBF().get_params()['oob_score']):
        assert clf.oob_decision_function_.shape == (n_samples, n_classes)
        assert isinstance(clf.oob_score_, (float, np.floating))
    else:
        assert clf.oob_decision_function_ is None
        assert clf.oob_score_ is None
Test the attributes of a fitted instance of TSBF.
pyts/classification/tests/test_tsbf.py