FTRLProx_Matrix_Match: Transform Sparse Design Matrix to Assigned Schema

Description Usage Arguments Value Examples

View source: R/FTRLProx_Matrix_Match.R

Description

Transform a sparse "design" matrix to assigned schema for FTRL-Proximal Algorithm.

Usage

1
FTRLProx_Matrix_Match(data, feature_name)

Arguments

data

a object of ftrl.Dataset.

feature_name

the feature name of design matrix

Value

constructed dataset, an object of class "ftrl.Dataset"

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(data.table)
library(FeatureHashing)
data(ipinyou)
f <- ~ 0 + BidID + IP + City + AdExchange + BiddingPrice + PayingPrice
m.train <- FTRLProx_Model_Matrix(f, ipinyou.train[, -"IsClick", with = FALSE])
m.test <- FTRLProx_Model_Matrix(f, ipinyou.test[, -"IsClick", with = FALSE])
identical(rownames(m.train$X), rownames(m.test$X))
m.test <- FTRLProx_Matrix_Match(m.test, rownames(m.train$X))
identical(rownames(m.train$X), rownames(m.test$X))
m.test$Mapping

yanyachen/rFTRLProximal documentation built on May 4, 2019, 2:30 p.m.