Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles on Trending Technologies
Technical articles with clear explanations and examples
Program to find Nth Even Fibonacci Number in C++
In this problem, we are given an integer value N. Our task is to find Nth Even Fibonacci Number.Fibonacci Series generates subsequent number by adding two previous numbers. The Fibonacci series starts from two numbers − F0 & F1. The initial values of F0 & F1 can be taken 0, 1 or 1, 1 respectively.Let’s take an example to understand the problem, Input : N = 4 Output : 144Solution ApproachA simple solution to the problem is using the fact that every third number in the fibonacci sequence is even and the sequence of even numbers also follows the recursive ...
Read Morenumpy.matrix Method in Python
The numpy.matrix method is used to interpret a given input as a matrix. It returns a matrix from an array-like object. Its syntax is as follows −numpy.matrix(data, dtype=None, copy=bool)where, data - It is the input data.dtype - It represents the data type of the output matrix.copy - If the input data is already an ndarray, then this flag copy determines whether the data is to be copied (default behavior), or whether a view is to be constructed.Example 1Let us consider the following example −# import numpy library import numpy as np # matrix function y = np.matrix([[4, 5], [7, ...
Read Morenumpy.triu Method in Python
The numpy.triu() method can be used to get the upper triangle of an array. Its syntax is as follows −Syntaxnumpy.triu(m, k=0)where, m - number of rows in the array.k - It is the diagonal. Use k=0 for the main diagonal. k < 0 is below the main diagonal and k > 0 is above it.It returns a copy of the array after replacing all the elements above the kth diagonal with zero.Example 1Let us consider the following example −# import numpy library import numpy as np # create an input matrix x = np.matrix([[6, 7], [8, 9], [10, 11]]) ...
Read Morenumpy.vander Method in Python
The numpy.vander() method is used to generate a Vandermonde (Vander) matrix. A Vander matrix contains a geometric progression in each row, for example, $$\mathrm{A =\begin{bmatrix}1 & 2 & 4 \1 & 3 & 9 \1 & 5 &25\end{bmatrix} or\: B = \begin{bmatrix}1 & 4 & 16 \1 & 6 &36 \end{bmatrix}}$$SyntaxIts syntax is as follows −numpy.vander(x, N=None, increasing=False)ParametersIt accepts the following parameters −x - This is the input array.N - It is the number of columns in the output. By default, it is None.Increasing - If increasing=True, then the power increases from left to right. If increasing=False, then powers are ...
Read Morenumpy.tril Method in Python
We can use the numpy.tril() method to get the lower triangle of an array. Its syntax is as followsSyntaxnumpy.tril(m, k=0)where, m - number of rows in the array.k - It is the diagonal. Use k=0 for the main diagonal. k < 0 is below the main diagonal and k > 0 is above it.It returns a copy of the array after replacing all the elements above the k thdiagonal with zero.Example 1Let us consider the following example −# import numpy library import numpy as np # create an input matrix x = np.matrix([[20, 21, 22], [44 ,45, 46], [78, ...
Read Morenumpy.tri Method in Python
The numpy.tri method can be used to get an array of 1's at and below a given diagonal and 0's elsewhere.Syntaxnumpy.tri(N, M=None, k=0, dtype=)Parametersnumpy.tri accepts the following parameters −N - It defines the number of the rows in an array.M - It defines the number of columns in an array. By default, it is None.k - Use k = 0, for the main diagonal, while k < 0 is below it and k > 0 is above it.dtype - It is data type of the returned array. By default, it is float.Example 1Let us consider the following example −# import ...
Read MoreWhat is Outlier Detection?
An outlier is a data object that diverges essentially from the rest of the objects as if it were produced by several mechanisms. For the content of the demonstration, it can define data objects that are not outliers as “normal” or expected data. Usually, it can define outliers as “abnormal” data.Outliers are data components that cannot be combined in a given class or cluster. These are the data objects which have several behavior from the usual behavior of different data objects. The analysis of this kind of data can be important to mine the knowledge.Outliers are fascinating because they are ...
Read MoreWhat are the approaches of Unsupervised Discretization?
An attribute is discrete if it has an associatively small (finite) number of possible values while a continuous attribute is treated to have a huge number of possible values (infinite).In other term, a discrete data attribute can be viewed as a function whose range is a finite group while a continuous data attribute is a function whose range is an infinite completely ordered group, generally an interval.Discretization aims to decrease the number of possible values a continuous attribute takes by partitioning them into several intervals. There are two methods to the problem of discretization. One is to quantize every attribute ...
Read MoreWhat are Generalizing Exemplars?
Generalized exemplars are the rectangular scope of instance area, known as hyperrectangles because they are high-dimensional. When defining new instances it is essential to convert the distance function to enable the distance to a hyperrectangle to be computed.When a new exemplar is defined correctly, it is generalized by directly merging it with the nearest exemplar of a similar class. The nearest exemplar can be an individual instance or a hyperrectangle.In this method, a new hyperrectangle is generated that covers the previous and the new instance. The hyperrectangle is expanded to surround the new instance. Lastly, if the prediction is false ...
Read MoreWhat are Radial Basis Function Networks?
The popular type of feed-forward network is the radial basis function (RBF) network. It has two layers, not counting the input layer, and contrasts from a multilayer perceptron in the method that the hidden units implement computations.Each hidden unit significantly defines a specific point in input space, and its output, or activation, for a given instance based on the distance between its point and the instance, which is only a different point. The closer these two points, the better the activation.This is implemented by utilizing a nonlinear transformation function to modify the distance into a similarity measure. A bell-shaped Gaussian ...
Read More