本文簡要介紹python語言中 sklearn.exceptions.NotFittedError
的用法。
用法:
class sklearn.exceptions.NotFittedError
如果在擬合之前使用估計器,則會引發異常類。
此類繼承自 ValueError 和 AttributeError,以幫助進行異常處理和向後兼容性。
- args:
屬性:
例子:
>>> from sklearn.svm import LinearSVC >>> from sklearn.exceptions import NotFittedError >>> try: ... LinearSVC().predict([[1, 2], [2, 3], [3, 4]]) ... except NotFittedError as e: ... print(repr(e)) NotFittedError("This LinearSVC instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator."...)
相關用法
- Python sklearn Normalizer用法及代碼示例
- Python sklearn NeighborhoodComponentsAnalysis用法及代碼示例
- Python sklearn NearestNeighbors用法及代碼示例
- Python sklearn NMF用法及代碼示例
- Python sklearn Nystroem用法及代碼示例
- Python sklearn NearestCentroid用法及代碼示例
- Python sklearn NearestNeighbors.radius_neighbors用法及代碼示例
- Python sklearn NearestNeighbors.kneighbors用法及代碼示例
- Python sklearn NearestNeighbors.radius_neighbors_graph用法及代碼示例
- Python sklearn NuSVR用法及代碼示例
- Python sklearn NuSVC用法及代碼示例
- Python sklearn NearestNeighbors.kneighbors_graph用法及代碼示例
- Python sklearn jaccard_score用法及代碼示例
- Python sklearn WhiteKernel用法及代碼示例
- Python sklearn CalibrationDisplay.from_predictions用法及代碼示例
- Python sklearn VotingRegressor用法及代碼示例
- Python sklearn gen_batches用法及代碼示例
- Python sklearn ExpSineSquared用法及代碼示例
- Python sklearn MDS用法及代碼示例
- Python sklearn adjusted_rand_score用法及代碼示例
- Python sklearn MLPClassifier用法及代碼示例
- Python sklearn train_test_split用法及代碼示例
- Python sklearn RandomTreesEmbedding用法及代碼示例
- Python sklearn GradientBoostingRegressor用法及代碼示例
- Python sklearn GridSearchCV用法及代碼示例
注:本文由純淨天空篩選整理自scikit-learn.org大神的英文原創作品 sklearn.exceptions.NotFittedError。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。