Skip to content

Instantly share code, notes, and snippets.

View Nithilaa's full-sized avatar

Nithilaa Umasankar Nithilaa

  • Coimbatore
View GitHub Profile
pip install pycaret
@Nithilaa
Nithilaa / install1.py
Created June 10, 2021 03:11
installing pycaret in local Jupyter notebook
pip install pycaret
@Nithilaa
Nithilaa / install2.py
Created June 10, 2021 03:18
Installing PyCaret on Google Colab or Azure Notebooks
!pip install pycaret
@Nithilaa
Nithilaa / install3.py
Created June 10, 2021 03:19
For Google colab users, the below code of cells must be run at top of the notebook to display interactive visuals
from pycaret.utils import enable_colab
enable_colab()
@Nithilaa
Nithilaa / install4.py
Created June 10, 2021 03:20
If you already have a version of PyCaret installed, you can update it with the following instruction.
pip install --upgrade pycaret
@Nithilaa
Nithilaa / data_preproc_1.py
Created June 10, 2021 03:24
dropping columns that are not necessary
df1 = df1.drop(["review_id", "title", "year"], axis=1)
df1 = df1.rename(columns={"user_suggestion":"Flag", "user_review":"Review"})
df1.head()
@Nithilaa
Nithilaa / dependecies.py
Created June 10, 2021 03:29
importing necessary dependencies
pip install BeautifulSoup4
import bs4
import re
from bs4 import BeautifulSoup
@Nithilaa
Nithilaa / remove_http.py
Created June 10, 2021 03:30
remove http tags
%time df2['Review_Processed'] = df2['Review'].map(lambda x : ' '.join(re.sub("(@[A-Za-z0-9]+)|([^0-9A-Za-z \t])|(\w+:\/\/\S+)"," ",x).split()))
@Nithilaa
Nithilaa / lower_case.py
Created June 10, 2021 03:31
lower the case
%time df2['Review_Processed'] = df2['Review_Processed'].map(lambda x: x.lower())
@Nithilaa
Nithilaa / remove_punc_unicode.py
Last active June 10, 2021 03:32
Remove all punctuations and Unicode
%time df2['Review_Processed'] = df2['Review_Processed'].map(lambda x : re.sub(r'[^\x00-\x7F]+',' ', x))
%time df2['Review_Processed'] = df2['Review_Processed'].map(lambda x: re.sub(r'[^\w\s]', '', x))