Data

In data science, data is either categorical or continuous form or data source as per video, everything which can be recorded has been data.

Outliers: When we collect or buy any data, we fill it with data that is beyond the minimum data value or maximum data value, and we call it outlier.

Outliers and Their Treatment

Outliers

Outliers are data points that deviate significantly from the rest of the dataset, results and affecting the performance of machine learning models. Properly identifying and treating outliers is essential for maintaining the integrity of data analysis.

How to Treat?

Looking at Graphs

Math-Based Methods

Treatment of Outliers

Example

I have taken a dataset from Kaggle which is weather-anomalies-1964-2013, this is the complete weather data, I have shown it by removing all the outliers.

To access the data set or to install python libraries on it, we can use online tools like Google Coleb or Anaconda's Jupiter notebook.

Step 1. Import All needfull Library or dateset.

In this I have installed Python's needful Library and also we will read our CSV file using Pandas.

CSV file

Step 2. Now we will read all the information of the file.

Since we have taken this data from Kaggle, we do not need to purify it, we do not have to complete all the setup steps, then we can work on the data.

Kaggle

Step 3. In the same way we will see its characteristics like Mean or median.

PRINT

Step 4. We will plot our data and from the histogram and box plot we will know which column is our outlier data.

Outlier data

Step 5. Now we will apply Perrotlier's methods to the data such as IQR and Z Score our data is in mathematical form.

IQR

Step 6. We will print the data that has been filtered and will also print the calculated value along with it.

Calculated value

Step 7. After initializing the data, we have initialized the model or printed it to see how many outliers we have removed and then run a poll to check that we do not have any outlier data left.

Outlier data left

Conclusion

Effectively managing outliers is critical for ensuring accurate data analysis and improving model performance in machine learning. The choice of detection and treatment methods should consider the nature of the data, the context of analysis, and specific project goals. By applying appropriate techniques, analysts can enhance data quality and derive more meaningful insights from their datasets.