You are reading the article **Beginner’s Guide To Image Gradient** updated in December 2023 on the website Achiashop.com. We hope that the information we have shared is helpful to you. If you find the content interesting and meaningful, please share it with your friends and continue to follow and support us for the latest updates. *Suggested January 2024 Beginner’s Guide To Image Gradient*

So, the gradient helps us measure how the image changes and based on sharp changes in the intensity levels; it detects the presence of an edge. We will dive deep into it by manually computing the gradient in a moment.

Why do we need an image gradient?Image gradient is used to extract information from an image. It is one of the fundamental building blocks in image processing and edge detection. The main application of image gradient is in edge detection. Many algorithms, such as Canny Edge Detection, use image gradients for detecting edges.

Mathematical Calculation of Image gradientsEnough talking about gradients, Let’s now look at how we compute gradients manually. Let’s take a 3*3 image and try to find an edge using an image gradient. We will start by taking a center pixel around which we want to detect the edge. We have 4 main neighbors of the center pixel, which are:

(iv) P(x,y+1) bottom pixel

We will subtract the pixels opposite to each other i.e. Pbottom – Ptop and Pright – Pleft , which will give us the change in intensity or the contrast in the level of intensity of the opposite the pixel.

Change of intensity in the X direction is given by:

Gradient in Y direction = PR - PLChange of intensity in the Y direction is given by:

Gradient in Y direction = PB - PTGradient for the image function is given by:

𝛥I = [𝛿I/𝛿x, 𝛿I/𝛿y]Let us find out the gradient for the given image function:

We can see from the image above that there is a change in intensity levels only in the horizontal direction and no change in the y direction. Let’s try to replicate the above image in a 3*3 image, creating it manually-

Let us now find out the change in intensity level for the image above

GX = PR - PL Gy = PB - PT GX = 0-255 = -255 Gy = 255 - 255 = 0𝛥I = [ -255, 0]

Let us take another image to understand the process clearly.

Let us now try to replicate this image using a grid system and create a similar 3 * 3 image.

Now we can see that there is no change in the horizontal direction of the image

GX = PR - PL , Gy = PB - PT GX = 255 - 255 = 0 Gy = 0 - 255 = -255𝛥I = [0, -255]

But what if there is a change in the intensity level in both the direction of the image. Let us take an example in which the image intensity is changing in both the direction

Let us now try replicating this image using a grid system and create a similar 3 * 3 image.

GX = PR - PL , Gy = PB - PT GX = 0 - 255 = -255 Gy = 0 - 255 = -255𝛥I = [ -255, -255]

Now that we have found the gradient values, let me introduce you to two new terms:

Gradient magnitude

Gradient orientation

Gradient magnitude represents the strength of the change in the intensity level of the image. It is calculated by the given formula:

Gradient Magnitude: √((change in x)² +(change in Y)²)The higher the Gradient magnitude, the stronger the change in the image intensity

Gradient Orientation represents the direction of the change of intensity levels in the image. We can find out gradient orientation by the formula given below:

Gradient Orientation: tan-¹( (𝛿I/𝛿y) / (𝛿I/𝛿x)) * (180/𝝅) Overview of FiltersWe have learned to calculate gradients manually, but we can’t do that manually each time, especially with large images. We can find out the gradient of any image by convoluting a filter over the image. To find the orientation of the edge, we have to find the gradient in both X and Y directions and then find the resultant of both to get the very edge.

Different filters or kernels can be used for finding gradients, i.e., detecting edges.

3 filters that we will be working on in this article are

Roberts filter

Prewitt filter

Sobel filter

All the filters can be used for different purposes. All these filters are similar to each other but different in some properties. All these filters have horizontal and vertical edge detecting filters.

These filters differ in terms of the values orientation and size

Roberts FilterSuppose we have this 4*4 image

Let us look at the computation

The gradient in x-direction =

Gx = 100 *1 + 200*0 + 150*0 - 35*1 Gx = 65The gradient in y direction =

Gy = 100 *0 + 200*1 - 150*1 + 35*0 Gy = 50Now that we have found out both these values, let us calculate gradient strength and gradient orientation.

Gradient magnitude = √(Gx)² + (Gy)² = √(65)² + (50)² = √6725 ≅ 82We can use the arctan2 function of NumPy to find the tan-1 in order to find the gradient orientation

Gradient Orientation = np.arctan2( Gy / Gx) * (180/ 𝝅) = 37.5685 Prewitt FilterPrewitt filter is a 3 * 3 filter and it is more sensitive to vertical and horizontal edges as compared to the Sobel filter. It detects two types of edges – vertical and horizontal. Edges are calculated by using the difference between corresponding pixel intensities of an image.

A working example of Prewitt filterSuppose we have the same 4*4 image as earlier

Let us look at the computation

The gradient in x direction =

Gx = 100 *(-1) + 200*0 + 100*1 + 150*(-1) + 35*0 + 100*1 + 50*(-1) + 100*0 + 200*1 Gx = 100The gradient in y direction =

Gy = 100 *1 + 200*1 + 200*1 + 150*0 + 35*0 +100*0 + 50*(-1) + 100*(-1) + 200*(-1) Gy = 150Now that we have found both these values let us calculate gradient strength and gradient orientation.

Gradient magnitude = √(Gx)² + (Gy)² = √(100)² + (150)² = √32500 ≅ 180We will use the arctan2 function of NumPy to find the gradient orientation

Gradient Orientation = np.arctan2( Gy / Gx) * (180/ 𝝅) = 56.3099 Sobel FilterSobel filter is the same as the Prewitt filter, and just the center 2 values are changed from 1 to 2 and -1 to -2 in both the filters used for horizontal and vertical edge detection.

A working example of Sobel filterSuppose we have the same 4*4 image as earlier

Let us look at the computation

The gradient in x direction =

Gx = 100 *(-1) + 200*0 + 100*1 + 150*(-2) + 35*0 + 100*2 + 50*(-1) + 100*0 + 200*1 Gx = 50The gradient in y direction =

Gy = 100 *1 + 200*2 + 100*1 + 150*0 + 35*0 +100*0 + 50*(-1) + 100*(-2) + 200*(-1) Gy = 150Now that we have found out both these values, let us calculate gradient strength and gradient orientation.

Gradient magnitude = √(Gx)² + (Gy)² = √(50)² + (150)² = √ ≅ 58Using the arctan2 function of NumPy to find the gradient orientation

Gradient Orientation = np.arctan2( Gy / Gx) * (180/ 𝝅) = 71.5650 Implementation using OpenCVWe will perform the program on a very famous image known as Lenna.

Let us start by installing the OpenCV package

#installing opencv !pip install cv2After we have installed the package, let us import the package and other libraries

Using Roberts filterPython Code:

Using Prewitt Filter #Converting image to grayscale gray_img = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) #Creating Prewitt filter kernelx = np.array([[1,1,1],[0,0,0],[-1,-1,-1]]) kernely = np.array([[-1,0,1],[-1,0,1],[-1,0,1]]) #Applying filter to the image in both x and y direction img_prewittx = cv2.filter2D(img, -1, kernelx) img_prewitty = cv2.filter2D(img, -1, kernely) # Taking root of squared sum(np.hypot) from both the direction and displaying the result prewitt = np.hypot(img_prewitty,img_prewittx) prewitt = prewitt[:,:,0] prewitt = prewitt.astype('int') plt.imshow(prewitt,cmap='gray')OUTPUT:

Using Sobel filter gray_img = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) kernelx = np.array([[-1,0,1],[-2,0,2],[-1,0,1]]) kernely = np.array([[1, 2, 1],[0, 0, 0],[-1,-2,-1]]) img_x = cv2.filter2D(gray_img, -1, kernelx) img_y = cv2.filter2D(gray_img, -1, kernely) #taking root of squared sum and displaying result new=np.hypot(img_x,img_y) plt.imshow(new.astype('int'),cmap='gray')OUTPUT:

ConclusionThis article taught us the basics of Image gradient and its application in edge detection. Image gradient is one of the fundamental building blocks of image processing. It is the directional change in the intensity of the image. The main application of image gradient is in edge detection. Finding the change in intensity can conclude that it can be a boundary of an object. We can compute the gradient, its magnitude, and the orientation of the gradient manually. We usually use filters, which are of many kinds and for different results and purposes. The filters discussed in this article are the Roberts filter, Prewitt filter, and Sobel filter. We implemented the code in OpenCV, using all these 3 filters for computing gradient and eventually finding the edges.

Some key points to be noted:

Image gradient is the building block of any edge detection algorithm.

We can manually find out the image gradient and the strength and orientation of the gradient.

We learned how to find the gradient and detect edges using different filters coded using OpenCV.

You're reading __Beginner’s Guide To Image Gradient__

## Beginner’s Guide To Using Nmap

nmap is a network scanning tool which can be used for a whole variety of network discovery tasks including port scanning, service enumeration and OS fingerprinting.

To install nmap on Ubuntu or Raspbian use:

sudo

apt-get install

nmap

For Linux versions that use yum, like Fedora, run this as root:

yum install

nmap

The simplest invocation is just to supply a hostname or IP address of a machine that you want to scan. nmap will then scan the machine to see which ports are open. For example:

nmap

192.168.1.101All TCP/IP connections use a port number to uniquely identify each network service. For example, web browser connections are made on port 80; emails are sent on port 25 and downloaded on port 110; secure shell connections are made on port 22; and so on. When nmap does a port scan, it shows which ports are open and able to receive connections. In turn, this indicates which services are running on the remote machine.

From a security point of view, the less services which are running on a host, the more secure it is. This is because there are less “holes” that an attacker can use to try and access the machine. It is also a useful way to perform a preliminary check to see if a service is running (and accepting connections). A quick scan of my Ubuntu server looks like this:

To discover which software is providing the server behind each of the open ports use the -sV option:

nmap

-sV

192.168.1.101Here are the results from a Raspberry Pi:

nmap has correctly discovered that the OpenSSH server is being used to provide a SSH service on the Pi. The tool also notes that the Pi is running Linux!

sudo

nmap

-O

192.168.1.43Here is the output from a scan performed against a Windows XP machine:

If you want to scan more than one host at a time, nmap allows you to specify multiple addresses or use address ranges. To scan more than one host just add extra addresses to the parameter list (with each one separated by a SPACE). For example to scan for open ports on 192.168.1.1, 192.168.1.4 and 192.168.1.43, use:

nmap

192.168.1.1 192.168.1.4 192.168.1.43To specify an address range use the dash symbol. For example to scan the first five hosts on your network you could use:

nmap

192.168.1.1-5

The output would look something like this:

The first host found is the router supplied by my Internet Service Provider (on address 192.168.1.1) and the second one is my Raspberry Pi (on 192.168.1.4).

Cookbook and summaryTo check if a specific port is open use -p followed by the port number or the port name, for example:

nmap

-p

ssh

192.168.1.4It can be combined with the -sV flag to determine the version of the software attached to that port:

nmap

-p

ssh

-sV

192.168.1.4To discover which hosts are alive on your network use the -sn flag. This will just ping the hosts specified in the address range. For example:

nmap

-sn

192.168.1.1-254

As a closing word of warning, don’t run scans against hosts that you don’t control or have permission to scan. Excessive scanning can be interpreted as an attack or could disrupt services unnecessarily.

Image credit: fiber Network Server by BigStockPhoto

Gary Sims

Gary has been a technical writer, author and blogger since 2003. He is an expert in open source systems (including Linux), system administration, system security and networking protocols. He also knows several programming languages, as he was previously a software engineer for 10 years. He has a Bachelor of Science in business information systems from a UK University.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Sign up for all newsletters.

By signing up, you agree to our Privacy Policy and European users agree to the data transfer policy. We will not share your data and you can unsubscribe at any time.

## The Beginner’s Guide To Smartphone Camera

But Why Not Get a Good Standalone Camera Instead?The whole “smartphone vs. camera” debate has been raging ever since high-end back-lit CMOS cameras started appearing on regular phones. So, what’s better?

The answer is: It really doesn’t matter. All of it depends on the reasons you might want to get a phone with a good camera as opposed to a piece of hardware completely dedicated to taking photographs. People who are serious about photography might get a decent DSLR camera, but still might want to dump some cash on a smartphone with good optics simply because it’s less bulky. You might not be carrying your bulky rig with all its attachable lens around when a great photo opportunity presents itself. In those cases, it’s very useful to have a powerful camera in your pocket.

You just can’t drag all of this around every time you walk out of your house:

What Makes a Phone’s Camera “Good?”If a phone doesn’t give you any information about its aperture or focal length, you have no way of telling whether it has a camera that meets your liking. Usually, phones that don’t show any indication in their specs other than the resolution are not putting any priority on their cameras.

Since you’re limited to whatever optical specifications the manufacturer provides for your lens, it’s not a bad idea to try to find something that suits your liking and provides the optical experience you are accustomed to taking pictures with.

For people who are not experienced with cameras, here are a few pointers:

A bigger focal length means that you’ll cover less area in the picture. The simplest way to describe focal length is by comparing it to zoom. The higher the focal length, the more “zoomed” the camera is. Smaller focal lengths mean you’ll have wider angles. Nikon has a decent guide on this if you’d like to know more in-depth information. Focal lengths are measured in millimeters. The typical optics on a phone have somewhere between 20 and 30 mm of focal length.

The aperture (focal ratio) determines how much light enters the camera. This ratio is notated with a fancy-looking italic lowercase “F”, known as an “f-number”. A higher f-number represents a smaller aperture, which captures more light. This is important for special shots that put objects in focus. For example, compare the two images below:

The top image is taken using a small aperture, and the bottom image is taken using a large one. On some phone cameras, the shutter will take care of this by moving ever so slightly just before taking a picture to modify the aperture. Similarly, focal length is also adjusted through optical zoom.

Ultimately, a good smartphone camera will have all these things. It will have the ability to zoom by moving the optics (adjusting the focal length) and change the aperture with a mechanical shutter. Since the cameras are digital, there has to be a decent on-board backlit CMOS sensor to construct these images with great accuracy. After all that, you can worry about resolution. But, anyway, a good camera will also have a decent resolution, althoug you shouldn’t make a big fuss about anything more than 5 megapixels.

Examples of Good Smartphone CamerasThe first thing that comes to mind as far as cameras are concerned is the Nokia Lumia 1020, with its brilliant 41-megapixel camera, its special software, and its spectacular CMOS and optics. There’s also the Samsung Galaxy S4 Zoom (a phone with an integrated full-blown PAS – point-and-shoot – camera), and the regular S4. The HTC One and iPhone 5S are close runners up.

Let’s Continue This Discussion!Miguel Leiva-Gomez

Miguel has been a business growth and technology expert for more than a decade and has written software for even longer. From his little castle in Romania, he presents cold and analytical perspectives to things that affect the tech world.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Sign up for all newsletters.

By signing up, you agree to our Privacy Policy and European users agree to the data transfer policy. We will not share your data and you can unsubscribe at any time.

## A Beginner’s Guide Bayesian Inference

This article was published as a part of the Data Science Blogathon.

Introduction

Classical

Frequentist

Bayesian

Let’s understand the differences among these 3 approaches with the help of a simple example.

Suppose we’re rolling a fair six-sided die and we want to ask what is the probability that the die shows a four? Under the Classical framework, all the possible outcomes are equally likely i.e., they have equal probabilities or chances. Hence, answering the above question, there are six possible outcomes and they are all equally likely. So, the probability of a four on a fair six-sided die is just 1/6. This Classical approach works well when we have well-defined equally likely outcomes. But when things get a little subjective then it may become a little complex.

On the other hand, Frequentist definition requires us to have a hypothetical infinite sequence of a particular event and then to look at the relevant frequency in that hypothetical infinite sequence. In the case of rolling a fair six-sided die, if we roll it for the infinite number of times then 1/6th of the time, we will get a four and hence, the probability of rolling four in a six-sided die will be 1/6 under frequentist definition as well.

Now if we proceed a little further and ask if our die is fair or not. Under frequentist paradigm, the probability is either zero when it’s not a fair die and one if it is a fair die because under frequentist approach everything is measured from a physical perspective and hence, the die can be either fair or not. We cannot assign a probability to the fairness of the die. Frequentists are very objective in how they define probabilities but their approach cannot give intuitive answers for some of the deeper subjective issues.

Bayesian perspective allows us to incorporate personal belief/opinion into the decision-making process. It takes into account what we already know about a particular problem even before any empirical evidence. Here we also have to acknowledge the fact my personal belief about a certain event may be different than others and hence, the outcome that we will get using the Bayesian approach may also be different.

For example, I may say that there is a 90% probability that it will rain tomorrow whereas my friend may say I think there is a 60% chance that it will rain tomorrow. So inherently Bayesian perspective is a subjective approach to probability, but it gives more intuitive results in a mathematically rigorous framework than the Frequentist approach. Let’s discuss this in detail in the following sections.

What is Bayes’ Theorem?Simplistically, Bayes’ theorem can be expressed through the following mathematical equation

Now let’s focus on the 3 components of the Bayes’ theorem

• Prior

• Likelihood

• Posterior

• Prior Distribution – This is the key factor in Bayesian inference which allows us to incorporate our personal beliefs or own judgements into the decision-making process through a mathematical representation. Mathematically speaking, to express our beliefs about an unknown parameter θ we choose a distribution function called the prior distribution. This distribution is chosen before we see any data or run any experiment.

How do we choose a prior? Theoretically, we define a cumulative distribution function for the unknown parameter θ. In basic context, events with the prior probability of zero will have the posterior probability of zero and events with the prior probability of one, will have the posterior probability of one. Hence, a good Bayesian framework will not assign a point estimate like 0 or 1 to any event that has already occurred or already known not to occur. A very handy widely used technique of choosing priors is using a family of distribution functions that is sufficiently flexible such that a member of the family will represent our beliefs. Now let’s understand this concept a little better.

i. Conjugate Priors – Conjugacy occurs when the final posterior distribution belongs to the family of similar probability density functions as the prior belief but with new parameter values which have been updated to reflect new evidence/ information. Examples Beta-Binomial, Gamma -Poisson or Normal-Normal.

ii. Non-conjugate Priors –Now, it is also quite possible that the personal belief cannot be expressed in terms of a suitable conjugate prior and for those cases simulation tools are applied to approximate the posterior distribution. An example can be Gibbs sampler.

iii. Un-informative prior – Another approach is to minimize the amount of information that goes into the prior function to reduce the bias. This is an attempt to have the data have maximum influence on the posterior. These priors are known as uninformative Priors but for these cases, the results might be pretty similar to the frequentist approach.

• Likelihood – Suppose θ is the unknown parameter that we are trying to estimate. Let’s represent fairness of a coin with θ. Now to check the fairness, we are flipping a coin infinitely and each time it is either appearing as ‘head’ or ‘tail’ and we are assigning a 1 or 0 value accordingly. This is known as the Bernoulli Trials. Probability of all the outcomes or ‘X’s taking some value of x given a value of theta. We’re viewing each of these outcomes as independent and hence, we can write this in product notation. This is the probability of observing the actual data that we collected (head or tail), conditioned on a value of the parameter theta (fairness of coin) and can be expressed as follows-

This is the concept of likelihood which is the density function thought of as a function of theta. To maximize the likelihood i.e., to make the event most likely to occur for the data we have, we will choose the theta that will give us the largest value of the likelihood. This is referred to as the maximum likelihood estimate or MLE. Additionally, a quick reminder is that the generalization of the Bernoulli when we have N repeated and independent trials is a binomial. We will see the application later in the article.

Mechanism of Bayesian Inference:The Bayesian approach treats probability as a degree of beliefs about certain event given the available evidence. In Bayesian Learning, Theta is assumed to be a random variable. Let’s understand the Bayesian inference mechanism a little better with an example.

Inference example using Frequentist vs Bayesian approach: Suppose my friend challenged me to take part in a bet where I need to predict if a particular coin is fair or not. She told me “Well; this coin turned up ‘Head’ 70% of the time when I flipped it several times. Now I am giving you a chance to flip the coin 5 times and then you have to place your bet.” Now I flipped the coin 5 times and Head came up twice and tail came up thrice. At first, I thought like a frequentist.

So, θ is an unknown parameter which is a representation of fairness of the coin and can be defined as

θ = {fair, loaded}

Additionally, I assumed that the outcome variable X (whether head or tail) follows Binomial distribution with the following functional representation

Now in our case n=5.

Now my likelihood function will be

Now, I saw that head came up twice, so my X =2.

= 0.13 if θ =loaded

Therefore, using the frequentist approach I can conclude that maximum likelihood i.e., MLE (theta hat) = fair.

Now comes the tricky part. If the question comes how sure am I about my prediction? I will not be able to answer that question perfectly or correctly as in a frequentist world, a coin is a physical object and hence, my probability can be either 0 or 1 i.e., the coin is either fair or not.

Therefore, my prior P(loaded)=0.9. I can now update my prior belief with data and get the posterior probability using Bayes’ Theorem.

My numerator calculation will be as follows-

The denominator is a constant and can be calculated as the expression below. Please note that we are here basically summing up the expression over all possible values of θ which is only 2 in this case i.e., fair or loaded.

Hence, after replacing X with 2 we can calculate the Bayesian probability of the coin being loaded or fair. Do it yourself and let me know your answer! However, you will realize that this conclusion contains more information to make a bet than the frequentist approach.

Application of Bayesian Inference in financial risk modeling:Bayesian inference has found its application in various widely used algorithms e.g., regression, Random Forest, neural networks, etc. Apart from that, it also gained popularity in several Bank’s Operational Risk Modelling. Bank’s operation loss data typically shows some loss events with low frequency but high severity. For these typical low-frequency cases, Bayesian inference turns out to be useful as it does not require a lot of data.

Earlier, Frequentist methods were used for operational risk models but due to its inability to infer about the parameter uncertainty, Bayesian inference was considered to be more informative as it has the capacity of combining expert opinion with actual data to derive the posterior distributions of the severity and frequency distribution parameters. Generally, for this type of statistical modeling, the bank’s internal loss data is divided into several buckets and the frequencies of each bucket loss are determined by expert judgment and then fitted into probability distributions.

Hello! I am Ananya. I have a degree in Economics and I have been working as a financial risk analyst for the last 5 years. I am also a voracious reader of Data Science Blogs just as you are. This is my first article for Analytics Vidhya. Hope you found this article useful.

The media shown in this article are not owned by Analytics Vidhya and is used at the Author’s discretion.

Related

## Understanding Neural Network: A Beginner’s Guide

The term “neural network” is derived from the work of a neuroscientist, Warren S. McCulloch and Walter Pitts, a logician, who developed the first conceptual model of an artificial neural network. In their work, they describe the concept of a neuron, a single cell living in a network of cells that receives inputs, processes those inputs, and generates an output. In the computing world, neural networks are organized on layers made up of interconnected nodes which contain an activation function. These patterns are presented to the network through the input layer which further communicates it to one or more hidden layers. The hidden layers perform all the processing and pass the outcome to the output layer.

Neural networks are typically used to derive meaning from complex and non-linear data, detect and extract patterns which cannot be noticed by the human brain. Here are some of the standard applications of neural network used these days. # Pattern/ Image or object recognition # Times series forecasting/ Classification # Signal processing # In self-driving cars to manage control # Anomaly detection These applications fall into different types of neural networks such as convolutional neural network, recurrent neural networks, and feed-forward neural networks. The first one is more used in image recognition as it uses a mathematical process known as convolution to analyze images in non-literal ways. Let’s understand neural network in R with a dataset. The dataset consists of 724 observations and 7 variables. “Companies.Changed” , “Experience.Score”, “Test.Score”, “Interview.Score”, “Qualification.Index”, “age”, “Status” The following codes runs the network classifying ‘Status’ as a function of several independent varaibles. Status refers to recruitment with two variables: Selected and Rejected. To go ahead, we first need to install “neuralnet” package >library(neuralnet) >HRAnalytics<-read.csv(“filename.csv”) > temp<-HRAnalytics Now, removing NA from the data > temp <-na.omit(temp) > dim(temp) # 724 rows and 7 columns) [1] 724 7 > y<-( temp$Status ) # Assigning levels in the Status Column > levels(y)<-c(-1,+1) > class(y) [1] “factor” # Now converting the factors into numeric > y<-as.numeric (as.character (y)) > y <-as.data.frame(y) > names(y)<-c(“Status”) Removing the existing Status column and adding the new one Y > temp$ Status <-NULL > temp <-cbind(temp ,y) > temp <-scale( temp ) > chúng tôi (100) > n=nrow( temp ) The dataset will be split up in a subset used for training the neural network and another set used for testing. As the ordering of the dataset is completely random, we do not have to extract random rows and can just take the first x rows. > train <- sample (1:n, 500, FALSE) > f<- Status ~ Companies.Changed+Experience.Score+Test.Score+Interview.Score+Qualification.Index+age Now we’ll build a neural network with 3 hidden nodes. We will Train the neural network with backpropagation. Backpropagation refers to the backward propagation of error. > fit <- neuralnet (f, data = temp [train ,], hidden =3, algorithm = “rprop+”) Plotting the neural network > plot(fit, intercept = FALSE ,show.weights = TRUE)

The above plot gives you an understanding of all the six input layers, three hidden layers, and the output layer. > z<-temp > z<-z[, -7] The compute function is applied for computing the outputs based on the independent variables as inputs from the dataset. Now, let’s predict on testdata (-train) > pred <- compute (fit, z[-train,]) > sign(pred$net.result ) Now let’s create a simple confusion matrix: > table(sign(pred$net.result),sign( temp[-train ,7])) -1 1 -1 108 20 1 36 60 (108+60)/(108+20+36+60) [1] 0.75 Here, the prediction accuracy is 75% I hope the above example helped you understand how neural networks tune themselves to find the right answer on their own, increasing the accuracy of the predictions. Please note that the acceptable level of accuracy is considered to be over 80%. Unlike any other technique, neural networks also have certain limitations. One of the major limitation is that the data scientist or analyst has no other role than to feed the input and watch it train and gives the output. One of the article mentions that “with backpropagation, you almost don’t know what you’re doing”. If we just ignore the negatives, neural network has huge application and is a promising and practical form of machine learning. In the recent times, the best-performing artificial-intelligence systems in areas such as autonomous driving, speech recognition, computer vision, and automatic translation are all aided by neural networks. Only time will tell, how this field will emerge and offer intelligent solutions to problems we still have not thought of.

## How To Stream With One Monitor (Beginner’s Guide)

Streaming your content on the internet has become more popular nowadays. One of the main reasons for its growing popularity is the fact that streamers and viewers can interact with one another mid-stream.

However, managing the stream along with its various features and settings can sure feel a bit overwhelming, and much so if you are doing it through a single monitor.

Streamers usually prefer setting up multiple monitors as that extra screen canvas does make the job a lot easier. Nevertheless, there is no limit on how many monitors you choose for the streaming purpose.

Although a single-screen stream setup makes it somewhat harder for you to manage your chats, notifications, and whatnot, it is still possible to achieve this feat efficiently.

So, if you are an up-and-coming streamer or even if you are not new to the game, this guide shall help make the most out of your single monitor whilst the stream cam is on. So, before we waste any more time, let’s begin!

Is It Possible to Stream With One Monitor?To put it simply, it is possible to stream using only one monitor. However, the experience of doing so is comparatively worse than streaming with multiple screens.

You as a streamer mainly need to manage your stream, the chatbox, and the in-app settings when you go live. Switching between windows to check your stream status is impossible and unprofessional. It breaks the engagement with the viewers while making the content feel clunky and mismanaged.

However, there are various hacks and workarounds you can follow to manage your single monitor streaming service a bit more efficiently.

How to Stream With One MonitorThe main difficulty while streaming with one monitor arises when you have to manage your stream status and read your viewers’ messages. So, that’s exactly what we are going to work on. Using the workarounds shown below, you can manage these things effectively to ultimately up to your game streaming.

Set Up Your StreamSingle screen streaming is a bit different than streaming via multiple monitors. So, the streaming application’s settings must be altered in a way that shall provide the most efficient output for a single monitor.

Hence, before we begin to understand how you can manage your stream on a single monitor, let’s skim past the ways to set up your stream on a single screen. So, we’ll use the OBS studio live streaming software as a reference. Here are the steps to set up your stream for a single monitor:

And voila! The stream has been set up and you are now ready to use some workarounds to make your single-screen streaming service more effective.

Use Other Devices as a Secondary ScreenA second monitor sure does help. But since it’s out of the question, you can make use of any other devices lying around the house.

Let’s take your phone for example. You can stream from your computer and also run your stream link to open the stream on your mobile phone. This way, you can use the mobile phone to read and reply to your viewers’ messages.

Additionally, through a secondary device, you can check the status of your stream and determine if it’s running well or not. Basically, stream as a first-person and view the status as a third person. So, you can use your laptop, mobile phone, or your tablet as a second screen.

Run Your Applications on Windowed ModeSome games and applications allow you to run it in windowed mode. That is, without going full-screen, you can part your screen to run the application on one side and the chatbot/donation alerts on the other.

Keep in mind that this method doesn’t work with all applications and for the ones that do support this feature, it is a gamechanger. Although the chatbot might end up taking around a quarter of your screen space, you can still stream efficiently while staying active in your followers’ discussions.

So, run your application on windowed mode, pop out and resize the chatbox from your streaming platform, and screen record only the game window.

Turn on Your NotificationsAnother way you can make your single-screen streaming job a lot easier is by turning on the notifications.

These popped-up alerts provide you with a good idea regarding where the chat is headed towards. You can then read and respond to the message via the notifications on the side of your screen. Here’s how you can turn on the app notifications on your computer.

For Windows

For Mac

Use Third-party ApplicationsThere are various third-party applications available online that can help you easily manage your streams via a single monitor. The core idea is to overlay your chats, donations, and other required windows and adjust their opacities to be able to view them whilst the stream cam is on.

Although we never recommend using third-party applications, these applications sure do help. Out of infinite applications on the internet, we are going to talk briefly about a couple of them. Keep in mind that, from our research, we found these to be some of the best overlay applications available and none of them are our sponsorship deals.

StreamLabsThe StreamLabs Games Overlay application helps you view your chats and events on your screen while the streamed application is running in the background. So, to make use of StreamLabs,

You can now use the shortcut keys assigned earlier to bring up the chat and event windows while streaming. Keep in mind that some games may not support this feature while streaming in full-screen mode.

OBS StudioThe OBS studio has a feature called ‘Popout chat’ that lets you view the chatbox while you are streaming from the same window. So, to set this feature,

Update the detailed information about **Beginner’s Guide To Image Gradient** on the Achiashop.com website. We hope the article's content will meet your needs, and we will regularly update the information to provide you with the fastest and most accurate information. Have a great day!