MINI MINI MANI MO
%
% Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
%
\name{ore.predict-matrix}
\alias{ore.predict-matrix}
\alias{ore.predict,matrix-method}
\title{
使用矩陣中之資料列距離的 Oracle R Enterprise 預測
}
\description{
使用資料矩陣資料列產生預測的 Oracle R Enterprise 方法.
對於引數 \code{newdata} 中的每個資料列, 會計算引數 \code{object} 中之
每個資料列的距離, 並會傳回這些距離或是
傳回最小距離之引數 \code{object} 當中的
資料列數目.
}
\usage{
\S4method{ore.predict}{matrix}(object, newdata, type = c("classes", "distances"),
method = "euclidean", p = 2, na.action = na.pass, ...)
}
\arguments{
\item{object}{
一個 \code{\link[base]{matrix}} 物件, 其資料列數目
不超過 1000.
}
\item{newdata}{
一個 \code{\link[OREbase:ore.frame-class]{ore.frame}}
物件.
}
\item{type}{
指定要產生何種類型之預測的字元字串;
\code{"classes"} (資料列 ID) 或 \code{"distances"} 其中之一.
}
\item{method}{
指定要使用之距離量的字元字串;
\code{"euclidean"}、\code{"maximum"}、\code{"manhattan"}、
\code{"canberra"} 或 \code{"minkowski"} 其中之一. 請參閱
函數 \code{\link[stats]{dist}} 以獲得進一步的解釋.
}
\item{p}{
當引數 \code{method} 為 \code{"minkowski"} 時, 敏可斯基距離的
冪次.
}
\item{na.action}{
處理 \code{NA} 值的方式,
\code{na.omit} 或 \code{na.pass} 其中之一.
}
\item{\dots}{
選擇性引數.
}
}
\value{
如果引數 \code{type} 為 \code{"classes"}, 會傳回
參照引數 \code{\link[OREbase:ore.integer-class]{ore.integer}} 之
資料列數目的 \code{object} 物件.
如果引數 \code{type} 為 \code{"distances"}, 會傳回
\code{\link[OREbase:ore.frame-class]{ore.frame}} 物件, 並在其中包含
代表引數 \code{object} 中每個資料列的一個資料欄.
}
\references{
\href{http://www.oracle.com/technetwork/database/database-technologies/r/r-enterprise/documentation/index.html}{Oracle R Enterprise}
}
\author{
Oracle \email{oracle-r-enterprise@oracle.com}
}
\seealso{
\code{\link{ore.predict}},
\code{\link{ore.predict-kmeans}},
\code{\link[stats]{dist}}.
}
\examples{
groups <- cutree(hclust(dist(iris[1:4], "manhattan")), 3)
centers <- do.call(rbind, lapply(split(iris[1:4], groups), colMeans))
rownames(centers) <- sprintf("DISTANCE\%d", 1:3)
IRIS <- ore.push(iris)
IRIS$CLUSTER <- ore.predict(centers, IRIS, method = "manhattan")
IRIS <- cbind(IRIS, ore.predict(centers, IRIS, type = "distances",
method = "manhattan"))
head(IRIS)
table(IRIS$CLUSTER, IRIS$Species)
}
\keyword{multivariate}
\keyword{cluster}
OHA YOOOO