
417
13
장
시계열 클러스터링
min_samples=min_samples, alpha=alpha,
cluster_selection_method=cluster_selection_method,
prediction_data=prediction_data)
preds = hdb.fit_predict(X_train.reshape(4000,140))
ars = adjusted_rand_score(data_train[:,0], preds)
print("Adjusted Rand Index on Training Set:", ars)
훈련셋의 수정된
Rand
지수는
0
.
769
로 인상적입니다.
Adjusted Rand Index on Training Set using HDBSCAN: 0.7689563655060421
이제 테스트셋을 평가하겠습니다.
# 테스트셋으로 예측 및 평가하기
preds_test = hdbscan.prediction.approximate_predict(
hdb, X_test.reshape(1000,140))
ars = adjusted_rand_score(data_test[:,0], preds_test[0])
print("Adjusted Rand Index on Test Set:", ars)
테스트셋의 수정된
Rand
지수는
0
.
720
으로 역시 인상적입니다.