Can the test set be used to label the unlabeled training set? Suppose that I have three datasets: a training set with no labels, a dev-set with labels, and a test set with labels.
My question is: Can I use the dev-set and the test set to train a model and predict the labels of the training set and then use the training set(with the predicted labels) to train a different model and test the model with the dev-set and test set? Why?
 A: I'm more confident this is just data leakage.  Here, I generate an example where we label the training data using a model created from the test set.  The model should have accuracy of 0.5 or close to, but when replicating the procedure the average test accuracy is much higher.
#create the test set

r = replicate(1000, {
  
  X = MASS::mvrnorm(n=100, mu=rep(0, 2), Sigma=diag(c(1,1)))
  eta = rep(0, nrow(X))
  p = plogis(eta)
  y = rbinom(nrow(X), 1, p)
  
  x = X[,1]
  w = X[,2]
  
  model = glm(y~x+w)
  
  
  # Create train set
  
  Xtrain = MASS::mvrnorm(n=1000, mu=rep(0, 2), Sigma=diag(c(1,1)))
  ytrain = predict(model, newdata = list(x=Xtrain[,1], w=Xtrain[,2]))
  ytrain = as.integer(ytrain<0.5)
  
  xtrain = Xtrain[,1]
  wtrain = Xtrain[,2]
  
  model2 = glm(ytrain ~ xtrain + wtrain)
  
  
  ypred = as.integer(predict(model2, newdata=list(xtrain=x, wtrain=w))<0.5)
  
  Metrics::accuracy(ypred, y)
  
})



This is very likely because of data leakage.  I would not do this under any circumstances.
