sktime时间序列分类


from sktime.classification.interval_based import TimeSeriesForestClassifier
from sktime.datasets import load_arrow_head
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score

X, y = load_arrow_head(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y)
classifier = TimeSeriesForestClassifier()
classifier.fit(X_train, y_train)
y_pred = classifier.predict(X_test)
s1 = accuracy_score(y_test, y_pred)
print(s1)

posted @ 2021-11-18 18:35  oaksharks  阅读(451)  评论(0编辑  收藏  举报