Posts

Showing posts with the label Missing Values

4. Data Preprocessing in Machine learning (Handling Missing values )

Image
4. Data Preprocessing in Machine learning (Handling Missing values) 1. Importing the libraries 2.Importing the Datasets Now we need to import the datasets which we have collected for our machine learning project. But before importing a  dataset, we need to set the current directory as a working directory. read_csv() function: Now to import the dataset, we will use read_csv() function of pandas library, which is used to read a csv file and  performs various operations on it. Using this function, we can read a csv file locally as well as through an URL. Handling Missing data: The next step of data preprocessing is to handle missing data in the datasets. If our dataset contains some missing  data , then it may create a huge problem for our machine learning model. Hence it is necessary to handle missing  values present in the dataset. Operating on Null Values Pandas treats None and NaN as essentially interchangeable for indicating missing or null values. To facilitate this  conven