View source: R/Train_naiveBayes_multicore.R
| Train_naiveBayes_multicore | R Documentation |
Trains a Pareto Density estimated naive Bayes model (PDENB) with multicore parallelity
Train_naiveBayes_multicore(cl=NULL,Data,Cls,Predict=FALSE,Priors,UseMemshare=FALSE,...)
cl |
Object instance of package parallel. |
Data |
|
Cls |
|
Predict |
Optional, boolean to decide extent of output. In case of TRUE, yields ClsTrain and Posteriors, else it yields only Model and Thetas. Note: Only if Predict is set to TRUE, parameter EvalPlausible can be set true! |
Priors |
Optional, |
UseMemshare |
Optional boolean. If set to TRUE, then package functionality from Memshare is used, else classic library parallel is used. |
... |
|
Precomputation of ParetoRadiusPerFeauture can be usefull to make cross-validation faster although it should be only done on the training data.
If Plausible is not given, both options are evalauted using shannon information.
c_Kernels_list and ListOfLikelihoods have d elements each storing a matrix [1:m,1:k], usually m!=n. In contrast to DataLikelihoodsPerClass in which by interpolation the matrix are of size [1:n,1:k]
Model |
List of model parameters and results. |
c_Kernels_list |
List of matrices, where each matrix represent the kernels of one feature for all classes. |
ListOfLikelihoods |
List of matrices, where each matrix represent the likelihood of one feature for all classes. |
PDFs_funs |
Nested list of depth 1, where the first index assigns the feature index and the second index assigns the class. The elements are functions for the density estimation for each feature and each class. |
ParetoRadiusPerFeauture |
Numeric vector which stores the pareto radius for each feature. |
Theta |
Parameters mean and standard deviation of the Gaussian distributions per class and feaures. |
Priors |
Numeric vector which stores the prior probability of each class to appear. |
PlausibleCenters |
[1:k, 1:f] Numeric matrix which stores the centers for each feature and each class, where the row index assigns features and the column index assigns classes. |
ClsTrain |
[1:n] numerical vector with n numbers defining the classification. It has k unique numbers representing the arbitrary labels of the classification. |
Posteriors |
[1:n, 1:k] Numeric matrices with posterior probabilities. |
Michael Thrun
Predict_naiveBayes
if(requireNamespace("FCPS")){
data(Hepta)
Data=Hepta$Data
Cls=Hepta$Cls
#non-parametric
V=Train_naiveBayes_multicore(cl=NULL,Data=Data,Cls=Cls,Gaussian=FALSE,Predict=TRUE)
ClsTrain=V$ClsTrain
table(Cls,ClsTrain)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.