セクション 5. 章 3
single
Challenge: One-Class SVM for Novelty Detection
メニューを表示するにはスワイプしてください
タスク
スワイプしてコーディングを開始
You are given a 2D dataset of normal points and a few anomalies. Your task is to train a One-Class SVM model to detect novelties, visualize prediction results, and print anomaly proportions.
Follow these steps:
- Import and initialize
OneClassSVMfromsklearn.svm.- Use
kernel='rbf',gamma=0.1,nu=0.05.
- Use
- Fit the model on normal data only (
X_train). - Predict labels for test data (
X_test).- Label meaning:
1→ normal,-1→ novel/anomalous.
- Label meaning:
- Compute the fraction of anomalies in
X_test. - Print:
- Shapes of train/test sets.
- Number and fraction of anomalies detected.
解答
すべて明確でしたか?
フィードバックありがとうございます!
セクション 5. 章 3
single
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください