Tech Savvy
Passionate about Coding, Data Science, Web Development, Full Stack Development, and curious about learning new stuff.

Machine learning (ML) is fast altering the world, thanks to a wide range of applications as well as research being carried out in both business and academic institutions. Machine learning is having an impact on every aspect of our life right now. The use of natural language processing and machine learning to arrange appointments, check our calendars, and play music, to programmatic marketing that has been so accurate in how they can forecast what we will require before we even think about it, are all examples of how technology is changing our lives.

It is frequently difficult to keep up with "what is significant" in the scientific machine learning field because of the complexity of the field. However, we want to make certain that people who want to understand machine learning but are unfamiliar with the principles are provided with a learning route. In this post, we will take a look at the most important fundamental algorithms that will potentially make your machine learning experience less difficult.

Linear regression


Linear regression is a machine learning technique that is widely used and prominent in the field of data science, and it is employed by data scientists all over the world. Consider a collection of stones that are arranged in an ascending weights arrangement in order to better comprehend the usefulness of this method. The only restriction is that you are not permitted to weigh these stones on your own. You will have to estimate the weight of these logs based on their height and form and then arrange them according to a categorization system that is based on observable characteristics. This is exactly what linear regression is intended to do and that you can learn with a machine learning course.

The mathematical representation of linear regression is accomplished by the use of an equation that defines a line that fits extremely well into the connection between the input variables and the output variable. 

Learning the basic machine learning algorithm for job interviews.


The Naive Bayes Algorithm


Known as supervised learning, Naive Bayes is a proven technique that is based on the Bayes' Theorem and posits that the existence of a given characteristic in a class is independent of the accessibility of any other type of feature. Though the attributes are connected, the classifier could assess each of the unique qualities separately when determining the likelihood that the event would happen.

It could be very simple to construct and also outrun the most advanced classification systems when dealing with large datasets.

As stated above, Bayes' Theorem, which is based on intuition, gives a method of computing the posterior probability directly from the class prior probability, likelihood, and predictor prior probabilities with the assistance of the equation below:

  • In the case of P(C|X), it is equal to the product of (P(X|C)P(C)) / P(X).
  • In the case of class (target), P(C|X) denotes the posterior probability of the class (target) given the predictor (attribute)
  • P(C) denotes the probability of a class being selected first.
  • P(X|C) -> Probability of the predictor being in the provided class
  • P(X) denotes the prior probability of the prediction.

For better understanding, we advise you to take a machine learning course where you can practice more. 

CART


One type of Decision Tree is the Classification and Regression Tree (CART), which is an implementation of the Decision Tree.

Classification and Regression are non-terminal nodes in a graph. The root node, as well as the interior node of a tree, are also called nodes. All leaf nodes are directly located at the terminal nodes. Every non-terminal node denotes a single input variable (x) along with a splitting point on that variable, and each leaf node denotes the output variable (y). In Order to generate predictions, this model is employed in the following ways: travel through the splits of the tree until you reach a leaf node, along with an output of the value that is available at the leaf node. This Is the most fundamental aspect of a machine learning course for students. 

Logistic regression 


This algorithm is taken from the discipline of statistical computation. Generally speaking, it is generally considered an acceptable strategy for completing binary classification issues. When performing logistic regression, the primary goal is to determine the values of the coefficients that reflect all of the input variables. The common output anticipated for logistic regression is different from the common output expected for linear regression because it is based on a nonlinear function known as the logistic function that you will learn in a machine learning course.

Because of its structure, the logistic function looks like a large "S," and it may be used to adjust any number between 0 and 1. It is useful in assigning a single rule to the result of the logistic function for altering values from 0 to 1 by modifying the input values of the logistic function. Given the manner in which this model is comprehended or identified, the significant predictions generated by the logistic regression may be employed as the chance of any data falling into either of the two classes 0 and 1. This could be used to tackle challenges in which a forecast requires more thinking than is normally supplied and refer to this to know more. 

Working in a manner that is very identical to linear regression, the logic regression becomes all the more successful when the qualities that are not related to the output variable, as well as the attributes that are similar in nature, are excluded from the equation of the logic regression. You can speed up your learning process by taking a reliable machine learning course. 


#machinelearning (1)
When the frames assigned to a single process are occupied altogether and the CPU wants to load another page into main memory then according to the Page replacement Algorithm, Operating System finds out the victim frame(frame in which page is replaced) and the new incoming page is replaced in victim frame. 

Range: 


  1. In this article, we will discuss important page replacement algorithms and their conceptualization. 
  2. Along with this, we will also discuss how it will work with respective examples to get more insights about algorithms. 

Types of Page Replacement Algorithms: 


1. First In First Out Algorithm : 
This is the most basic and easy-to-implement page replacement algorithm in os which is known as “First In First Out”. As per the name of the algorithm we can say that Queue is the underlying data structure for this implementation. In this algorithm when the CPU asks for any page which results in page fault then it will consider the victim frame based on the FIFO principle. 

For eg. Let's say [7, 0, 1, 2, 0, 3] is a reference string from the CPU and 3 frames are allocated for this process. In this case, the Operating System serves page faults for the first 3 pages as they are getting loaded for the first time in the main memory. Now for the 4th page with page number 2 all the frames are occupied so the operating system will select the 1st page with page number 7 as the victim page as this came first in memory so it will get replaced first in the main memory. This is how the FIFO page replacement algorithm in os works. 

2. Optimal Page Replacement Algorithm : 
If we consider the best scenario the pages which are going to be replaced are either never to be demanded in the future or it has a maximum number of page requests to be served before its demand in the future this algorithm is known as “Optimal Page Replacement Algorithm.” This algorithm will assure the lowest possible page fault rate for a fixed number 
of frames. This algorithm is difficult to implement as compared to other page replacement algorithms in os due to it being a feature of tracking future knowledge of reference strings. 

For eg. Suppose [7,0,1,2,0,3,2,7,4,1,6,5] is a reference string from the CPU and let's assume we have 3 frames for this process. By default, by serving page faults the first 3 pages are filled in empty frames. Now for the 4th reference with page number 2 the algorithm looks for previous pages for its next references. In this case page numbers, 0,7, and 1 will get page requests in the future at reference 5th,8th and 10th reference respectively. So we can see page number 1 will get served after the max number of page requests so replace that with page number 2. That's how the Optimal page replacement algorithm in os works. 

3. LRU page replacement : 
There is a key distinction between FIFO and Optimal page replacement algorithms in os where FIFO keeps track of the time when a page is brought into the main memory and the Optimal page replacement algorithm keeps track of future references. In the “Least Recently Used Page Replacement algorithm” we can use past references as a short future estimation. In this case, the os will replace the page which has not been used in the past over the longest period of time. 

For eg. Let's assume [4,1,2,1,2,4,5,0,4] is a reference string from the CPU and we have 3 frames for the process. By default, the first 3 pages are loaded into an empty frame by serving page faults. Then from the 4th to 6th reference, we have pages loaded into main memory so it can be said as page hits. Now for the 7th reference with page number 5, it will take a look in the past and 1 is the least recently used page in the past so the operating system selects the frame with page 1 as the victim frame and applies a replacement algorithm over it. That's how the LRU replacement algorithm works. 

Summary: 

  1. Page replacement algorithms are simple techniques used by the operating system to minimize the page fault rate and maximize the CPU utilization by keeping necessary pages in the main memory. 
  2. First In First Out page replacement algorithm is simple and easy to implement and uses queue as the underlying data structure. 
  3. The optimal Page replacement algorithm looks for pages to replace which will be referenced after the maximum number of page requests. 
  4. LRU page replacement algorithm is as its name suggests replaces the page which has not been used in the past for the longest duration of time. 
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Author Bio: 
Akash Pawar is a software engineer and has a passion to write technical blogs with expertise in Data Structures and Algorithms, Operating systems and has exposure to large-scale System Designs. 
#operating (1) #system, (1) #page (1) #replacement (1) #in (1) #os (1)