PredPsych (version 0.1)

classifyFun: Generic Classification Analyses

Description

function for performing generic classification Analysis

Usage

classifyFun(Data, classCol, selectedCols, ranges = NULL, tune = FALSE,
  cost = 1, gamma = 0.5, classifierName = "svm",
  genclassifier = Classifier.svm, silent = FALSE, SetSeed = TRUE, ...)

Arguments

Data

(dataframe) dataframe of the data

classCol

(numeric) column number that contains the variable to be predicted

selectedCols

(optional) (numeric) all the columns of data that would be used either as predictor or as feature

ranges

(optional) (list) ranges for tuning support vector machine

tune

(optional) (logical) whether tuning of svm parameters should be performed or not

cost

(optional) (numeric) regularization parameter of svm

gamma

(optional) (numeric) rbf kernel parameter

classifierName

(optional) (string) name of the classifier to be used

genclassifier

(optional) (function or string) a classifier function or a name (e.g. Classifier.svm)

silent

(optional) (logical) whether to print messages on mean accuracy or not

SetSeed

(optional) (logical) Whether to setseed or not. use SetSeed to seed the random number generator to get consistent results; set false only for permutation tests

...

(optional) additional arguments for the function

Value

Outputs Crossvalidation accuracy acc and Test accuracy accTest

Details

This function implements Classification Analysis. Classification Analysis is a supervised machine learning approach that attempts to identify holistic patters in the data and assign to it classes (classification). Given a set of features, a classification analysis automatically learns intrinsic patterns in the data to be able to predict respective classes. If the data features are informative about the classes, a high classification score would be achieved.

Examples

Run this code
#classification analysis with SVM
Results <- classifyFun(Data = KinData,classCol = 1,
selectedCols = c(1,2,12,22,32,42,52,62,72,82,92,102,112))
# output
# [1] "Begining k-fold Classification"
# [1] "Mean CV Accuracy 0.66"
# [1] "Mean Test Accuracy 0.62"

Run the code above in your browser using DataCamp Workspace