package validation
Model validation.
- Alphabetic
- By Inheritance
- validation
- Operators
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
def
bootstrap[T <: AnyRef](x: Array[T], y: Array[Double], k: Int, measures: RegressionMeasure*)(trainer: ⇒ (Array[T], Array[Double]) ⇒ Regression[T]): Array[Double]
Bootstrap validation on a generic regression model.
Bootstrap validation on a generic regression model.
- x
data samples.
- y
response variable.
- k
k-round bootstrap estimation.
- measures
validation measures such as MSE, AbsoluteDeviation, etc.
- trainer
a code block to return a regression model trained on the given data.
- returns
measure results.
- Definition Classes
- Operators
-
def
bootstrap[T <: AnyRef](x: Array[T], y: Array[Int], k: Int, measures: ClassificationMeasure*)(trainer: ⇒ (Array[T], Array[Int]) ⇒ Classifier[T]): Array[Double]
Bootstrap validation on a generic classifier.
Bootstrap validation on a generic classifier. The bootstrap is a general tool for assessing statistical accuracy. The basic idea is to randomly draw datasets with replacement from the training data, each sample the same size as the original training set. This is done many times (say k = 100), producing k bootstrap datasets. Then we refit the model to each of the bootstrap datasets and examine the behavior of the fits over the k replications.
- x
data samples.
- y
sample labels.
- k
k-round bootstrap estimation.
- measures
validation measures such as accuracy, specificity, etc.
- trainer
a code block to return a classifier trained on the given data.
- returns
measure results.
- Definition Classes
- Operators
-
def
cv[T <: AnyRef](x: Array[T], y: Array[Double], k: Int, measures: RegressionMeasure*)(trainer: ⇒ (Array[T], Array[Double]) ⇒ Regression[T]): Array[Double]
Cross validation on a generic regression model.
Cross validation on a generic regression model.
- x
data samples.
- y
response variable.
- k
k-fold cross validation.
- measures
validation measures such as MSE, AbsoluteDeviation, etc.
- trainer
a code block to return a regression model trained on the given data.
- returns
measure results.
- Definition Classes
- Operators
-
def
cv[T <: AnyRef](x: Array[T], y: Array[Int], k: Int, measures: ClassificationMeasure*)(trainer: ⇒ (Array[T], Array[Int]) ⇒ Classifier[T]): Array[Double]
Cross validation on a generic classifier.
Cross validation on a generic classifier. Cross-validation is a technique for assessing how the results of a statistical analysis will generalize to an independent data set. It is mainly used in settings where the goal is prediction, and one wants to estimate how accurately a predictive model will perform in practice. One round of cross-validation involves partitioning a sample of data into complementary subsets, performing the analysis on one subset (called the training set), and validating the analysis on the other subset (called the validation set or testing set). To reduce variability, multiple rounds of cross-validation are performed using different partitions, and the validation results are averaged over the rounds.
- x
data samples.
- y
sample labels.
- k
k-fold cross validation.
- measures
validation measures such as accuracy, specificity, etc.
- trainer
a code block to return a classifier trained on the given data.
- returns
measure results.
- Definition Classes
- Operators
-
def
loocv[T <: AnyRef](x: Array[T], y: Array[Double], measures: RegressionMeasure*)(trainer: ⇒ (Array[T], Array[Double]) ⇒ Regression[T]): Array[Double]
Leave-one-out cross validation on a generic regression model.
Leave-one-out cross validation on a generic regression model.
- x
data samples.
- y
response variable.
- measures
validation measures such as MSE, AbsoluteDeviation, etc.
- trainer
a code block to return a regression model trained on the given data.
- returns
measure results.
- Definition Classes
- Operators
-
def
loocv[T <: AnyRef](x: Array[T], y: Array[Int], measures: ClassificationMeasure*)(trainer: ⇒ (Array[T], Array[Int]) ⇒ Classifier[T]): Array[Double]
Leave-one-out cross validation on a generic classifier.
Leave-one-out cross validation on a generic classifier. LOOCV uses a single observation from the original sample as the validation data, and the remaining observations as the training data. This is repeated such that each observation in the sample is used once as the validation data. This is the same as a K-fold cross-validation with K being equal to the number of observations in the original sample. Leave-one-out cross-validation is usually very expensive from a computational point of view because of the large number of times the training process is repeated.
- x
data samples.
- y
sample labels.
- measures
validation measures such as accuracy, specificity, etc.
- trainer
a code block to return a classifier trained on the given data.
- returns
measure results.
- Definition Classes
- Operators
-
def
test[T, C <: Classifier[T]](x: Array[T], y: Array[Int], testx: Array[T], testy: Array[Int], parTest: Boolean = true)(trainer: ⇒ (Array[T], Array[Int]) ⇒ C): C
Test a generic classifier.
Test a generic classifier. The accuracy will be measured and printed out on standard output.
- T
the type of training and test data.
- x
training data.
- y
training labels.
- testx
test data.
- testy
test data labels.
- parTest
Parallel test if true.
- trainer
a code block to return a classifier trained on the given data.
- returns
the trained classifier.
- Definition Classes
- Operators
-
def
test2[T, C <: Classifier[T]](x: Array[T], y: Array[Int], testx: Array[T], testy: Array[Int], parTest: Boolean = true)(trainer: ⇒ (Array[T], Array[Int]) ⇒ C): C
Test a binary classifier.
Test a binary classifier. The accuracy, sensitivity, specificity, precision, F-1 score, F-2 score, and F-0.5 score will be measured and printed out on standard output.
- T
the type of training and test data.
- x
training data.
- y
training labels.
- testx
test data.
- testy
test data labels.
- parTest
Parallel test if true.
- trainer
a code block to return a binary classifier trained on the given data.
- returns
the trained classifier.
- Definition Classes
- Operators
-
def
test2soft[T, C <: SoftClassifier[T]](x: Array[T], y: Array[Int], testx: Array[T], testy: Array[Int], parTest: Boolean = true)(trainer: ⇒ (Array[T], Array[Int]) ⇒ C): C
Test a binary soft classifier.
Test a binary soft classifier. The accuracy, sensitivity, specificity, precision, F-1 score, F-2 score, F-0.5 score, and AUC will be measured and printed out on standard output.
- T
the type of training and test data.
- x
training data.
- y
training labels.
- testx
test data.
- testy
test data labels.
- parTest
Parallel test if true.
- trainer
a code block to return a binary classifier trained on the given data.
- returns
the trained classifier.
- Definition Classes
- Operators
High level Smile operators in Scala.