Seaborn library helps in visualizing data. It comes with customized themes and a high level interface.Scatter plots provide limited information, since they only tell us about the distribution of values within a given category of data. We need to use a different technique if we wish to compare the data present within categories. This is where box plots come into play. It is a way in which the data distribution in the dataset can be understood with the help of quartiles.It consists of vertical lines that extend from the boxes. These extensions are known as whiskers. These whiskers talks about ... Read More
We will be using Seaborn. Seaborn is a library that helps in visualizing data. It comes with customized themes and a high-level interface. This interface helps in customizing and controlling the kind of data and how it behaves when certain filters are applied to it.The ‘stripplot’ function is used when atleast one of the variables is categorical. The data is represented in a sorted manner along one of the axes. But the disadvantage is that certain points get overlapped. This where the ‘jitter’ parameter has to be used to avoid the overlapping between variables.It adds some random noise to the ... Read More
Machine learning deals with creating models from data, and generalizing on never before seen data. The data provided to a machine learning model as input should be such that it should be understood by the system properly, so that it can interpret the data and produce results.Visualizing data is an important step since it helps understand what is going on in the data without actually looking at the numbers and performing complicated computations.This interface helps in customizing and controlling the kind of data and how it behaves when certain filters are applied to it. The ‘despine’ function can be used ... Read More
Machine learning deals with creating models from data, and generalizing on never before seen data. The data provided to a machine learning model as input should be such that it should be understood by the system properly, so that it can interpret the data and produce results.Seaborn is a library that helps in visualizing data. It comes with customized themes and a high-level interface. This interface helps in customizing and controlling the kind of data and how it behaves when certain filters are applied to it.Seaborn library contains an interface called ‘set_Style()’ that helps work with different styles. The theme ... Read More
The process of converting a range of values into standardized range of values is known as normalization. These values could be between -1 to +1 or 0 to 1. Data can be normalized with the help of subtraction and division as well.Let us understand how L2 normalization works. It is also known as ‘Least Squares’. This normalization modifies the data in such a way that the sum of the squares of the data remains as 1 in every row.Let us see how L2 normalization can be implemented using Scikit learn in Python −Exampleimport numpy as np from sklearn import preprocessing ... Read More
We will be using the Seaborn library, that helps in visualizing data.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 usually non-linear.We need to find mechanisms to fit such non-linear data to the model. We will be using Anscombe’s dataset to visualize this data. The ‘implot’ function is used with this non-linear data.Here’s the example −Exampleimport pandas as ... Read More
Sometimes, it may be required to mathematically compute the inverse of a matrix and use the result of the operation for other purposes. Below are the steps to manually find the inverse of a matrix.Calculate the value of ‘minors’In this calculation, the values of current row and column are ignored, and the determinant of the remaining values are found. The calculated minors are stored in a matrix.The next step is to find the cofactors, wherein the alternate sign of values in the ‘minors’ matrix are changed from ‘+’ to ‘-‘ and vice-versa.Next, the matrix is transposed, i.e the rows are ... Read More
Let us understand how the slicing operator ‘:’ can be used to access elements within a certain range.Example Live Demoimport pandas as pd my_data = [34, 56, 78, 90, 123, 45] my_index = ['ab', 'mn' ,'gh', 'kl', 'wq', 'az'] my_series = pd.Series(my_data, index = my_index) print("The series contains following elements") print(my_series) n = 3 print("Bottom 3 elements are :") print(my_series[n:])OutputThe series contains following elements ab 34 mn 56 gh 78 kl 90 wq 123 az 45 dtype: int64 Bottom 3 elements are : kl 90 wq 123 az 45 dtype: int64ExplanationThe required libraries are imported, and given alias names for ease ... Read More
The determinant value can be calculated on a matrix or on an array that has more than one dimension.It may sometimes be required to understand the marix/array better. This is where the determinant operation would be needed.SciPy offers a function named ‘det’ that is present in the ‘linalg’ class which is short for ‘Linear Algebra’.Syntax of ‘det’ functionscipy.linalg.det(matrix)The ‘matrix’ is the parameter that is passed to the ‘det’ function to find its determinant value.This function can be called by passing the matrix/array as an argument.In the above picture, assume that ‘a’, ‘b’, ‘c’ and ‘d’ are numeric values of a ... Read More
The process of converting a range of values into standardized range of values is known as normalization. These values could be between -1 to +1 or 0 to 1. Data can be normalized with the help of subtraction and division as well.Data fed to the learning algorithm as input should remain consistent and structured. All features of the input data should be on a single scale to effectively predict the values. But in real-world, data is unstructured, and most of the times, not on the same scale.This is when normalization comes into picture. It is one of the most important ... Read More