Error while predicting data


#1

I have an issue in R-studio while predicting a dataset with Naivebayes model.

this is the issue :
Error in log(sapply(seq_along(attribs), function(v) { :
non-numeric argument to mathematical function

Can anyone help me on this issue, please ?

thanks you.

Sankar


#2

@sankar007
Please upload the exact problem with a snapshot of your code and dataset. Then only it would be possible to help you.
But from the look of it, it looks like you passed an incompatible data type variable to one of your function.


#3

@sankar007,
Can you please upload the code that you have used.


#4

Hi Danish,

Here is the code in attached document.code segmentation.pdf (103.9 KB)


#5

Thank you Danish for your time spending on this issue.

Sankar


#6

@sankar007,
The file that you have uploaded is blank. Please check it.


#7

Sorry for that. I dont know why it happened so. Uploading again.code segmentation.pdf (103.9 KB)


#8

If still you are facing the same issue , then may I have your emailID please ?
so that I can forward the .doc and pdf both.


#9

@sankar007, please give a reproduceable copy of your code. From the pdf, it seems that the model is not able to predict because the independent variable(segment) has a lot of missing values. It is advisable to treat those missing values before modelling the data. Also, try by converting logical variables into numeric if that does not work.


#10

code segmentation.zip (14.9 KB)