Last active
July 11, 2020 19:32
-
-
Save lynnssi/0261fafb9480f93b903aab79ed289083 to your computer and use it in GitHub Desktop.
Basic sktime classification example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sktime.datasets import load_arrow_head | |
from sktime.classification.compose import TimeSeriesForestClassifier | |
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) | |
accuracy_score(y_test, y_pred) | |
>>0.8679245283018868 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment