I have the below mentioned code and it is giving me caption outside float error. Kindly advise as to why am I getting this error.
\begin{center}
\caption{
Table 10. Performance for the seven models using the top 10 features from model D3 on the test dataset. \label{long}}\\
\vspace{15}
\begin{tabular}{|c c c|}
\hline
Models & AUC & RMSE \\ [0.5ex]
\hline\hline
M1 & 0.640431 & 0.459820 \\
\hline\hline
M2 & 0.980599 & 0.179471 \\
\hline\hline
M3 & 0.985183 & 0.112334 \\
\hline\hline
D1 & 0.712025 & 0.158077 \\
\hline\hline
D2 & 0.838344 & 0.120950 \\
\hline\hline
D3 & 0.753037 & 0.117660 \\
\hline\hline
D4 & 0.711824 & 0.814445\\
\hline
\end{tabular}
\vspace{15pt}
\end{center}
captionof{table}{<caption text>}
defined in in the packagescaption
andcapt-of
.\@captype
is undefined (instead of figure or table).