Found 10784 Articles for Python

Comparing and Managing Names Using name-tools module in Python

Niharika Aitam
Updated on 07-Aug-2023 17:05:16

69 Views

The name-tools module is a python library which provides us the tools to work with the names. These are used in many applications likely data cleaning, text processing and Natural Language Processing etc. It has a several functions for comparing and managing the names. Installing name-tools Before working with the name-tools, we need to install it in the python environment. The following is the process for installing the name-tools. pip install name-tools After executing the above code, if you see the text below, then the installation is considered successful. Collecting name-toolsNote: you may need to restart the kernel ... Read More

Welch’s T-Test in Python

Jaisshree
Updated on 07-Aug-2023 15:43:10

309 Views

Python is a powerful language to be used for performing various statistical tests. One such statistical test is the Welch’s t-test. When there are two datasets with equal variances and you have to find out whether their means are the same or not, then using a two sample t-test would be wise enough. However, if the variances of the two datasets are not the same, then Welch’s t-test should be used to compare the means. Syntax stats.ttest_ind(dataset_one, dataset_two, equal_var = False/True) Here, ttest_ind is the function that performs Welch’s t-test. It takes three parameters, The first ... Read More

Encoding and Decoding Base64 Strings in Python

Swatantraveer Arya
Updated on 07-Aug-2023 15:33:13

6K+ Views

Encoding and decoding Base64 strings is a common task in Python programming. Base64 encoding is used to convert binary data into a format that can be transmitted over the internet, while decoding is used to convert the Base64-encoded data back to its original format. In this article, we will explore how to encode and decode Base64 strings in Python, including the different methods and libraries available. Understanding Base64 Encoding Base64 encoding is a binary-to-text encoding scheme that represents binary data in an ASCII string format. It is often used to transmit data over the internet or store data in a ... Read More

TfLearn and its installation in TensorFlow

Jaisshree
Updated on 07-Aug-2023 15:32:28

92 Views

TFlearn is an open-source deep-learning library built on the TensorFlow framework. It provides a high-level API with which it is easy to create and train different neural network models. It provides an array of pre-existing models such as Convolutional Neural Network (CNN), Deep Neural Networks (DNN), and many other models. It also includes a variety of activation functions such as ReLU (Rectified Linear Units), softmax, and also loss functions such as categorical cross-entropy and so on. TfLearn is an ideal library for beginners due to not requiring extensive knowledge of Neural Network APIs in TensorFlow. It is a simple, easy-to-use ... Read More

Tensor Operations on PyTorch

Jaisshree
Updated on 07-Aug-2023 15:28:47

268 Views

PyTorch, an open-source machine learning framework, is widely used in academic research and industries. It offers ample tools and libraries to build and train neural networks effectively. Tensors in PyTorch In PyTorch, a tensor is a multidimensional array of values that can be used to represent data for machine learning models. Dimensions may vary as 1D, 2D, 3D, and so on, totally depending on the complexity of the data they represent. Let's take an example, a 1D tensor can be used to represent a sequence of values, such as time-series data, whereas a 2D tensor can be used to represent ... Read More

How To Connect and Run SQL Queries to a PostgreSQL Database from Python?

Mukul Latiyan
Updated on 07-Aug-2023 15:16:17

1K+ Views

PostgreSQL is a popular open−source relational database management system known for its robustness, scalability, and advanced features. Python provides excellent support for interacting with PostgreSQL databases, allowing developers to seamlessly connect and execute SQL queries. In this article, we will explore the step−by−step process of connecting to a PostgreSQL database from Python, running SQL queries, and retrieving results. We will provide code examples, explanations, and sample outputs to help you master this essential skill. In this article, we will learn how to connect and run SQL queries to a PostgreSQL database from Python. Step 1: Install the psycopg2 module The ... Read More

Singular Value Decomposition

Jaisshree
Updated on 07-Aug-2023 15:27:02

251 Views

Machine learning uses the mathematical approach of Singular value decomposition to comprehend huge and complicated data sets. In this mathematical approach, a Unique Valued matrix A is factorized into three matrices via decomposition. In terms of the components of A, the Singular value decomposition of matrix A can be written as A=UDVT. In this case, S denotes A's singular values, whereas U and V stand for A's left and right singular vectors, respectively. Mathematical Algorithm Given Matrix A find the Transpose of matrix A that is (AT). Find A*AT Find the Eigen Vector of A*AT ... Read More

Separating Planes In SVM

Jaisshree
Updated on 07-Aug-2023 15:24:30

72 Views

Support Vector Machine (SVM) is a supervised algorithm used widely in handwriting recognition, sentiment analysis and many more. To separate different classes, SVM calculates the optimal hyperplane that more or less accurately creates a margin between the two classes. Here are a few ways to separate hyperplanes in SVM. Data Processing − SVM requires data that is normalised, scaled and centred since they are sensitive to such features. Choose a Kernel − A kernel function is used to transform the input into a higher dimensional space. Some of them include linear, polynomial and radial base functions. Let ... Read More

How to Clean String Data in a Given Pandas DataFrame?

Mukul Latiyan
Updated on 07-Aug-2023 15:14:40

1K+ Views

Pandas is a Python library that is used for data analysis and manipulation. It provides a number of functions for cleaning and formatting data. In this article, we will learn how to clean string data in a given Pandas DataFrame. We will cover the following topics: Removing leading and trailing spaces Replacing special characters Converting to lowercase Removing duplicate values Splitting strings into columns Merging columns Validating data Removing Leading and Trailing Spaces The strip() method can be used to remove leading and trailing spaces from a string. For example, the following code will remove the leading ... Read More

Clustering Performance Evaluation in Scikit Learn

Mukul Latiyan
Updated on 07-Aug-2023 15:12:39

284 Views

Clustering is a fundamental unsupervised learning technique that aims to discover patterns or groupings in unlabeled data. It plays a crucial role in various domains such as data mining, pattern recognition, and customer segmentation. However, once clustering algorithms are applied, it becomes essential to evaluate their performance and assess the quality of the resulting clusters. Clustering performance evaluation is a critical step in understanding the effectiveness and reliability of clustering algorithms. It involves quantifying the quality of the obtained clusters and providing insights into their consistency and separability. By evaluating clustering results, practitioners can make informed decisions about algorithm selection, ... Read More

Advertisements