Login
Order Now
Support
R Program on Model Building and Interpretation

R Program on Model Building and Interpretation

  • 20th Oct, 2022
  • 00:47 AM

```{r setup, include=FALSE}
df<-read.csv("C:\\Users\\dell\\Downloads\\Previous Task\\Coronaryheartriskstudy.csv")
df <- na.omit(df)
head(df)
## check null values
colSums(is.na(df))
```

## R Markdown


```{r }
library(ggplot2)
ggplot(df,aes(x=male))+geom_bar(color="black",fill="green")
ggplot(df,aes(x=education))+geom_bar(color="black",fill="green")
ggplot(df,aes(x=currentSmoker))+geom_bar(color="black",fill="green")

```

```{r , echo=FALSE}
library(caret)
df$TenYearCHD<-as.factor(df$TenYearCHD)

colSums(is.na(df))
set.seed(100)
View(df)
training<-sample(1:nrow(df),0.70*nrow(df))
train<-df[training,]
test<-df[-training,]
nrow(train)
nrow(test)

```

```{r , echo=FALSE}
library(DMwR)
i <- grep("TenYearCHD", colnames(train))
tr <- SMOTE(TenYearCHD ~ ., data  = train, perc.over=500, k =1, learner=NULL)

table(tr$TenYearCHD)
summary(tr)

```
 

Share this post

assignment helpassignment helperassignment expertsassignment writing services