Hi All, I applied the naiveBayes function in e1071 package with the iris data, and here's the list that was created
structure(list(apriori = structure(c(50L, 50L, 50L), .Dim = 3L, .Dimnames = structure(list( Y = c("setosa", "versicolor", "virginica")), .Names = "Y"), class = "table"), tables = structure(list(Sepal.Length = structure(c(5.006, 5.936, 6.588, 0.352489687213451, 0.516171147063863, 0.635879593274432 ), .Dim = c(3L, 2L), .Dimnames = structure(list(Y = c("setosa", "versicolor", "virginica"), Sepal.Length = NULL), .Names = c("Y", "Sepal.Length"))), Sepal.Width = structure(c(3.428, 2.77, 2.974, 0.379064369096289, 0.313798323378411, 0.322496638172637 ), .Dim = c(3L, 2L), .Dimnames = structure(list(Y = c("setosa", "versicolor", "virginica"), Sepal.Width = NULL), .Names = c("Y", "Sepal.Width"))), Petal.Length = structure(c(1.462, 4.26, 5.552, 0.173663996480184, 0.469910977239958, 0.551894695663983 ), .Dim = c(3L, 2L), .Dimnames = structure(list(Y = c("setosa", "versicolor", "virginica"), Petal.Length = NULL), .Names = c("Y", "Petal.Length"))), Petal.Width = structure(c(0.246, 1.326, 2.026, 0.105385589380046, 0.197752680004544, 0.274650055636667 ), .Dim = c(3L, 2L), .Dimnames = structure(list(Y = c("setosa", "versicolor", "virginica"), Petal.Width = NULL), .Names = c("Y", "Petal.Width")))), .Names = c("Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width")), levels = c("setosa", "versicolor", "virginica"), call = quote(naiveBayes.default(x = X, y = Y, laplace = laplace))), .Names = c("apriori", "tables", "levels", "call"), class = "naiveBayes") I'm unable to understand that the first element of the list should be a vector like (50,50,50) but its correctly showing (0.33,0.33,0.33). Can anyone tell me which part of the code is doing this? -- Anindya Sankar Dey [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.