Found 1354 Articles for Open Source

Freeware v/s Shareware

sudhir sharma
Updated on 01-Feb-2022 10:25:12

7K+ Views

Softwares are a set of programs that are created in order to perform a specific computer task. Generally, the software is created by developers to solve the needs of its users. And based on the restrictions that are imposed on software. Basically, there are a few categories based on licensing. Here, we will compare two types: Freeware and Shareware.Freeware SoftwareThese softwares are the softwares that are available to the users free of cost to use and distribute. The source code of the software is not available to use and cannot be modified.Shareware SoftwareThese softwares are the softwares that are initially ... Read More

What are Alternative Ways to Reverse a String from Shell?

Prateek Jangid
Updated on 29-Nov-2021 10:51:44

615 Views

In the Linux shell, we have predefined commands to return a reversed string. Anyone can use these commands for reversing an output of the program.Perl CommandIt is a general-purpose programming language in Linux.Inputperl -ne 'chomp;print scalar reverse . "";'

How to Reverse a String using Unix Shell Programming?

Prateek Jangid
Updated on 29-Nov-2021 10:46:19

11K+ Views

Bash is a shell or command line interpreter. It is a layer programming language that understands and executes the command that a user enters or can read commands from a script. Essentially Bash or Shell allows users of Unix-like systems and Windows via a Windows subsystem for Linux to control the innermost components of the Operating system using text-based commands.In this article, we will discuss a problem to be solved by Shell scripting. We are given a String, and we need to print the reverse of that string using Shell Programming. For example, Input : str = “ Hello ” ... Read More

Resetting a Root Password in Linux without External Media

Prateek Jangid
Updated on 26-Nov-2021 06:56:45

498 Views

Discuss how to recover the root password of Linux without using any external media. The version of Linux we are working with is CentOS version 8.2. Still, the procedures we will see can work with any Linux distro and many others. You may find that it doesn’t work with some Debian-based distro.To do this exercise, you should have the following requisites Prerequisites −Willingness to work in the Linux command line environment.Physical access to the Linux server(it cannot do this across a network).Procedures to follow to change the root passwordRestart the computer and interrupt the boot process at the grub screen ... Read More

Which function of scipy.cluster.vq module is used to assign codes from a code book to observations?

Gaurav Kumar
Updated on 24-Nov-2021 08:02:10

196 Views

Before implementing k-means algorithms, the scipy.cluster.vq.vq(obs, code_book, check_finite = True) used to assign codes to each observation from a code book. It first compares each observation vector in the ‘M’ by ‘N’ obs array with the centroids in the code book. Once compared, it assigns the code to the closest centroid. It requires unit variance features in the obs array, which we can achieve by passing them through the scipy.cluster.vq.whiten(obs, check_finite = True)function.ParametersBelow are given the parameters of the function scipy.cluster.vq.vq(obs, code_book, check_finite = True) −obs− ndarrayIt is an ‘M’ by ‘N’ array where each row is an observation, and ... Read More

Which function of scipy.cluster.vq module is used to normalize observations on each feature dimension?

Gaurav Kumar
Updated on 23-Nov-2021 13:23:51

153 Views

Before implementing k-means algorithms, it is always beneficial to rescale each feature dimension of the observation set. The function scipy.cluster.vq.whiten(obs, check_finite = True)is used for this purpose. To give it unit variance, it divides each feature dimension of the observation by its standard deviation (SD).ParametersBelow are given the parameters of the function scipy.cluster.vq.whiten(obs, check_finite = True) −obs− ndarrayIt is an array, to be rescaled, where each row is an observation, and the columns are the features seen during each observation. The example is given below −obs = [[ 1., 1., 1.], [ 2., 2., 2.], ... Read More

How can we call the documentation for NumPy and SciPy?

Gaurav Kumar
Updated on 23-Nov-2021 13:15:28

220 Views

If you are unsure of how to use a particular function or variable in NumPy and SciPy, you can call for the documentation with the help of ‘?’. In Jupyter notebook and IPython shell we can call up the documentation as follows −ExampleIf you want to know NumPy sin () function, you can use the below code −import numpy as np np.sin?OutputWe will get the details about sin() function something like as follows −We can also view the source with the help of double question mark (??) as follows −import numpy as np np.sin??Similarly, if you want to see the ... Read More

Implementing K-means clustering of Diabetes dataset with SciPy library

Gaurav Kumar
Updated on 14-Dec-2021 08:59:17

846 Views

The Pima Indian Diabetes dataset, which we will be using here, is originally from the National Institute of Diabetes and Digestive and Kidney Diseases. Based on the following diagnostic factors, this dataset can be used to place a patient in ether diabetic cluster or non-diabetic cluster −PregnanciesGlucoseBlood PressureSkin ThicknessInsulinBMIDiabetes Pedigree FunctionAgeYou can get this dataset in .CSV format from Kaggle website.ExampleThe example below will use SciPy library to create two clusters namely diabetic and non-diabetic from the Pima Indian diabetes dataset.#importing the required Python libraries: import matplotlib.pyplot as plt import numpy as np from scipy.cluster.vq import whiten, kmeans, vq ... Read More

Implementing K-means clustering with SciPy by splitting random data in 3 clusters?

Gaurav Kumar
Updated on 14-Dec-2021 08:48:44

176 Views

Yes, we can also implement a K-means clustering algorithm by splitting the random data in 3 clusters. Let us understand with the example below −Example#importing the required Python libraries: import numpy as np from numpy import vstack, array from numpy.random import rand from scipy.cluster.vq import whiten, kmeans, vq from pylab import plot, show #Random data generation: data = vstack((rand(200, 2) + array([.5, .5]), rand(150, 2))) #Normalizing the data: data = whiten(data) # computing K-Means with K = 3 (3 clusters) centroids, mean_value = kmeans(data, 3) print("Code book :", centroids, "") print("Mean of Euclidean distances :", mean_value.round(4)) ... Read More

Implementing K-means clustering with SciPy by splitting random data in 2 clusters?

Gaurav Kumar
Updated on 14-Dec-2021 08:42:53

429 Views

K-means clustering algorithm, also called flat clustering, is a method of computing the clusters and cluster centers (centroids) in a set of unlabeled data. It iterates until we find the optimal centroid. The clusters, we might think of a group of data points whose inter-point distances are small as compared to the distances to the point outside of that cluster. The number of clusters identified from unlabeled data is represented by ‘K’ in K-means algorithm.Given an initial set of K centers, the K-means clustering algorithm can be done using SciPy library by executing by the following steps −Step1− Data point ... Read More

Advertisements