Quantcast
Channel: Codemiles.com Programming Forums - All Topics
Viewing all articles
Browse latest Browse all 36

R script for RandomForest with Cross-validation and Sampling

$
0
0
This is script is used for building a randomForest Classifier with 10-cross-validation in R. This scripts also deals with the unbalanced data problem by doing up-sampling and down-sampling steps on the training data. This script also calculate the precision/recall, variable importance and ROC curve area for each fold. To run this script you need to do few modification to read and process your data.
Code: 

setwd("D:/newFolder/")


data <- read.csv("Data.csv",head=TRUE )
require(randomForest)
require(ROSE)
if(!require(caret)){

...

Statistics : Posted by codemiles • on Sat Oct 18, 2014 5:28 am • Replies 1 • Views 11030

Viewing all articles
Browse latest Browse all 36

Trending Articles