我有一个使用javax注释的jax-rs项目(ValueError Traceback (most recent call last)
<ipython-input-24-d9885fbe19e4> in <module>()
3
4 clf = GaussianNB()
----> 5 clf.fit(X, Y)
6
7
/home/fatima/anaconda2/lib/python2.7/site-packages/sklearn/naive_bayes.pyc in fit(self, X, y, sample_weight)
180 Returns self.
181 """
--> 182 X, y = check_X_y(X, y)
183 return self._partial_fit(X, y, np.unique(y), _refit=True,
184 sample_weight=sample_weight)
/home/fatima/anaconda2/lib/python2.7/site-packages/sklearn/utils/validation.pyc in check_X_y(X, y, accept_sparse, dtype, order, copy, force_all_finite, ensure_2d, allow_nd, multi_output, ensure_min_samples, ensure_min_features, y_numeric, warn_on_dtype, estimator)
524 dtype=None)
525 else:
--> 526 y = column_or_1d(y, warn=True)
527 _assert_all_finite(y)
528 if y_numeric and y.dtype.kind == 'O':
/home/fatima/anaconda2/lib/python2.7/site-packages/sklearn/utils/validation.pyc in column_or_1d(y, warn)
560 return np.ravel(y)
561
--> 562 raise ValueError("bad input shape {0}".format(shape))
563
564
ValueError: bad input shape (25000, 0)
)。我想添加单元测试来验证这些注释,但遗憾的是不能像this回答中所建议的那样使用hibernate-validator(公司maven repo没有它)。有没有其他方法可以使用单元测试来验证注释?