# Data-Purifier
A Python library for Automated Exploratory Data Analysis, Automated Data Cleaning and Automated Data Preprocessing For Machine Learning and Natural Language Processing Applications in Python.
[![PyPI version](https://badge.fury.io/py/data-purifier.svg)](https://badge.fury.io/py/data-purifier)
[![License](https://img.shields.io/pypi/l/ansicolortags.svg)](https://img.shields.io/pypi/l/ansicolortags.svg)
[![Python Version](https://img.shields.io/pypi/pyversions/data-purifier)](https://pypi.org/project/data-purifier/)
[![PyPi Downloads](https://static.pepy.tech/personalized-badge/data-purifier?period=total&units=international_system&left_color=black&right_color=orange&left_text=Downloads)](https://pepy.tech/project/data-purifier)
Table of Contents
- [Data-Purifier](#data-purifier)
- [Installation](#installation)
- [Get Started](#get-started)
- [Automated EDA for NLP](#automated-eda-for-nlp)
- [Automated Data Preprocessing for NLP](#automated-data-preprocessing-for-nlp)
- [Automated EDA for Machine Learning](#automated-eda-for-machine-learning)
- [Automated Report Generation for Machine Learning](#automated-report-generation-for-machine-learning)
- [Example](#example)
## Installation
**Prerequsites**
- [Anaconda](https://docs.anaconda.com/anaconda/install/)
To use Data-purifier, it's recommended to create a new environment, and install the required dependencies:
To install from PyPi:
```sh
conda create -n <your_env_name> python=3.6 anaconda
conda activate <your_env_name> # ON WINDOWS: `source activate <your_env_name>`
pip install data-purifier
python -m spacy download en_core_web_sm
```
To install from source:
```sh
cd <Data-Purifier_Destination>
git clone https://github.com/Elysian01/Data-Purifier.git
# or download and unzip https://github.com/Elysian01/Data-Purifier/archive/master.zip
conda create -n <your_env_name> python=3.6 anaconda
conda activate <your_env_name> # ON WINDOWS: `source activate <your_env_name>`
cd Data-Purifier
pip install -r requirements.txt
python -m spacy download en_core_web_sm
```
## Get Started
Load the module
```python
import datapurifier as dp
from datapurifier import Mleda, Nleda, Nlpurifier, MlReport
print(dp.__version__)
```
Get the list of the example dataset
```python
print(dp.get_dataset_names()) # to get all dataset names
print(dp.get_text_dataset_names()) # to get all text dataset names
```
Load an example dataset, pass one of the dataset names from the example list as an argument.
```python
df = dp.load_dataset("womens_clothing_e-commerce_reviews")
```
### Automated EDA for NLP
**Basic NLP**
* It will check for null rows and drop them (if any) and then will perform following analysis row by row and will return dataframe containing those analysis:
1. Word Count
2. Character Count
3. Average Word Length
4. Stop Word Count
5. Uppercase Word Count
Later you can also observe distribution of above mentioned analysis just by selecting the column from the dropdown list, and our system will automatically plot it.
* It can also perform `sentiment analysis` on dataframe row by row, giving the polarity of each sentence (or row), later you can also view the `distribution of polarity`.
**Word Analysis**
* Can find count of `specific word` mentioned by the user in the textbox.
* Plots `wordcloud plot`
* Perform `Unigram, Bigram, and Trigram` analysis, returning the dataframe of each and also showing its respective distribution plot.
**Code Implementation**
For Automated EDA and Automated Data Cleaning of NL dataset, load the dataset and pass the dataframe along with the targeted column containing textual data.
```python
nlp_df = pd.read_csv("./datasets/twitter16m.csv", header=None, encoding='latin-1')
nlp_df.columns = ["tweets","sentiment"]
```
**Basic Analysis**
For Basic EDA, pass the argument `basic` as argument in constructor
```python
eda = Nlpeda(nlp_df, "tweets", analyse="basic")
eda.df
```
**Word Analysis**
For Word based EDA, pass the argument `word` as argument in constructor
```python
eda = Nlpeda(nlp_df, "tweets", analyse="word")
eda.unigram_df # for seeing unigram datfarame
```
### Automated Data Preprocessing for NLP
* In automated data preprocessing, it goes through the following pipeline, and return the cleaned data-frame
1. Drop Null Rows
2. Convert everything to lowercase
3. Removes digits/numbers
4. Removes html tags
5. Convert accented chars to normal letters
6. Removes special and punctuation characters
7. Removes stop words
8. Removes multiple spaces
**Code Implementation**
Pass in the dataframe with the name of the column which you have to clean
```python
cleaned_df = NLAutoPurifier(df, target = "tweets")
```
**Widget Based Data Preprocessing**
* It provides following cleaning techniques, where you have to just tick the checkbox and our system will automatically perform the operation for you.
| Features | Features | Features |
| ------------------------------------------ | ------------------------------------- | -------------------------------- |
| Drop Null Rows | Lower all Words | Contraction to Expansion |
| Removal of emojis | Removal of emoticons | Conversion of emoticons to words |
| Count Urls | Get Word Count | Count Mails |
| Conversion of emojis to words | Remove Numbers and Alphanumeric words | Remove Stop Words |
| Remove Special Characters and Punctuations | Remove Mails | Remove Html Tags |
| Remove Urls | Remove Multiple Spaces | Remove Accented Characters |
* You can convert word to its base form by selecting either `stemming` or `lemmatization` option.
* Remove Top Common Word: By giving range of word, you can `remove top common word`
* Remove Top Rare Word: By giving range of word, you can `remove top rare word`
After you are done, selecting your cleaning methods or techniques, click on `Start Purifying` button to let the magic begins. Upon its completion you can access the cleaned dataframe by `<obj>.df`
**Code Implementation**
```python
pure = Nlpurifier(nlp_df, "tweets")
```
View the processed and purified dataframe
```python
pure.df
```
### Automated EDA for Machine Learning
* It gives shape, number of categorical and numerical features, description of the dataset, and also the information about the number of null values and their respective percentage.
* For understanding the distribution of datasets and getting useful insights, there are many interactive plots generated where the user can select his desired column and the system will automatically plot it. Plot includes
1. Count plot
2. Correlation plot
3. Joint plot
4. Pair plot
5. Pie plot
**Code Implementation**
Load the dataset and let the magic of automated EDA begin
```python
df = pd.read_csv("./datasets/iris.csv")
ae = Mleda(df)
ae
```
### Automated Report Generation for Machine Learning
Report contains sample of data, shape, number of numerical and categorical features, data uniqueness information, description of data, and null information.
```python
df = pd.read_csv("./datasets/iris.csv")
report = MlReport(df)
```
## Example
[Colab Notebook](https://colab.research.google.com/drive/1J932G1uzqxUHCMwk2gtbuMQohYZsze8U?usp=sharing)
Official Documentation: https://cutt.ly/CbFT5Dw
Raw data
{
"_id": null,
"home_page": "https://github.com/Elysian01/Data-Purifier",
"name": "data-purifier",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "automated eda exploratory-data-analysis data-cleaning data-preprocessing python jupyter ipython",
"author": "Abhishek Manilal Gupta",
"author_email": "abhig0209@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/98/d5/cca7ee1769fc5e3d95f18ced185da6a718d89161b1e1ede7d35730e88b1a/data-purifier-0.3.6.tar.gz",
"platform": null,
"description": "# Data-Purifier\n\nA Python library for Automated Exploratory Data Analysis, Automated Data Cleaning and Automated Data Preprocessing For Machine Learning and Natural Language Processing Applications in Python.\n\n[![PyPI version](https://badge.fury.io/py/data-purifier.svg)](https://badge.fury.io/py/data-purifier)\n[![License](https://img.shields.io/pypi/l/ansicolortags.svg)](https://img.shields.io/pypi/l/ansicolortags.svg) \n[![Python Version](https://img.shields.io/pypi/pyversions/data-purifier)](https://pypi.org/project/data-purifier/)\n[![PyPi Downloads](https://static.pepy.tech/personalized-badge/data-purifier?period=total&units=international_system&left_color=black&right_color=orange&left_text=Downloads)](https://pepy.tech/project/data-purifier)\n\n\n\nTable of Contents\n- [Data-Purifier](#data-purifier)\n - [Installation](#installation)\n - [Get Started](#get-started)\n - [Automated EDA for NLP](#automated-eda-for-nlp)\n - [Automated Data Preprocessing for NLP](#automated-data-preprocessing-for-nlp)\n - [Automated EDA for Machine Learning](#automated-eda-for-machine-learning)\n - [Automated Report Generation for Machine Learning](#automated-report-generation-for-machine-learning)\n - [Example](#example)\n\n\n## Installation\n\n**Prerequsites**\n\n- [Anaconda](https://docs.anaconda.com/anaconda/install/)\n\nTo use Data-purifier, it's recommended to create a new environment, and install the required dependencies:\n\nTo install from PyPi:\n\n```sh\nconda create -n <your_env_name> python=3.6 anaconda\nconda activate <your_env_name> # ON WINDOWS: `source activate <your_env_name>`\n\npip install data-purifier\npython -m spacy download en_core_web_sm\n```\n\nTo install from source:\n\n```sh\ncd <Data-Purifier_Destination>\ngit clone https://github.com/Elysian01/Data-Purifier.git\n# or download and unzip https://github.com/Elysian01/Data-Purifier/archive/master.zip\n\nconda create -n <your_env_name> python=3.6 anaconda\nconda activate <your_env_name> # ON WINDOWS: `source activate <your_env_name>`\ncd Data-Purifier\n\npip install -r requirements.txt\npython -m spacy download en_core_web_sm\n```\n\n## Get Started\n\nLoad the module\n```python\nimport datapurifier as dp\nfrom datapurifier import Mleda, Nleda, Nlpurifier, MlReport\n\nprint(dp.__version__)\n```\n\nGet the list of the example dataset \n```python\nprint(dp.get_dataset_names()) # to get all dataset names\nprint(dp.get_text_dataset_names()) # to get all text dataset names\n```\n\nLoad an example dataset, pass one of the dataset names from the example list as an argument.\n```python\ndf = dp.load_dataset(\"womens_clothing_e-commerce_reviews\")\n```\n\n\n\n### Automated EDA for NLP\n\n**Basic NLP**\n\n* It will check for null rows and drop them (if any) and then will perform following analysis row by row and will return dataframe containing those analysis:\n 1. Word Count \n 2. Character Count\n 3. Average Word Length\n 4. Stop Word Count\n 5. Uppercase Word Count\n\nLater you can also observe distribution of above mentioned analysis just by selecting the column from the dropdown list, and our system will automatically plot it.\n\n* It can also perform `sentiment analysis` on dataframe row by row, giving the polarity of each sentence (or row), later you can also view the `distribution of polarity`.\n\n**Word Analysis**\n\n* Can find count of `specific word` mentioned by the user in the textbox.\n* Plots `wordcloud plot`\n* Perform `Unigram, Bigram, and Trigram` analysis, returning the dataframe of each and also showing its respective distribution plot.\n\n**Code Implementation**\n\n\nFor Automated EDA and Automated Data Cleaning of NL dataset, load the dataset and pass the dataframe along with the targeted column containing textual data.\n\n```python\nnlp_df = pd.read_csv(\"./datasets/twitter16m.csv\", header=None, encoding='latin-1')\nnlp_df.columns = [\"tweets\",\"sentiment\"]\n```\n\n**Basic Analysis**\n\nFor Basic EDA, pass the argument `basic` as argument in constructor\n```python\neda = Nlpeda(nlp_df, \"tweets\", analyse=\"basic\")\neda.df\n```\n**Word Analysis**\n\nFor Word based EDA, pass the argument `word` as argument in constructor\n```python\neda = Nlpeda(nlp_df, \"tweets\", analyse=\"word\")\neda.unigram_df # for seeing unigram datfarame\n```\n\n\n### Automated Data Preprocessing for NLP\n\n* In automated data preprocessing, it goes through the following pipeline, and return the cleaned data-frame\n 1. Drop Null Rows\n 2. Convert everything to lowercase \n 3. Removes digits/numbers\n 4. Removes html tags\n 5. Convert accented chars to normal letters\n 6. Removes special and punctuation characters\n 7. Removes stop words\n 8. Removes multiple spaces\n\n**Code Implementation**\n\nPass in the dataframe with the name of the column which you have to clean\n```python\ncleaned_df = NLAutoPurifier(df, target = \"tweets\")\n```\n \n**Widget Based Data Preprocessing**\n\n* It provides following cleaning techniques, where you have to just tick the checkbox and our system will automatically perform the operation for you.\n\n| Features | Features | Features |\n| ------------------------------------------ | ------------------------------------- | -------------------------------- |\n| Drop Null Rows | Lower all Words | Contraction to Expansion |\n| Removal of emojis | Removal of emoticons | Conversion of emoticons to words |\n| Count Urls | Get Word Count | Count Mails |\n| Conversion of emojis to words | Remove Numbers and Alphanumeric words | Remove Stop Words |\n| Remove Special Characters and Punctuations | Remove Mails | Remove Html Tags |\n| Remove Urls | Remove Multiple Spaces | Remove Accented Characters |\n\n\n* You can convert word to its base form by selecting either `stemming` or `lemmatization` option.\n\n* Remove Top Common Word: By giving range of word, you can `remove top common word`\n \n* Remove Top Rare Word: By giving range of word, you can `remove top rare word`\n\nAfter you are done, selecting your cleaning methods or techniques, click on `Start Purifying` button to let the magic begins. Upon its completion you can access the cleaned dataframe by `<obj>.df`\n\n**Code Implementation**\n\n```python\npure = Nlpurifier(nlp_df, \"tweets\")\n```\n\nView the processed and purified dataframe\n\n```python\npure.df\n```\n\n\n### Automated EDA for Machine Learning\n\n* It gives shape, number of categorical and numerical features, description of the dataset, and also the information about the number of null values and their respective percentage. \n\n* For understanding the distribution of datasets and getting useful insights, there are many interactive plots generated where the user can select his desired column and the system will automatically plot it. Plot includes\n 1. Count plot\n 2. Correlation plot\n 3. Joint plot\n 4. Pair plot\n 5. Pie plot \n\n**Code Implementation**\n\nLoad the dataset and let the magic of automated EDA begin\n\n```python\ndf = pd.read_csv(\"./datasets/iris.csv\")\nae = Mleda(df)\nae\n```\n\n### Automated Report Generation for Machine Learning\n\nReport contains sample of data, shape, number of numerical and categorical features, data uniqueness information, description of data, and null information.\n\n```python\ndf = pd.read_csv(\"./datasets/iris.csv\")\nreport = MlReport(df)\n```\n\n\n## Example\n[Colab Notebook](https://colab.research.google.com/drive/1J932G1uzqxUHCMwk2gtbuMQohYZsze8U?usp=sharing)\n\nOfficial Documentation: https://cutt.ly/CbFT5Dw",
"bugtrack_url": null,
"license": "MIT",
"summary": "A Python library for Automated Exploratory Data Analysis, Automated Data Cleaning and Automated Data Preprocessing For Machine Learning and Natural Language Processing Applications in Python.",
"version": "0.3.6",
"project_urls": {
"Homepage": "https://github.com/Elysian01/Data-Purifier"
},
"split_keywords": [
"automated",
"eda",
"exploratory-data-analysis",
"data-cleaning",
"data-preprocessing",
"python",
"jupyter",
"ipython"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "98d5cca7ee1769fc5e3d95f18ced185da6a718d89161b1e1ede7d35730e88b1a",
"md5": "f7ae24ca9ef7a4b1ed997b85d06ed7be",
"sha256": "f02150e454802d15227df85d95685edd87d0981c0c0854f936247e9ce4057ecf"
},
"downloads": -1,
"filename": "data-purifier-0.3.6.tar.gz",
"has_sig": false,
"md5_digest": "f7ae24ca9ef7a4b1ed997b85d06ed7be",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 3388166,
"upload_time": "2023-09-10T06:28:51",
"upload_time_iso_8601": "2023-09-10T06:28:51.939849Z",
"url": "https://files.pythonhosted.org/packages/98/d5/cca7ee1769fc5e3d95f18ced185da6a718d89161b1e1ede7d35730e88b1a/data-purifier-0.3.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-10 06:28:51",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Elysian01",
"github_project": "Data-Purifier",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "data-purifier"
}