

Example, if you want to install CARET package you use install function as install.packages(“caret”) followed by using the above listing as library(caret). If you do not already have the above libraries installed, you will have to first install them using a function install.packages(“”). Listing for loading libraries and setting seed Followed by setting seed for reproducible purposes. Our next step involves, loading all the required packages for this example including CARET library into R environment. Listing for loading data in R View of first 10 entrees in Boston data set Summary of Boston data Structure of Boston data MEDV – Median value of owner-occupied homes in $1000’s.LSTAT – % lower status of the population.B – 1000(Bk – 0.63)^2 where Bk is the proportion of blacks by town.TAX – full-value property-tax rate per $10,000.RAD – index of accessibility to radial highways.DIS – weighted distances to five Boston employment centres.AGE – proportion of owner-occupied units built prior to 1940.RM – average number of rooms per dwelling.NOX – nitric oxides concentration (parts per 10 million).CHAS – Charles River dummy variable (1 if tract bounds river 0 otherwise).INDUS – proportion of non-retail business acres per town.ZN – proportion of residential land zoned for lots over 25,000 sq.ft.There are 14 attributes in each case of the dataset. If you know already following are the Boston dataset fields for a refresher: Below is the listing to load the required libraries and loading the data in R environment. Let us better understand things with an example, for this example we will be using the very popular Boston dataset available in MASS library. Estimating model performance from a training dataset.Selecting an optimal model across these parameters defined.Evaluate model, using re-sampling the effect of model tuning parameters on the performance.The extensively used CARET function is the train() function which can be used for the following: We have a little to do of everything today, we will pre-process our data initially, followed by building a model via model training and parameter tuning and lastly a few plots to better understand the model we built.ĬARET as mentioned as functions to streamline the model building and evaluation process. The package mainly contains tools which are useful for: CARET is well known for streamlining and build predictive models. The CARET package ( Classification And REgression Training). Today, we will be using a very fascinating R library which is extensively used for automating algorithms and repeated testing of our algorithms.
