# NOT RUN {
library(rTensor)
indices = c(2,3,4)
noise = rand_tensor(indices)@data
Theta = array(runif(prod(indices),min=-3,max = 3),indices)
# The signal plus noise model
Y = Theta + noise
# Optimize the weighted classification for given a sign tensor sign(Y) and a weight tensor abs(Y)
result = Alt(sign(Y),abs(Y),r = 3,type = "logistic",start = "linear")
signTheta = sign(result$fitted)
# }
Run the code above in your browser using DataLab