KNN is not working for me Help

Data.test <- one_hot_encoder(dataSet = Data.test, encoding = encoding, drop = TRUE, verbose = TRUE)


```{r}
bijections <- whichAreBijection(dataSet = data.train, verbose = TRUE)
Data.test <- model.matrix(~ churnn[,1]+churnn[,2]+churnn[,3]+churnn[,4]+churnn[,5]+churnn[,6]+churnn[,7]+churnn[,8]+churnn[,9]+churnn[,10]+churnn[,11]+churnn[,12]+churnn[,13]+churnn[,14]+churnn[,15])

Data.train<- model.matrix(~ churnn[,1]+churnn[,2]+churnn[,3]+churnn[,4]+churnn[,5]+churnn[,6]+churnn[,7]+churnn[,8]+churnn[,9]+churnn[,10]+churnn[,11]+churnn[,12]+churnn[,13]+churnn[,14]+churnn[,15])
library(class)
predic.test=knn(train= Data.train,test= Data.test,cl= cl.train,k = 7 )

I have an Error that says train and class have different sizes
Please help me

dim(cl.test)
dim(Data.train)


[1] 150  27
[1] 150  27
© Copyright 2013-2019 Analytics Vidhya