0% found this document useful (0 votes)
54 views5 pages

Report Double Column

This document discusses comparing CPU scheduling algorithms using machine learning. It analyzes First Come First Serve (FCFS), Shortest Job First (SJF), and Round Robin algorithms on randomly generated data. K-nearest neighbors, decision trees, and naive Bayes classifiers are applied to select the best algorithm based on attributes like arrival time and burst time. The results aim to determine the most productive CPU scheduling option using predictive analysis between algorithms.

Uploaded by

Abeer Pareek
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views5 pages

Report Double Column

This document discusses comparing CPU scheduling algorithms using machine learning. It analyzes First Come First Serve (FCFS), Shortest Job First (SJF), and Round Robin algorithms on randomly generated data. K-nearest neighbors, decision trees, and naive Bayes classifiers are applied to select the best algorithm based on attributes like arrival time and burst time. The results aim to determine the most productive CPU scheduling option using predictive analysis between algorithms.

Uploaded by

Abeer Pareek
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Comparative and predictive analysis between various

CPU scheduling algorithms

Abstract: select the CPU scheduling algorithm. It's


As a means of determining which of the possible that this could happen.
jobs in the ready queue should be given an Classification for machine learning based
allocation of CPU resources, a number of on the concept of supervised learning can
distinct CPU scheduling strategies have be applied in a wide range of situations.
been proposed as a possible solution. This There are three different types of
enables the determination of which job in classifiers used in this study: The K
the ready queue ought to be given the CPU nearest neighbour, Decision Tree, and
allocation that is currently available. These Nave Bayes.
scheduling algorithms make use of a wide
variety of different strategies in order to
select a task from the ready queue and then Literature Review:
assign it to the processor. This process is The CPU is the most essential and
called "select and assign." Like FCFS, important part of a computer system.
SJF, SRTF. The purpose of this "CPU scheduling" means choosing which
investigation is to determine which of multiple processes to run on the CPU
algorithm would be the most productive while another waits. While another process
option for tackling the challenge that is waits, this decision is made. It's also called
still in front of us. "the CPU scheduler." Algorithmic CPU
management and scheduling is the primary
service in operating systems that ensures
Research Statement and efficient CPU use (CPU). This service
manages CPU usage (CPU). This article
Conjecture: compares and contrasts research on CPU
This study's results suggest the use of scheduling algorithms to determine the
machine learning to select an excellent most effective one. This analysis will
CPU scheduling strategy that takes determine the best CPU-scheduling
sequencing into account. An appropriate algorithm. Several researchers have
machine learning algorithm can be used to proposed algorithms to improve CPU
accomplish this. Algorithms based on waiting, response, and turnaround times.
machine learning (ML) may be used to
No algorithm is superior in all criteria, so which one provides the most accurate
no approach can improve CPU results. If the queue is still empty after
optimization. The Round Robin, Shortest waiting for a maximum of 100-time units,
Job First, First Come First Served, and the system predicts the next algorithm
Priority algorithms should be common immediately rather than waiting any
knowledge. longer. This is due to the fact that wasting
Many unique approaches have been time is a waste of resources. The following
proposed by researchers to improve CPU machine learning models were used to
scheduling and, by extension, resource make the prediction:
utilisation. There have been many different KNN:
approaches to implementing these ideas. Assuming that the new case and preceding
Here are a few instances of this type of cases are comparable, the KNN algorithm
thing: Himanshu Arora, a computer assigns the new instance to the category
science and engineering professor at the that is most similar to the currently
Indira Gandhi Institute of Technology in employed categories. This is accomplished
Delhi, India, is a good example of this type by comparing the new instance to the
of person. The Krishna Institute of currently employed categories. The K-NN
Technology's computer science department algorithm is then utilised to classify a new
is home to Parita Jain, a computer data point based on its similarity to
scientist. We're using machine learning previously stored data. After all previous
algorithms in our research to broaden the data has been saved, this occurs. This
current selection of CPU scheduling demonstrates that the K-NN method is
algorithms and improve their performance capable of quickly and accurately
at the same. categorising newly acquired data while
maintaining a high level of efficiency.
Methodology: Decision tree:
In order to schedule tasks, the dynamic the nodes represent the areas where an
CPU scheduling approach described in this attribute is selected and a question is
study uses machine learning techniques. posed, the edges represent the possible
Planning for the near future is a primary responses, and the leaves represent the
focus of this methodology. Our solution actual output or class label. Each node in
will use the well-known CPU scheduling the tree corresponds to one of these three
algorithms known as FCFS, SJF, and components. In other words, each of these
round robin in order to keep things simple three components is represented by a node
and demonstrate that the idea is viable. It within the tree. Even when making
is proposed that rather than using a single decisions involving nonlinear
scheduling strategy for all processes (ready relationships, they employ a
queue size = 5), the proposed algorithm straightforward and linear decision
will select the optimal scheduling strategy surface. In the technique known as
for the available set of processes (ready decision trees, examples are arranged from
queue size = 5). Using a weighted average the tree's root to its leaf node, with the leaf
of the training data, we will make this node representing the category to which
choice. We put all five of our standard the example belongs. This method is used
procedures to the test in order to determine
to determine which categories examples single-judge final, and round robin with
belong to by determining which category Quantum equal to 5 are the algorithms
they belong to base on the examples used. The following is the result of
themselves. Each of the tree's nodes applying the FCFS, SJF, and round robin
represents a test case for a different algorithms in that order to a computer
attribute, and the edges emanating from programme.
those nodes each represent a possible
A total of 1500 datapoints were generated
response to the test. In other words, the
randomly and based on the following set
structure of the tree allows for multiple
of rules the names of algorithms had been
interpretations of each node. This
allocated to each individual datapoint:
procedure is repeated for each subtree
whose root is positioned at a new node in  If burst time of all processes is the
the tree structure. same, FCFS and SJF have the best
Naïve Bayes average waiting time, then FCFS
The Naive Bayes classifier assumes that shall be preferred as SJF requires
the presence of one feature does not comparison operations that are time
influence the presence of other features consuming.
within the class. This is the fundamental  If the burst time is the same but
assumption supporting the classification greater than a threshold value, e.g.
system. The procedure begins by 7 sec, fair scheduling is required
generating a frequency table for each class with time quantum 5 i.e. Round
before moving on to the subsequent step of Robin.
creating a likelihood table. The process  If the arrival time is different with
then advances to the next phase. The final most processes having a burst time
step is to calculate the probability based on lower than a specified threshold
all of the previously presented data. (e.g. 7 in our example), we choose
Data Collection: SJF.
Initial steps include training a machine  If the arrival time is different with
learning model with the features that were most processes having a burst time
chosen. P1, P2, P3, P4, and P5 are the five higher than a specified threshold
processes that we've considered. They all (i.e. 7), we choose Round Robin.
have a time when they arrive, and a burst  If the burst time is different with
time when they explode. Due to the lack of most processes having a burst time
existing datasets for training classifiers, the lower than a specified threshold but
most significant challenge in creating a the average arrival time difference
dynamic CPU scheduling system is is greater than a specified
obtaining those data sources. This is due to threshold, we choose FCFS
the fact that there aren't any published data
on the subject.
There are three algorithms used to build
our dataset, and each of the five processes
that comprise our ready queue uses one of
these algorithms. First-come, first-served,
Figure 1: Sample data

Pre-Processing
Categorical to numeric conversion of
Algorithm names: Since the algorithm
Figure 3: KNN Confusion Matrix
names are categorical in nature so using
them in the classification code is only Naïve Bayes:
possible by converting them into numeric
which in this case was done as ('FCFS',
'RR', 'SFJ') the algorithm names which are
first come first serve, round robin and
shortest job first respectively are numbered
(0, 1, 2) respectively.

Results: Figure 4: Naive Bayes Classification report

For the model to train in all three


algorithms the dataset containing 1500
datapoints was split into ration of 3:1
which means for training 75% of the
dataset was used and for testing a total of
375 datapoints are used

KNN:

Figure 5: Naive Bayes Confusion Matrix

Decision Tree:
Figure 2: KNN Classification report

Figure 6: Decision Tree Classification report


on Knowledge and Data
Engineering, 28(6), 1602-1606.
[5.]El-Sharawy, Enas. (2021). A
Review on the CPU Scheduling
Algorithms: Comparative Study.
International Journal of Network
Security. 21. 19-26.
10.22937/IJCSNS.2021.21.1.4.

Figure 7:Decision tree Confusion Matrix

Conclusion:
Choosing the right scheduling algorithm
for the central processing unit is a critical
issue that has a direct impact on the CPU's
performance (CPU). As a result, we were
meticulous in our work. A decision tree's
precision is superior to that of the other
alternatives. An algorithm's computation
time, the selection of a queue scheduling
algorithm, and simultaneous file
processing could all be added to this work
in the near future.

References
[1.]https://ieeexplore.ieee.org/stamp/
stamp.jsp?tp=&arnumber=7951997
[2.]Ekta Walia, “Operating Systems”,
Khanna Publishing House, Delhi,
2nd Edition, ISBN-10
[3.]Jiang, L., Li, C., Wang, S., &
Zhang, L. (2016). Deep feature
weighting for naive Bayes and its
application to text classification.
Engineering Applications of
Artificial Intelligence, 52, 26-39.
[4.]Tang, B., He, H., Baggenstoss, P.
M., & Kay, S. (2016). A Bayesian
classification approach using class
specific features for text
categorization. IEEE Transactions

You might also like