Support Vector Machine - Can't create an additional predicted value for my data set


I have created two models, one using logistic regression the other using support vector machine. I'll show you what I did for logistic regression, no problems, and then with support vector machine, problems.

Logistic regression - No problem Others+Restaurant+Retail_Clothing+Retail_Discount+Retail_Materials+Retail_Specialty+amt2+flag_cat30+flag_state30+ merchants,,family=binomial)$pred_fraud_log<-predict(,,type="response")

Support Vector Machine: - No Problem with svm running, but when I try to create predicted value get errors.,,kernel="radial",gamma=1,cost=1)$pred_fraud_SVM<-predict(,,type="response")
Error in $<*tmp*, "pred_fraud_SVM", value = numeric(0)) :
 replacement has 0 rows, data has 32815



It's difficult to tell what the issue might be since we cannot reproduce the analysis.

To copy from @mara:

Could you please turn this into a self-contained reprex (short for reproducible example)? It will help us help you if we can be sure we're all working with/looking at the same stuff.


If you've never heard of a reprex before, you might want to start by reading the help page. The reprex dos and don'ts are also useful.

What to do if you run into clipboard problems

If you run into problems with access to your clipboard, you can specify an outfile for the reprex, and then copy and paste the contents into the forum.

reprex::reprex(input = "fruits_stringdist.R", outfile = "")

For pointers specific to the community site, check out the reprex FAQ, linked to below.