AmitDiwan has Published 10744 Articles

How can scikit learn library be used to preprocess data in Python?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2020 13:34:59

318 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. It is an important step in the machine learning pipeline.Data pre-processing basically refers to the task ... Read More

How to apply functions element-wise in a dataframe in Python?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2020 13:30:21

1K+ Views

It may sometimes be required to apply certain functions along the elements of the dataframe. All the functions can’t be vectorised. This is where the function ‘applymap’ comes into picture.This takes a single value as input and returns a single value as output.Example Live Demoimport pandas as pd import numpy as ... Read More

How can a specific operation be applied row wise or column wise in Pandas Python?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2020 13:28:19

397 Views

It may sometimes be required to apply certain functions along the axes of a dataframe. The axis can be specified, otherwise the default axis is considered as column-wise, where every column is considered as an array.If the axis is specified, then the operations are performed row-wise on the data.The ‘apply’ ... Read More

How can data be summarized in Pandas Python?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2020 13:27:07

137 Views

Lots of information about the data can be obtained by using different functions on it. But if we wish to get all information on the data, the ‘describe’ function can be used.This function will give information such as ‘count’, ‘mean’, ‘standard deviation’, the 25th percentile, the 50th percentile, and the ... Read More

How to find the standard deviation of specific columns in a dataframe in Pandas Python?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2020 13:25:13

7K+ Views

Standard deviation tells about how the values in the dataset are spread. They also tells how far the values in the dataset are from the arithmetic mean of the columns in the dataset.Sometimes, it may be required to get the standard deviation of a specific column that is numeric in ... Read More

How to get the mean of a specific column in a dataframe in Python?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2020 13:23:58

2K+ Views

Sometimes, it may be required to get the mean value of a specific column that is numeric in nature. This is where the ‘mean’ function can be used.The column whose mean needs to be computed can be indexed to the dataframe, and the mean function can be called on this ... Read More

How can decision tree be used to construct a classifier in Python?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2020 13:20:24

182 Views

Decision tree is the basic building block of the random forest algorithm. It is considered as one of the most popular algorithms in machine learning and is used for classification purposes. They are extremely popular because they are easy to understand.The decision given out by a decision tree can be ... Read More

Discuss how the sort function can be applied on NumPy arrays in Python?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2020 13:17:58

633 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 ... Read More

How to find contours of an image using scikit-learn in Python?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2020 13:16:32

1K+ Views

Scikit-learn, commonly known as sklearn is a library in Python that is used for the purpose of implementing machine learning algorithms. It is an open-source library hence it can be used free of cost. This library is built on Numpy, SciPy and Matplotlib libraries.The method of ‘marching squares’ is used ... Read More

How to view the pixel values of an image using scikit-learn in Python?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2020 13:15:04

717 Views

Data pre-processing basically refers to the task of gathering all the data (which is collected from various resources or a single resource) into a common format or into uniform datasets (depending on the type of data).Since real-world data is never ideal, there is a possibility that the data would have ... Read More

Advertisements