AmitDiwan has Published 10744 Articles

Delete array element in given index range [L – R] in C++?

AmitDiwan

AmitDiwan

Updated on 16-Jan-2021 06:58:22

567 Views

Let us first define the original array and the exclusive range for deletion of the array elements and also find the original array length −int arr[] = { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20}; int L = 2, R = 6; int length = sizeof(arr) / ... Read More

Delete an element from array using two traversals and one traversal in C++?

AmitDiwan

AmitDiwan

Updated on 16-Jan-2021 06:48:41

107 Views

Two Traversals Let us first define the original array and the element to be searched and deleted from the array −int ele = 5; int arr = [1,2,3,4];Now we loop in the array to find the given element −for (i=0; i

Set user-defined variable with table name in MySQL prepare statement?

AmitDiwan

AmitDiwan

Updated on 05-Jan-2021 06:41:34

2K+ Views

Let us first create a table −mysql> create table DemoTable (    StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    StudentName varchar(20) ); Query OK, 0 rows affected (0.71 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(StudentName) values('Chris'); Query OK, 1 row affected (0.21 sec) ... Read More

Discuss broadcasting in Numpy in Python?

AmitDiwan

AmitDiwan

Updated on 11-Dec-2020 11:34:09

174 Views

NumPy refers to ‘Numerical’ ‘Python’. It is a library that contains multidimensional array objects and multiple methods that help in processing the arrays.NumPy can be used to perform a wide variety of operations on arrays. It is used in conjunction with packages like SciPy, Matplotlib and so on. NumPy+Matplotlib can ... Read More

How can a specific tint be added to grayscale images in scikit-learn in Python?

AmitDiwan

AmitDiwan

Updated on 11-Dec-2020 11:33:00

362 Views

The values of ‘R’, ‘G’, and ‘B’ are changed and applied to the original image to get the required tint.Below is a Python program that uses scikit-learn to implement the same. Scikit-learn, commonly known as sklearn is a library in Python that is used for the purpose of implementing machine ... Read More

What is hysteresis thresholding? How can it be achieved using scikit-learn in Python?

AmitDiwan

AmitDiwan

Updated on 11-Dec-2020 11:31:58

2K+ Views

Hysteresis refers to the lagging effect of a result. With respect to threshold, hysteresis refers to the areas that are above a specific low threshold value or above high threshold values. It refers to areas that are highly-confident in nature.With the help of hysteresis, the noise outside the edges of ... Read More

How can scikit learn library be used to upload and view an image in Python?

AmitDiwan

AmitDiwan

Updated on 11-Dec-2020 11:30:33

362 Views

Pre-processing data refers to cleaning of data, removing invalid data, noise, replacing data with relevant values and so on. This doesn’t always mean text data; it could also be images or video processing as well.Data pre-processing basically refers to the task of gathering all the data (which is collected from ... Read More

What are the different kinds of gradient descent algorithms in Machine Learning?

AmitDiwan

AmitDiwan

Updated on 11-Dec-2020 11:29:06

748 Views

The idea behind using gradient descent is to minimize the loss when in various machine learning algorithms. Mathematically speaking, the local minimum of a function is obtained.To implement this, a set of parameters are defined, and they need to be minimized. Once the parameters are assigned coefficients, the error or ... Read More

How can a polynomial regression model be fit to understand non-linear trends in data in Python?

AmitDiwan

AmitDiwan

Updated on 11-Dec-2020 11:01:35

176 Views

When regression models are being built, multicollinearity is checked for. This is because we need to understand the correlation present between all different combinations of continuous variables. If multicollinearity exists between the variables, we have to make sure that it is removed from the data.The data in real world is ... Read More

How can SciPy be used to calculate the permutations and combination values in Python?

AmitDiwan

AmitDiwan

Updated on 11-Dec-2020 11:00:27

664 Views

SciPy can be used to determine the permutation and combination with respect to two values.A function named ‘perm’ present in the class ‘special’ in ‘SciPy’ is used.Syntax of ‘perm’ functionscipy.special.perm(N, k)Performing permutation on a set of values has been shown belowExample Live Demofrom scipy.special import perm my_permute = perm(6, 2, exact ... Read More

Advertisements