- Mastering Machine Learning for Penetration Testing
- Chiheb Chebbi
- 127字
- 2021-06-25 21:03:09
Phishing detection with decision trees
To build the second model, we are going to use the same machine learning libraries, so there is no need to import them again. However, we are going to import the decision tree classifier from sklearn:
>>> from sklearn import tree
Create the tree.DecisionTreeClassifier() scikit-learn classifier:
classifier = tree.DecisionTreeClassifier()
Train the model:
classifier.fit(training_inputs, training_outputs)
Compute the predictions:
predictions = classifier.predict(testing_inputs)
Calculate the accuracy:
accuracy = 100.0 * accuracy_score(testing_outputs, predictions)
Then, print out the results:
print ("The accuracy of your decision tree on testing data is: " + str(accuracy))

The accuracy of the second model is approximately 90.4%, which is a great result, compared to the first model. We have now learned how to build two phishing detectors, using two machine learning techniques.
推薦閱讀
- 物聯(lián)網(wǎng)識別技術(shù)
- 物聯(lián)網(wǎng)之魂:物聯(lián)網(wǎng)協(xié)議與物聯(lián)網(wǎng)操作系統(tǒng)
- 互聯(lián)網(wǎng)基礎(chǔ)資源技術(shù)與應(yīng)用發(fā)展態(tài)勢(2021—2023)
- 電力物聯(lián)網(wǎng)工程技術(shù)原理與應(yīng)用
- 中國互聯(lián)網(wǎng)發(fā)展報告2018
- 面向5G-Advanced的關(guān)鍵技術(shù)
- 網(wǎng)管第一課:網(wǎng)絡(luò)操作系統(tǒng)與配置管理
- 轉(zhuǎn)化:提升網(wǎng)站流量和轉(zhuǎn)化率的技巧
- 云計算技術(shù)與標準化
- 物聯(lián)網(wǎng)的機遇與利用
- 物聯(lián)網(wǎng)與智慧廣電
- Cisco無線局域網(wǎng)配置基礎(chǔ)
- 通信系統(tǒng)實戰(zhàn)筆記:無處不在的信號處理
- 路由與交換技術(shù)
- LiveCode Mobile Development Beginner's Guide