The Wayback Machine - https://web.archive.org/web/20240717024754/https://www.geeksforgeeks.org/intrusion-detection-system-using-machine-learning-algorithms/
Open In App

Intrusion Detection System Using Machine Learning Algorithms

Last Updated : 14 Jan, 2022
Improve
Suggest changes
Post a comment
Like Article
Like
Save
Share
Report

Problem Statement: The task is to build a network intrusion detector, a predictive model capable of distinguishing between bad connections, called intrusions or attacks, and good normal connections.

Introduction:
Intrusion Detection System is a software application to detect network intrusion using various machine learning algorithms.IDS monitors a network or system for malicious activity and protects a computer network from unauthorized access from users, including perhaps insider. The intrusion detector learning task is to build a predictive model (i.e. a classifier) capable of distinguishing between ‘bad connections’ (intrusion/attacks) and a ‘good (normal) connections’.

Attacks fall into four main categories:

  • #DOS: denial-of-service, e.g. syn flood;
  • #R2L: unauthorized access from a remote machine, e.g. guessing password;
  • #U2R: unauthorized access to local superuser (root) privileges, e.g., various “buffer overflow” attacks;
  • #probing: surveillance and another probing, e.g., port scanning.

Dataset Used : KDD Cup 1999 dataset

Dataset Description: Data files:

  • kddcup.names : A list of features.
  • kddcup.data.gz : The full data set
  • kddcup.data_10_percent.gz : A 10% subset.
  • kddcup.newtestdata_10_percent_unlabeled.gz
  • kddcup.testdata.unlabeled.gz
  • kddcup.testdata.unlabeled_10_percent.gz
  • corrected.gz : Test data with corrected labels.
  • training_attack_types : A list of intrusion types.
  • typo-correction.txt : A brief note on a typo in the data set that has been corrected

Features:

feature name description type
duration length (number of seconds) of the connection continuous
protocol_type type of the protocol, e.g. tcp, udp, etc. discrete
service network service on the destination, e.g., http, telnet, etc. discrete
src_bytes number of data bytes from source to destination continuous
dst_bytes number of data bytes from destination to source continuous
flag normal or error status of the connection discrete
land 1 if connection is from/to the same host/port; 0 otherwise discrete
wrong_fragment number of “wrong” fragments continuous
urgent number of urgent packets continuous

Table 1: Basic features of individual TCP connections.

feature name description type
hot number of “hot” indicators continuous
num_failed_logins number of failed login attempts continuous
logged_in 1 if successfully logged in; 0 otherwise discrete
num_compromised number of “compromised” conditions continuous
root_shell 1 if root shell is obtained; 0 otherwise discrete
su_attempted 1 if “su root” command attempted; 0 otherwise discrete
num_root number of “root” accesses continuous
num_file_creations number of file creation operations continuous
num_shells number of shell prompts continuous
num_access_files number of operations on access control files continuous
num_outbound_cmds number of outbound commands in an ftp session continuous
is_hot_login 1 if the login belongs to the “hot” list; 0 otherwise discrete
is_guest_login 1 if the login is a “guest”login; 0 otherwise discrete

Table 2: Content features within a connection suggested by domain knowledge.

feature name description type
count number of connections to the same host as the current connection in the past two seconds continuous
Note: The following features refer to these same-host connections.
serror_rate % of connections that have “SYN” errors continuous
rerror_rate % of connections that have “REJ” errors continuous
same_srv_rate % of connections to the same service continuous
diff_srv_rate % of connections to different services continuous
srv_count number of connections to the same service as the current connection in the past two seconds continuous
Note: The following features refer to these same-service connections.
srv_serror_rate % of connections that have “SYN” errors continuous
srv_rerror_rate % of connections that have “REJ” errors continuous
srv_diff_host_rate % of connections to different hosts continuous

Table 3: Traffic features computed using a two-second time window.

Various Algorithms Applied: Gaussian Naive Bayes, Decision Tree, Random Forest, Support Vector Machine, Logistic Regression.

Approach Used: I have applied various classification algorithms that are mentioned above on the KDD dataset and compare there results to build a predictive model.

Step 1 – Data Preprocessing:

Code: Importing libraries and reading features list from ‘kddcup.names’ file.




import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import time
  
# reading features list
with open("..\\kddcup.names", 'r') as f:
    print(f.read())


Code: Appending columns to the dataset and adding a new column name ‘target’ to the dataset.




 
cols ="""duration,
protocol_type,
service,
flag,
src_bytes,
dst_bytes,
land,
wrong_fragment,
urgent,
hot,
num_failed_logins,
logged_in,
num_compromised,
root_shell,
su_attempted,
num_root,
num_file_creations,
num_shells,
num_access_files,
num_outbound_cmds,
is_host_login,
is_guest_login,
count,
srv_count,
serror_rate,
srv_serror_rate,
rerror_rate,
srv_rerror_rate,
same_srv_rate,
diff_srv_rate,
srv_diff_host_rate,
dst_host_count,
dst_host_srv_count,
dst_host_same_srv_rate,
dst_host_diff_srv_rate,
dst_host_same_src_port_rate,
dst_host_srv_diff_host_rate,
dst_host_serror_rate,
dst_host_srv_serror_rate,
dst_host_rerror_rate,
dst_host_srv_rerror_rate"""
  
columns =[]
for c in cols.split(', '):
    if(c.strip()):
       columns.append(c.strip())
  
columns.append('target')
print(len(columns))


Output:

42

Code: Reading the ‘attack_types’ file.




 
cols ="""duration,
protocol_type,
service,
flag,
src_bytes,
dst_bytes,
land,
wrong_fragment,
urgent,
hot,
num_failed_logins,
logged_in,
num_compromised,
root_shell,
su_attempted,
num_root,
num_file_creations,
num_shells,
num_access_files,
num_outbound_cmds,
is_host_login,
is_guest_login,
count,
srv_count,
serror_rate,
srv_serror_rate,
rerror_rate,
srv_rerror_rate,
same_srv_rate,
diff_srv_rate,
srv_diff_host_rate,
dst_host_count,
dst_host_srv_count,
dst_host_same_srv_rate,
dst_host_diff_srv_rate,
dst_host_same_src_port_rate,
dst_host_srv_diff_host_rate,
dst_host_serror_rate,
dst_host_srv_serror_rate,
dst_host_rerror_rate,
dst_host_srv_rerror_rate"""
  
columns =[]
for c in cols.split(', '):
    if(c.strip()):
       columns.append(c.strip())
  
columns.append('target')
print(len(columns))


Output:

back dos
buffer_overflow u2r
ftp_write r2l
guess_passwd r2l
imap r2l
ipsweep probe
land dos
loadmodule u2r
multihop r2l
neptune dos
nmap probe
perl u2r
phf r2l
pod dos
portsweep probe
rootkit u2r
satan probe
smurf dos
spy r2l
teardrop dos
warezclient r2l
warezmaster r2l

Code: Creating a dictionary of attack_types




 
with open("..\\training_attack_types", 'r') as f:
    print(f.read())


Code: Reading the dataset(‘kddcup.data_10_percent.gz’) and adding Attack Type feature in the training dataset where attack type feature has 5 distinct values i.e. dos, normal, probe, r2l, u2r.




  
attacks_types = {
    'normal': 'normal',
'back': 'dos',
'buffer_overflow': 'u2r',
'ftp_write': 'r2l',
'guess_passwd': 'r2l',
'imap': 'r2l',
'ipsweep': 'probe',
'land': 'dos',
'loadmodule': 'u2r',
'multihop': 'r2l',
'neptune': 'dos',
'nmap': 'probe',
'perl': 'u2r',
'phf': 'r2l',
'pod': 'dos',
'portsweep': 'probe',
'rootkit': 'u2r',
'satan': 'probe',
'smurf': 'dos',
'spy': 'r2l',
'teardrop': 'dos',
'warezclient': 'r2l',
'warezmaster': 'r2l',
}


Code: Shape of dataframe and getting data type of each feature




<div id="highlighter_175579" class="syntaxhighlighter nogutter  "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain">path </code><code class="keyword">=</code> <code class="string">"..\\kddcup.data_10_percent.gz"</code></div><div class="line number2 index1 alt1"><code class="plain">df </code><code class="keyword">=</code> <code class="plain">pd.read_csv(path, names </code><code class="keyword">=</code> <code class="plain">columns) </code></div><div class="line number3 index2 alt2"><code class="undefined spaces"> </code> </div><div class="line number4 index3 alt1"><code class="comments"># Adding Attack Type column </code></div><div class="line number5 index4 alt2"><code class="plain">df[</code><code class="string">'Attack Type'</code><code class="plain">] </code><code class="keyword">=</code> <code class="plain">df.target.</code><code class="functions">apply</code><code class="plain">(</code><code class="keyword">lambda</code> <code class="plain">r:attacks_types[r[:</code><code class="keyword">-</code><code class="value">1</code><code class="plain">]]) </code></div><div class="line number6 index5 alt1"><code class="plain">df.head() </code></div><div class="line number7 index6 alt2"><code class="plain"> </code></div></div></td></tr></tbody></table></div>


Output:

 (494021, 43)

Code: Finding missing values of all features.




df.isnull().sum()


Output:

duration                       0
protocol_type                  0
service                        0
flag                           0
src_bytes                      0
dst_bytes                      0
land                           0
wrong_fragment                 0
urgent                         0
hot                            0
num_failed_logins              0
logged_in                      0
num_compromised                0
root_shell                     0
su_attempted                   0
num_root                       0
num_file_creations             0
num_shells                     0
num_access_files               0
num_outbound_cmds              0
is_host_login                  0
is_guest_login                 0
count                          0
srv_count                      0
serror_rate                    0
srv_serror_rate                0
rerror_rate                    0
srv_rerror_rate                0
same_srv_rate                  0
diff_srv_rate                  0
srv_diff_host_rate             0
dst_host_count                 0
dst_host_srv_count             0
dst_host_same_srv_rate         0
dst_host_diff_srv_rate         0
dst_host_same_src_port_rate    0
dst_host_srv_diff_host_rate    0
dst_host_serror_rate           0
dst_host_srv_serror_rate       0
dst_host_rerror_rate           0
dst_host_srv_rerror_rate       0
target                         0
Attack Type                    0
dtype: int64

No missing value found, so we can further proceed to our next step.

Code: Finding Categorical Features




 
  
df = df.dropna('columns')# drop columns with NaN
  
df = df[[col for col in df if df[col].nunique() > 1]]# keep columns where there are more than 1 unique values
  
corr = df.corr()
  
plt.figure(figsize =(15, 12))
  
sns.heatmap(corr)
  
plt.show()
 


Output:

 ['service', 'flag', 'protocol_type']

Visualizing Categorical Features using bar graph

Protocol type: We notice that ICMP is the most present in the used data, then TCP and almost 20000 packets of UDP type

logged_in (1 if successfully logged in; 0 otherwise): We notice that just 70000 packets are successfully logged in.

Target Feature Distribution:

Attack Type(The attack types grouped by attack, it’s what we will predict)

Code: Data Correlation – Find the highly correlated variables using heatmap and ignore them for analysis.




 
  
# This variable is highly correlated with num_compromised and should be ignored for analysis.
#(Correlation = 0.9938277978738366)
df.drop('num_root', axis = 1, inplace = True)
  
# This variable is highly correlated with serror_rate and should be ignored for analysis.
#(Correlation = 0.9983615072725952)
df.drop('srv_serror_rate', axis = 1, inplace = True)
  
# This variable is highly correlated with rerror_rate and should be ignored for analysis.
#(Correlation = 0.9947309539817937)
df.drop('srv_rerror_rate', axis = 1, inplace = True)
  
# This variable is highly correlated with srv_serror_rate and should be ignored for analysis.
#(Correlation = 0.9993041091850098)
df.drop('dst_host_srv_serror_rate', axis = 1, inplace = True)
  
# This variable is highly correlated with rerror_rate and should be ignored for analysis.
#(Correlation = 0.9869947924956001)
df.drop('dst_host_serror_rate', axis = 1, inplace = True)
  
# This variable is highly correlated with srv_rerror_rate and should be ignored for analysis.
#(Correlation = 0.9821663427308375)
df.drop('dst_host_rerror_rate', axis = 1, inplace = True)
  
# This variable is highly correlated with rerror_rate and should be ignored for analysis.
#(Correlation = 0.9851995540751249)
df.drop('dst_host_srv_rerror_rate', axis = 1, inplace = True)
  
# This variable is highly correlated with srv_rerror_rate and should be ignored for analysis.
#(Correlation = 0.9865705438845669)
df.drop('dst_host_same_srv_rate', axis = 1, inplace = True)
 


Output:

Code:





Output:

Code: Feature Mapping – Apply feature mapping on features such as : ‘protocol_type’ & ‘flag’.




 
# flag feature mapping
fmap = {'SF':0, 'S0':1, 'REJ':2, 'RSTR':3, 'RSTO':4, 'SH':5, 'S1':6, 'S2':7, 'RSTOS0':8, 'S3':9, 'OTH':10}
df['flag'] = df['flag'].map(fmap)
 


Code:




 
df.drop('service', axis = 1, inplace = True)


Output:

Code: Remove irrelevant features such as ‘service’ before modelling




 
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import MinMaxScaler
 


Step 2 – Modelling

Code: Importing libraries and splitting the dataset




 
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import MinMaxScaler
 


Code:




 
# Splitting the dataset
df = df.drop(['target', ], axis = 1)
print(df.shape)
  
# Target variable and train set
y = df[['Attack Type']]
X = df.drop(['Attack Type', ], axis = 1)
  
sc = MinMaxScaler()
X = sc.fit_transform(X)
  
# Split test and train data 
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.33, random_state = 42)
print(X_train.shape, X_test.shape)
print(y_train.shape, y_test.shape)
 


Output:

(494021, 31)
(330994, 30) (163027, 30)
(330994, 1) (163027, 1)

Apply various machine learning classification algorithms such as Support Vector Machines, Random Forest, Naive Bayes, Decision Tree, Logistic Regression to create different models.

Code: Python implementation of Gaussian Naive Bayes




 
# Gaussian Naive Bayes
from sklearn.naive_bayes import GaussianNB
from sklearn.metrics import accuracy_score
  
clfg = GaussianNB()
start_time = time.time()
clfg.fit(X_train, y_train.values.ravel())
end_time = time.time()
print("Training time: ", end_time-start_time)
 


Output:

Training time:  1.1145250797271729

Code:




 
# Gaussian Naive Bayes
from sklearn.naive_bayes import GaussianNB
from sklearn.metrics import accuracy_score
  
clfg = GaussianNB()
start_time = time.time()
clfg.fit(X_train, y_train.values.ravel())
end_time = time.time()
print("Training time: ", end_time-start_time)
 


Output:

Testing time:  1.543299674987793

Code:




 
start_time = time.time()
y_test_pred = clfg.predict(X_train)
end_time = time.time()
print("Testing time: ", end_time-start_time)
 


Output:

Train score is: 0.8795114110829804
Test score is: 0.8790384414851528

Code: Python implementation of Decision Tree




 
print("Train score is:", clfg.score(X_train, y_train))
print("Test score is:", clfg.score(X_test, y_test))
 


Output:

 Training time:  2.4408750534057617




 
start_time = time.time()
y_test_pred = clfd.predict(X_train)
end_time = time.time()
print("Testing time: ", end_time-start_time)
 


Output:

Testing time:  0.1487727165222168




 
# Decision Tree 
from sklearn.tree import DecisionTreeClassifier
  
clfd = DecisionTreeClassifier(criterion ="entropy", max_depth = 4)
start_time = time.time()
clfd.fit(X_train, y_train.values.ravel())
end_time = time.time()
print("Training time: ", end_time-start_time)
 


Output:

Train score is: 0.9905829108684749
Test score is: 0.9905230421954646

Code: Python code implementation of Random Forest




 
start_time = time.time()
y_test_pred = clfd.predict(X_train)
end_time = time.time()
print("Testing time: ", end_time-start_time)
 


Output:

 Training time:  17.084914684295654




 
print("Train score is:", clfd.score(X_train, y_train))
print("Test score is:", clfd.score(X_test, y_test))
 


Output:

Testing time:  0.1487727165222168




 
from sklearn.ensemble import RandomForestClassifier
  
clfr = RandomForestClassifier(n_estimators = 30)
start_time = time.time()
clfr.fit(X_train, y_train.values.ravel())
end_time = time.time()
print("Training time: ", end_time-start_time)
 


Output:

Train score is: 0.99997583037759
Test score is: 0.9996933023364228

Code: Python implementation of Support Vector Classifier




 
start_time = time.time()
y_test_pred = clfr.predict(X_train)
end_time = time.time()
print("Testing time: ", end_time-start_time)
 


Output:

Training time:  218.26840996742249

Code:




 
from sklearn.svm import SVC

clfs = SVC(gamma = ‘scale’)
start_time = time.time()
clfs.fit(X_train, y_train.values.ravel())
end_time = time.time()
print(“Training time: “, end_time-start_time)
 


Output:

Testing time:  126.5087513923645

Code:




 
print("Train score is:", clfs.score(X_train, y_train))
print("Test score is:", clfs.score(X_test, y_test))
 


Output:

Train score is: 0.9987552644458811
Test score is: 0.9987916112055059

Code: Python implementation of Logistic Regression




 
start_time = time.time()
y_test_pred = clfs.predict(X_train)
end_time = time.time()
print("Testing time: ", end_time-start_time)
 


Output:

Training time:  92.94222283363342

Code:




<div id="highlighter_739590" class="syntaxhighlighter nogutter  "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain">  </code></div><div class="line number2 index1 alt1"><code class="plain">start_time </code><code class="keyword">=</code> <code class="plain">time.time() </code></div><div class="line number3 index2 alt2"><code class="plain">y_test_pred </code><code class="keyword">=</code> <code class="plain">clfl.predict(X_train) </code></div><div class="line number4 index3 alt1"><code class="plain">end_time </code><code class="keyword">=</code> <code class="plain">time.time() </code></div><div class="line number5 index4 alt2"><code class="functions">print</code><code class="plain">(</code><code class="string">"Testing time: "</code><code class="plain">, end_time</code><code class="keyword">-</code><code class="plain">start_time) </code></div><div class="line number6 index5 alt1"><code class="plain"> </code></div></div></td></tr></tbody></table></div>


Output:

Testing time:  0.09605908393859863

Code:




 
print("Train score is:", clfl.score(X_train, y_train))
print("Test score is:", clfl.score(X_test, y_test))
 


Output:

Train score is: 0.9935285835997028
Test score is: 0.9935286792985211

Code: Python implementation of Gradient Descent




 
start_time = time.time()
y_test_pred = clfl.predict(X_train)
end_time = time.time()
print("Testing time: ", end_time-start_time)
 


Output:

Training time:  633.2290260791779




 
print("Train score is:", clfl.score(X_train, y_train))
print("Test score is:", clfl.score(X_test, y_test))
 


Output:

Testing time:  2.9503915309906006




 
from sklearn.ensemble import GradientBoostingClassifier
  
clfg = GradientBoostingClassifier(random_state = 0)
start_time = time.time()
clfg.fit(X_train, y_train.values.ravel())
end_time = time.time()
print("Training time: ", end_time-start_time)
 


Output:

Train score is: 0.9979304760811374
Test score is: 0.9977181693829856

Code: Analyse the training and testing accuracy of each model.




<div id="highlighter_294298" class="syntaxhighlighter nogutter  "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain">  </code></div><div class="line number2 index1 alt1"><code class="plain">start_time </code><code class="keyword">=</code> <code class="plain">time.time() </code></div><div class="line number3 index2 alt2"><code class="plain">y_test_pred </code><code class="keyword">=</code> <code class="plain">clfg.predict(X_train) </code></div><div class="line number4 index3 alt1"><code class="plain">end_time </code><code class="keyword">=</code> <code class="plain">time.time() </code></div><div class="line number5 index4 alt2"><code class="functions">print</code><code class="plain">(</code><code class="string">"Testing time: "</code><code class="plain">, end_time</code><code class="keyword">-</code><code class="plain">start_time) </code></div><div class="line number6 index5 alt1"><code class="plain"> </code></div></div></td></tr></tbody></table></div>


Output:

Code:




 
names = ['NB', 'DT', 'RF', 'SVM', 'LR', 'GB']
values = [87.951, 99.058, 99.997, 99.875, 99.352, 99.793]
f = plt.figure(figsize =(15, 3), num = 10)
plt.subplot(131)
plt.bar(names, values)


Output:

Code: Analyse the training and testing time of each model.




 
names = ['NB', 'DT', 'RF', 'SVM', 'LR', 'GB']
values = [87.903, 99.052, 99.969, 99.879, 99.352, 99.771]
f = plt.figure(figsize =(15, 3), num = 10)
plt.subplot(131)
plt.bar(names, values)
 


Output:

Code:




 
names = ['NB', 'DT', 'RF', 'SVM', 'LR', 'GB']
values = [1.11452, 2.44087, 17.08491, 218.26840, 92.94222, 633.229]
f = plt.figure(figsize =(15, 3), num = 10)
plt.subplot(131)
plt.bar(names, values)
 


Output:

Implementation Link: https://github.com/mudgalabhay/intrusion-detection-system/blob/master/main.ipynb

Conclusion: The above analysis of different models states that the Decision Tree model best fits our data considering both accuracy and time complexity.

Links: The complete code is uploaded on my github account – https://github.com/mudgalabhay/intrusion-detection-system



Previous Article
Next Article

Similar Reads

Comparing anomaly detection algorithms for outlier detection on toy datasets in Scikit Learn
Anomaly is a deviation from the expected or normal behavior or pattern. Anomaly detection is the process of identifying these unusual patterns or behaviors in data. It is important because anomalies can indicate important events or problems, such as fraudulent activity, equipment failure, or security breaches. Anomaly detection is used in a variety
9 min read
Tumor Detection using classification - Machine Learning and Python
In this article, we will be making a project through Python language which will be using some Machine Learning Algorithms too. It will be an exciting one as after this project you will understand the concepts of using AI &amp; ML with a scripting language. The following libraries/packages will be used in this project: numpy: It's a Python library t
9 min read
Fake News Detection using Machine Learning
Fake news on different platforms is spreading widely and is a matter of serious concern, as it causes social wars and permanent breakage of the bonds established among people. A lot of research is already going on focused on the classification of fake news. Here we will try to solve this issue with the help of machine learning in Python. Before sta
4 min read
Online Payment Fraud Detection using Machine Learning in Python
As we are approaching modernity, the trend of paying online is increasing tremendously. It is very beneficial for the buyer to pay online as it saves time, and solves the problem of free money. Also, we do not need to carry cash with us. But we all know that Good thing are accompanied by bad things. The online payment method leads to fraud that can
5 min read
Alzheimer's detection Using Machine Learning
Alzheimer's disease is a neurodegenerative disorder characterized by progressive cognitive decline and memory loss. Detecting Alzheimer's disease early is crucial for timely intervention and treatment. While I can provide some general information on Alzheimer's detection, it's important to consult medical professionals for accurate diagnosis and ad
5 min read
How to create a Face Detection Android App using Machine Learning KIT on Firebase
Pre-requisites: Firebase Machine Learning kitAdding Firebase to Android AppFirebase ML KIT aims to make machine learning more accessible, by providing a range of pre-trained models that can use in the iOS and Android apps. Let's use ML Kit’s Face Detection API which will identify faces in photos. By the end of this article, we’ll have an app that c
9 min read
Need of Data Structures and Algorithms for Deep Learning and Machine Learning
Deep Learning is a field that is heavily based on Mathematics and you need to have a good understanding of Data Structures and Algorithms to solve the mathematical problems optimally. Data Structures and Algorithms can be used to determine how a problem is represented internally or how the actual storage pattern works &amp; what is happening under
6 min read
Machine Learning for Anomaly Detection
Anomaly Detection is the technique of identifying rare events or observations which can raise suspicions by being statistically different from the rest of the observations. Such "anomalous" behaviour typically translates to some kind of a problem like a credit card fraud, failing machine in a server, a cyber attack, etc.An anomaly can be broadly ca
4 min read
Automating the Machine Learning Pipeline for Credit card fraud detection
Before going to the code it is requested to work on a Jupyter notebook or ipython notebook. If not installed on your machine you can use Google Colab.This is one of the best and my personal favorite way of working on a python script to work on a Machine Learning problem. Previous article: Credit Card Fraud Detection using Python Now, I am consideri
4 min read
Rule Based System Vs Machine Learning System
There are two main approaches in Artificial intelligence they are rule-based systems and machine-learning systems. Rule-based systems follow explicit rules created by human experts. They're like a set of instructions given to a computer that follows to make decisions. These systems are good for problems with clear rules and paths. On the other hand
8 min read
three90RightbarBannerImg