% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/CFbuilder.R
\name{CFbuilder}
\alias{CFbuilder}
\title{Build a Collaborative Filtering Object}
\usage{
CFbuilder(
  Data,
  Datatype = ifelse(ncol(Data) == 2, "consumption", "rating"),
  similarity = ifelse(Datatype == "consumption", "jaccard", "pearson")
)
}
\arguments{
\item{Data}{A data.frame containing:
\itemize{
\item 2 columns: (user, item) for consumption data
\item 3 columns: (user, item, rating) for rating data
}}

\item{Datatype}{A character string indicating the type of data:
\code{"consumption"} or \code{"rating"}.
Default is inferred from number of columns in \code{Data}.}

\item{similarity}{A character string indicating the similarity measure:
\itemize{
\item \code{"jaccard"} for consumption data
\item \code{"pearson"} or \code{"cosine"} for rating data
}
Default is chosen based on \code{Datatype}.}
}
\value{
An object of class \code{CF}.
}
\description{
Creates an object of class \code{CF} from a dataset of user-item interactions.
The dataset can represent either explicit ratings or implicit consumption.
}
\examples{
data(movies, package = "CFilt")
# --- Rating data ---
CF1 <- CFbuilder(Data = movies[1:300,],Datatype = "rating",
similarity = "pearson")
CF1_ <- CFbuilder(Data = movies[1:300,])
CF2 <- CFbuilder(Data = movies[1:300,],Datatype = "rating",
similarity = "cosine")
CF2_ <- CFbuilder(Data = movies[1:300,],similarity = "cosine")
# --- Consumption data ---
CF3 <- CFbuilder(Data = movies[1:300,-3],Datatype = "consumption",
similarity = "jaccard")
CF3_ <- CFbuilder(Data = movies[1:300,-3])
}
