Python में मशीन लर्निंग वर्कफ़्लो डिज़ाइन करना
Dr. Chris Anagnostopoulos
Honorary Associate Professor
सत्य के स्तर:
बिना शोर या strong लेबल:
शोरयुक्त या weak लेबल:
फीचर इंजीनियरिंग:
हर संक्रमित होस्ट द्वारा विज़िट किए गए यूनिक पोर्ट्स का औसत:
np.mean(X[y]['unique_ports'])
15.11
लेबल न मानते हुए प्रति होस्ट यूनिक पोर्ट्स का औसत:
np.mean(X['unique_ports'])
11.23
किसी फीचर को लेबलिंग ह्यूरिस्टिक में बदलें:
X_train, X_test, y_train, y_test = train_test_split(X, y)
y_weak_train = X_train['unique_ports'] > 15


X_train_aug = pd.concat([X_train, X_train])
y_train_aug = pd.concat([pd.Series(y_train), pd.Series(y_weak_train)])

weights = [1.0]*len(y_train) + [0.1]*len(y_weak_train)
केवल ग्राउंड ट्रुथ से एक्यूरेसी:
0.91
ग्राउंड ट्रुथ और कमजोर लेबल, बिना वेट्स:
accuracy_score(y_test, clf.fit(X_train_aug, y_train_aug).predict(X_test))
0.93
वेट्स जोड़ें:
accuracy_score(y_test, clf.fit(X_train_aug, y_train_aug, sample_weight=weights).predict(X_test))
0.95
Python में मशीन लर्निंग वर्कफ़्लो डिज़ाइन करना