Skip to content

Instantly share code, notes, and snippets.

@cseidman
Created January 24, 2018 12:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cseidman/73eed0b914f4669c5aab00ede4290ed4 to your computer and use it in GitHub Desktop.
Save cseidman/73eed0b914f4669c5aab00ede4290ed4 to your computer and use it in GitHub Desktop.
TrainDecisionTree
# Get 80% of the data for training
rowCount <- nrow(ds)
endRange <- round(rowCount*0.80,0)
trainingData <- ds[1:endRange,]
tr <- rxDTree(
IsCardUser~
Gender+
Occupation+
MaritalStatus+
IsHomeOwner+
TotalChildren+
NumberCarsOwned+
AgeRanges+
CommuteDistance+
IncomeCategories+
CountryRegionCode+
Education,
data=trainingData,
method="class",
overwrite = TRUE,
reportProgress = 0
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment