This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def pre_processing(dataset, my_stop_list): | |
store = [] | |
##Use contractions | |
dataset['review_modified'] = dataset['review'].apply(lambda x: [contractions.fix(word) for word in x.split()]) | |
##convert list to string | |
dataset['review_modified_unlist'] = [' '.join(map(str, l)) for l in dataset['review_modified']] | |
##convert string to tokens | |
dataset['review_mod_tokens'] = dataset['review_modified_unlist'].apply(nltk.word_tokenize) | |
##convert token to lower case |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my_stop_list_ = ['pizza', 'dominos', 'india', 'dominoz', 'swiggy', 'zomato', 'uber', 'amazonin', | |
'pizzahut', 'ok', 'okay', 'asia', 'kitchen', 'stir', 'order', 'dominos_india', 'party', 'twitter', | |
'pic', 'company', 'rt', 'jonerlichman', 'deliver', 'delivery', 'dollar', 'domino'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```{r echo=FALSE, results='asis'} | |
library("rmarkdown") | |
library("tinytex") | |
library("stargazer") | |
library("sandwich") | |
m1 = lm(drat~ disp + hp + wt, data = mtcars) | |
m2 = lm(mpg~ disp + hp + wt, data = mtcars) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```{r echo=FALSE, results='asis'} | |
library("rmarkdown") | |
library("tinytex") | |
library("stargazer") | |
library("sandwich") | |
m1 = lm(Fertility~ Agriculture, data = swiss) | |
m2 = lm(Fertility~ Agriculture + Examination, data = swiss) | |
m3 = lm(Fertility~ Agriculture + Examination + Education, data = swiss) | |
m4 = lm(Fertility~ Agriculture + Examination + Education + Catholic, data = swiss) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Getting familiar with Rmarkdown PDF" | |
author: | | |
| Arimitra Maiti | |
| Author-2 | |
date: "`r format(Sys.time(), '%d %B, %Y')`" | |
output: | |
pdf_document: | |
keep_tex: yes | |
latex_engine: pdflatex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Getting familiar with Rmarkdown PDF" | |
subtitle: | | |
| Examples for Towards Data Science | |
| Focussing on Metadata | |
| Reviewed by: Towards Data Science Team | |
author: | | |
| Arimitra Maiti | |
| Author-2 | |
thanks: | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Getting familiar with Rmarkdown PDF" | |
subtitle: | | |
| Examples for Towards Data Science | |
| Focussing on Metadata | |
| Reviewed by: Towards Data Science Team | |
author: | | |
| Arimitra Maiti | |
| Author-2 | |
thanks: | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```{r setup, include=FALSE} | |
knitr::opts_chunk$set(warning = FALSE, message = FALSE) | |
``` | |
### This is the common header for the document | |
This is some **notes** below the common header | |
### Please click on each tab to check results {.tabset} | |
#### Tab-1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Show regression outputs | |
```{r echo=FALSE} | |
library("sjPlot") | |
library("sjmisc") | |
library("sjlabelled") | |
data = read.csv("https://stats.idre.ucla.edu/stat/data/binary.csv") | |
data$rank <- factor(data$rank) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Show a table using kableExtra | |
```{r echo=FALSE} | |
library(kableExtra) | |
kable(VADeaths, longtable =T,booktabs =T,caption ="datasets::VADeaths") %>% add_header_above(c(" ","Rural Sample"=2, | |
"Urban Sample"=2)) %>% | |
kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"), font_size = 12) | |
``` |
NewerOlder