Quantcast

error message "number expected, read Token[]" with 700 attributes

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

error message "number expected, read Token[]" with 700 attributes

Jenna
Hello. I have 700 plus attributes that I am trying to load into Explorer. I got the message:
"number expected, read" "Token[]"
How can I tell which one is the problem.
Also, what does Token[] mean as opposed to something like Token[FALSE]. I assume that Token[FALSE] means that it found a value of FALSE where it was expecting something else (like number) but then what does Token[] mean?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: error message "number expected, read Token[]" with 700 attributes

Martin
Hi Jenna, 

Your data has a problem in the design structure. Token is any symbol, so you need to attach a sample of your data to figure it out. 

Regards, 
Martin 

On 23 December 2016 at 12:46, Jenna [via WEKA] <[hidden email]> wrote:
Hello. I have 700 plus attributes that I am trying to load into Explorer. I got the message:
"number expected, read" "Token[]"
How can I tell which one is the problem.
Also, what does Token[] mean as opposed to something like Token[FALSE]. I assume that Token[FALSE] means that it found a value of FALSE where it was expecting something else (like number) but then what does Token[] mean?


If you reply to this email, your message will be added to the discussion below:
http://weka.8497.n7.nabble.com/error-message-number-expected-read-Token-with-700-attributes-tp39066.html
To unsubscribe from WEKA, click here.
NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: error message "number expected, read Token[]" with 700 attributes

Jenna
Here is the first line. The first line caused an error. I had to mask things though so I don't know if it would be useful.
What does it mean for Token[] to have nothing inside the square brackets? Isn't there any way to see which field is causing the error other than manually inspecting every field?




On Sat, Dec 24, 2016 at 12:47 AM, Martin [via WEKA] <[hidden email]> wrote:
Hi Jenna, 

Your data has a problem in the design structure. Token is any symbol, so you need to attach a sample of your data to figure it out. 

Regards, 
Martin 

On 23 December 2016 at 12:46, Jenna [via WEKA] <[hidden email]> wrote:
Hello. I have 700 plus attributes that I am trying to load into Explorer. I got the message:
"number expected, read" "Token[]"
How can I tell which one is the problem.
Also, what does Token[] mean as opposed to something like Token[FALSE]. I assume that Token[FALSE] means that it found a value of FALSE where it was expecting something else (like number) but then what does Token[] mean?


If you reply to this email, your message will be added to the discussion below:
http://weka.8497.n7.nabble.com/error-message-number-expected-read-Token-with-700-attributes-tp39066.html
To unsubscribe from WEKA, click here.
NAML




If you reply to this email, your message will be added to the discussion below:
http://weka.8497.n7.nabble.com/error-message-number-expected-read-Token-with-700-attributes-tp39066p39069.html
To unsubscribe from error message "number expected, read Token[]" with 700 attributes, click here.
NAML


sampleForForum.txt (47K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: error message "number expected, read Token[]" with 700 attributes

Eibe Frank-2
Administrator
It looks like several of the attributes have an empty string as their value (''), which is consistent with the error message you report. Maybe replace them with a question mark (WEKA's indicator for a missing value).

Cheers,
Eibe

> On 24 Dec 2016, at 14:28, Jenna <[hidden email]> wrote:
>
> Here is the first line. The first line caused an error. I had to mask things though so I don't know if it would be useful.
> What does it mean for Token[] to have nothing inside the square brackets? Isn't there any way to see which field is causing the error other than manually inspecting every field?
>
>
>
>
> On Sat, Dec 24, 2016 at 12:47 AM, Martin [via WEKA] <[hidden email]> wrote:
> Hi Jenna,
>
> Your data has a problem in the design structure. Token is any symbol, so you need to attach a sample of your data to figure it out.
>
> Regards,
> Martin
>
> On 23 December 2016 at 12:46, Jenna [via WEKA] <[hidden email]> wrote:
> Hello. I have 700 plus attributes that I am trying to load into Explorer. I got the message:
> "number expected, read" "Token[]"
> How can I tell which one is the problem.
> Also, what does Token[] mean as opposed to something like Token[FALSE]. I assume that Token[FALSE] means that it found a value of FALSE where it was expecting something else (like number) but then what does Token[] mean?
>
> If you reply to this email, your message will be added to the discussion below:
> http://weka.8497.n7.nabble.com/error-message-number-expected-read-Token-with-700-attributes-tp39066.html
> To unsubscribe from WEKA, click here.
> NAML
>
>
>
> If you reply to this email, your message will be added to the discussion below:
> http://weka.8497.n7.nabble.com/error-message-number-expected-read-Token-with-700-attributes-tp39066p39069.html
> To unsubscribe from error message "number expected, read Token[]" with 700 attributes, click here.
> NAML
>
>
>  sampleForForum.txt (47K) Download Attachment
>
> View this message in context: Re: error message "number expected, read Token[]" with 700 attributes
> Sent from the WEKA mailing list archive at Nabble.com.
> _______________________________________________
> Wekalist mailing list
> Send posts to: [hidden email]
> List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
> List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: error message "number expected, read Token[]" with 700 attributes

Jenna
Thank you. So empty string is generally not allowed?

On Sat, Dec 24, 2016 at 4:49 PM, Eibe Frank-2 [via WEKA] <[hidden email]> wrote:
It looks like several of the attributes have an empty string as their value (''), which is consistent with the error message you report. Maybe replace them with a question mark (WEKA's indicator for a missing value).

Cheers,
Eibe

> On 24 Dec 2016, at 14:28, Jenna <[hidden email]> wrote:
>
> Here is the first line. The first line caused an error. I had to mask things though so I don't know if it would be useful.
> What does it mean for Token[] to have nothing inside the square brackets? Isn't there any way to see which field is causing the error other than manually inspecting every field?
>
>
>
>
> On Sat, Dec 24, 2016 at 12:47 AM, Martin [via WEKA] <[hidden email]> wrote:

> Hi Jenna,
>
> Your data has a problem in the design structure. Token is any symbol, so you need to attach a sample of your data to figure it out.
>
> Regards,
> Martin
>
> On 23 December 2016 at 12:46, Jenna [via WEKA] <[hidden email]> wrote:
> Hello. I have 700 plus attributes that I am trying to load into Explorer. I got the message:
> "number expected, read" "Token[]"
> How can I tell which one is the problem.
> Also, what does Token[] mean as opposed to something like Token[FALSE]. I assume that Token[FALSE] means that it found a value of FALSE where it was expecting something else (like number) but then what does Token[] mean?
>
> If you reply to this email, your message will be added to the discussion below:
> http://weka.8497.n7.nabble.com/error-message-number-expected-read-Token-with-700-attributes-tp39066.html
> To unsubscribe from WEKA, click here.
> NAML
>
>
>
> If you reply to this email, your message will be added to the discussion below:
> http://weka.8497.n7.nabble.com/error-message-number-expected-read-Token-with-700-attributes-tp39066p39069.html
> To unsubscribe from error message "number expected, read Token[]" with 700 attributes, click here.
> NAML
>
>
>  sampleForForum.txt (47K) Download Attachment
>
> View this message in context: Re: error message "number expected, read Token[]" with 700 attributes
> Sent from the WEKA mailing list archive at Nabble.com.
> _______________________________________________
> Wekalist mailing list
> Send posts to: [hidden email]
> List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
> List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html



If you reply to this email, your message will be added to the discussion below:
http://weka.8497.n7.nabble.com/error-message-number-expected-read-Token-with-700-attributes-tp39066p39071.html
To unsubscribe from error message "number expected, read Token[]" with 700 attributes, click here.
NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: error message "number expected, read Token[]" with 700 attributes

Martin
In reply to this post by Jenna



Here is the first line. The first line caused an error. I had to mask things though so I don't know if it would be useful.
What does it mean for Token[] to have nothing inside the square brackets? Isn't there any way to see which field is causing the error other than manually inspecting every field?

In fact, your first problem is because of the attribute "@attribute pushff_at_nfw fatf "yyyy-MM-ff"", where you should replace it with @attribute Date date 'yyyy-MM-dd'. In addition, for the design of your data, you need to use attributes that have text only (i.e., not to keep missing attributes from string type). 

Regards,
Martin 




On Sat, Dec 24, 2016 at 12:47 AM, Martin [via WEKA] <[hidden email]> wrote:
Hi Jenna, 

Your data has a problem in the design structure. Token is any symbol, so you need to attach a sample of your data to figure it out. 

Regards, 
Martin 

On 23 December 2016 at 12:46, Jenna [via WEKA] <[hidden email]> wrote:
Hello. I have 700 plus attributes that I am trying to load into Explorer. I got the message:
"number expected, read" "Token[]"
How can I tell which one is the problem.
Also, what does Token[] mean as opposed to something like Token[FALSE]. I assume that Token[FALSE] means that it found a value of FALSE where it was expecting something else (like number) but then what does Token[] mean?


If you reply to this email, your message will be added to the discussion below:
http://weka.8497.n7.nabble.com/error-message-number-expected-read-Token-with-700-attributes-tp39066.html
To unsubscribe from WEKA, click here.
NAML




If you reply to this email, your message will be added to the discussion below:
http://weka.8497.n7.nabble.com/error-message-number-expected-read-Token-with-700-attributes-tp39066p39069.html
To unsubscribe from error message "number expected, read Token[]" with 700 attributes, click here.
NAML


sampleForForum.txt (47K) Download Attachment

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html



_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: error message "number expected, read Token[]" with 700 attributes

Jenna
Thanks Martin. I am sorry but I don't understand what you mean by " you need to use attributes that have text only (i.e., not to keep missing attributes from string type). "
Do you mean that if the entire "column" of data is empty, I should remove that attribute(column)? The data set is large (1.2 million records), so I believe every column has some non-empty records.



On Sun, Dec 25, 2016 at 12:08 AM, Martin [via WEKA] <[hidden email]> wrote:



Here is the first line. The first line caused an error. I had to mask things though so I don't know if it would be useful.
What does it mean for Token[] to have nothing inside the square brackets? Isn't there any way to see which field is causing the error other than manually inspecting every field?

In fact, your first problem is because of the attribute "@attribute pushff_at_nfw fatf "yyyy-MM-ff"", where you should replace it with @attribute Date date 'yyyy-MM-dd'. In addition, for the design of your data, you need to use attributes that have text only (i.e., not to keep missing attributes from string type). 

Regards,
Martin 




On Sat, Dec 24, 2016 at 12:47 AM, Martin [via WEKA] <[hidden email]> wrote:
Hi Jenna, 

Your data has a problem in the design structure. Token is any symbol, so you need to attach a sample of your data to figure it out. 

Regards, 
Martin 

On 23 December 2016 at 12:46, Jenna [via WEKA] <[hidden email]> wrote:
Hello. I have 700 plus attributes that I am trying to load into Explorer. I got the message:
"number expected, read" "Token[]"
How can I tell which one is the problem.
Also, what does Token[] mean as opposed to something like Token[FALSE]. I assume that Token[FALSE] means that it found a value of FALSE where it was expecting something else (like number) but then what does Token[] mean?


If you reply to this email, your message will be added to the discussion below:
http://weka.8497.n7.nabble.com/error-message-number-expected-read-Token-with-700-attributes-tp39066.html
To unsubscribe from WEKA, click here.
NAML




If you reply to this email, your message will be added to the discussion below:
http://weka.8497.n7.nabble.com/error-message-number-expected-read-Token-with-700-attributes-tp39066p39069.html
To unsubscribe from error message "number expected, read Token[]" with 700 attributes, click here.
NAML


sampleForForum.txt (47K) Download Attachment

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html



_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html



If you reply to this email, your message will be added to the discussion below:
http://weka.8497.n7.nabble.com/error-message-number-expected-read-Token-with-700-attributes-tp39066p39073.html
To unsubscribe from error message "number expected, read Token[]" with 700 attributes, click here.
NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: error message "number expected, read Token[]" with 700 attributes

Martin


Thanks Martin. I am sorry but I don't understand what you mean by " you need to use attributes that have text only (i.e., not to keep missing attributes from string type). "
Do you mean that if the entire "column" of data is empty, I should remove that attribute(column)? The data set is large (1.2 million records), so I believe every column has some non-empty records.

Yes, that's right. Avoid any sort of confusion in your data structure. Have a look at the attached file.​

Regards,
Martin



On Sun, Dec 25, 2016 at 12:08 AM, Martin [via WEKA] <[hidden email]> wrote:



Here is the first line. The first line caused an error. I had to mask things though so I don't know if it would be useful.
What does it mean for Token[] to have nothing inside the square brackets? Isn't there any way to see which field is causing the error other than manually inspecting every field?

In fact, your first problem is because of the attribute "@attribute pushff_at_nfw fatf "yyyy-MM-ff"", where you should replace it with @attribute Date date 'yyyy-MM-dd'. In addition, for the design of your data, you need to use attributes that have text only (i.e., not to keep missing attributes from string type). 

Regards,
Martin 




On Sat, Dec 24, 2016 at 12:47 AM, Martin [via WEKA] <[hidden email]> wrote:
Hi Jenna, 

Your data has a problem in the design structure. Token is any symbol, so you need to attach a sample of your data to figure it out. 

Regards, 
Martin 

On 23 December 2016 at 12:46, Jenna [via WEKA] <[hidden email]> wrote:
Hello. I have 700 plus attributes that I am trying to load into Explorer. I got the message:
"number expected, read" "Token[]"
How can I tell which one is the problem.
Also, what does Token[] mean as opposed to something like Token[FALSE]. I assume that Token[FALSE] means that it found a value of FALSE where it was expecting something else (like number) but then what does Token[] mean?


If you reply to this email, your message will be added to the discussion below:
http://weka.8497.n7.nabble.com/error-message-number-expected-read-Token-with-700-attributes-tp39066.html
To unsubscribe from WEKA, click here.
NAML




If you reply to this email, your message will be added to the discussion below:
http://weka.8497.n7.nabble.com/error-message-number-expected-read-Token-with-700-attributes-tp39066p39069.html
To unsubscribe from error message "number expected, read Token[]" with 700 attributes, click here.
NAML


sampleForForum.txt (47K) Download Attachment

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html



_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html



If you reply to this email, your message will be added to the discussion below:
http://weka.8497.n7.nabble.com/error-message-number-expected-read-Token-with-700-attributes-tp39066p39073.html
To unsubscribe from error message "number expected, read Token[]" with 700 attributes, click here.
NAML


_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html



_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: error message "number expected, read Token[]" with 700 attributes

Jenna
I didn't have drive with this account so I requested access with my normal gmail account.
By the way, I am using write.arff from R to write these files and they far too many are considered numeric. I guess the function is not that good. Here it is:

write.arff
function (x, file, eol = "\n", relation = deparse(substitute(x))) 
{
    if (file == "") 
        file <- stdout()
    else if (is.character(file)) {
        file <- file(file, "wb")
        on.exit(close(file))
    }
    if (!inherits(file, "connection")) 
        stop("Argument 'file' must be a character string or connection.")
    if (!is.data.frame(x) && !is.matrix(x)) 
        x <- data.frame(x)
    squote <- function(s) {
        ifelse(is.na(s), s, sprintf("'%s'", gsub("(['\\])", "\\\\\\1", 
            s)))
    }
    spquote <- function(s) {
        if (length(grep("^[[:alpha:]]", s)) == 0L) 
            s <- paste("X", s, sep = "")
        if (length(grep(" ", s))) 
            s <- paste("\"", s, "\"", sep = "")
        s
    }
    text <- paste("@relation", spquote(make.names(relation)))
    writeLines(text, file, sep = eol)
    for (name in colnames(x)) {
        text <- paste("@attribute", spquote(name))
        if (is.data.frame(x) && is.factor(x[[name]])) {
            lev <- squote(levels(x[[name]]))
            levels(x[[name]]) <- lev
            text <- paste(text, " {", paste(lev, collapse = ","), 
                "}", sep = "")
        }
        else if (is.character(x[, name])) {
            text <- paste(text, "string")
            x[, name] <- squote((x[, name]))
        }
        else if (inherits(x[, name], "Date")) {
            text <- paste(text, "date \"yyyy-MM-dd\"")
            x[, name] <- squote(format(x[, name]))
        }
        else if (inherits(x[, name], "POSIXt")) {
            text <- paste(text, "date \"yyyy-MM-dd HH:mm:ss\"")
            x[, name] <- squote(format(x[, name]))
        }
        else text <- paste(text, "numeric")
        writeLines(text, file, sep = eol)
    }
    writeLines("@data", file)
    write.table(x, file = file, na = "?", sep = ",", eol = eol, 
        quote = FALSE, row.names = FALSE, col.names = FALSE)
}
<bytecode: 0x0000000013c0f5b0>
<environment: namespace:foreign>



On Sun, Dec 25, 2016 at 1:05 AM, Martin [via WEKA] <[hidden email]> wrote:


Thanks Martin. I am sorry but I don't understand what you mean by " you need to use attributes that have text only (i.e., not to keep missing attributes from string type). "
Do you mean that if the entire "column" of data is empty, I should remove that attribute(column)? The data set is large (1.2 million records), so I believe every column has some non-empty records.

Yes, that's right. Avoid any sort of confusion in your data structure. Have a look at the attached file.​

Regards,
Martin



On Sun, Dec 25, 2016 at 12:08 AM, Martin [via WEKA] <[hidden email]> wrote:



Here is the first line. The first line caused an error. I had to mask things though so I don't know if it would be useful.
What does it mean for Token[] to have nothing inside the square brackets? Isn't there any way to see which field is causing the error other than manually inspecting every field?

In fact, your first problem is because of the attribute "@attribute pushff_at_nfw fatf "yyyy-MM-ff"", where you should replace it with @attribute Date date 'yyyy-MM-dd'. In addition, for the design of your data, you need to use attributes that have text only (i.e., not to keep missing attributes from string type). 

Regards,
Martin 




On Sat, Dec 24, 2016 at 12:47 AM, Martin [via WEKA] <[hidden email]> wrote:
Hi Jenna, 

Your data has a problem in the design structure. Token is any symbol, so you need to attach a sample of your data to figure it out. 

Regards, 
Martin 

On 23 December 2016 at 12:46, Jenna [via WEKA] <[hidden email]> wrote:
Hello. I have 700 plus attributes that I am trying to load into Explorer. I got the message:
"number expected, read" "Token[]"
How can I tell which one is the problem.
Also, what does Token[] mean as opposed to something like Token[FALSE]. I assume that Token[FALSE] means that it found a value of FALSE where it was expecting something else (like number) but then what does Token[] mean?


If you reply to this email, your message will be added to the discussion below:
http://weka.8497.n7.nabble.com/error-message-number-expected-read-Token-with-700-attributes-tp39066.html
To unsubscribe from WEKA, click here.
NAML




If you reply to this email, your message will be added to the discussion below:
http://weka.8497.n7.nabble.com/error-message-number-expected-read-Token-with-700-attributes-tp39066p39069.html
To unsubscribe from error message "number expected, read Token[]" with 700 attributes, click here.
NAML


sampleForForum.txt (47K) Download Attachment

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html



_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html



If you reply to this email, your message will be added to the discussion below:
http://weka.8497.n7.nabble.com/error-message-number-expected-read-Token-with-700-attributes-tp39066p39073.html
To unsubscribe from error message "number expected, read Token[]" with 700 attributes, click here.
NAML


_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html



_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html



If you reply to this email, your message will be added to the discussion below:
http://weka.8497.n7.nabble.com/error-message-number-expected-read-Token-with-700-attributes-tp39066p39075.html
To unsubscribe from error message "number expected, read Token[]" with 700 attributes, click here.
NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: error message "number expected, read Token[]" with 700 attributes

Martin
You could save your data first in a CSV file format and then load it into WEKA. 

Regards,
Martin

On 25 December 2016 at 00:10, Jenna <[hidden email]> wrote:
I didn't have drive with this account so I requested access with my normal gmail account.
By the way, I am using write.arff from R to write these files and they far too many are considered numeric. I guess the function is not that good. Here it is:

write.arff
function (x, file, eol = "\n", relation = deparse(substitute(x))) 
{
    if (file == "") 
        file <- stdout()
    else if (is.character(file)) {
        file <- file(file, "wb")
        on.exit(close(file))
    }
    if (!inherits(file, "connection")) 
        stop("Argument 'file' must be a character string or connection.")
    if (!is.data.frame(x) && !is.matrix(x)) 
        x <- data.frame(x)
    squote <- function(s) {
        ifelse(is.na(s), s, sprintf("'%s'", gsub("(['\\])", "\\\\\\1", 
            s)))
    }
    spquote <- function(s) {
        if (length(grep("^[[:alpha:]]", s)) == 0L) 
            s <- paste("X", s, sep = "")
        if (length(grep(" ", s))) 
            s <- paste("\"", s, "\"", sep = "")
        s
    }
    text <- paste("@relation", spquote(make.names(relation)))
    writeLines(text, file, sep = eol)
    for (name in colnames(x)) {
        text <- paste("@attribute", spquote(name))
        if (is.data.frame(x) && is.factor(x[[name]])) {
            lev <- squote(levels(x[[name]]))
            levels(x[[name]]) <- lev
            text <- paste(text, " {", paste(lev, collapse = ","), 
                "}", sep = "")
        }
        else if (is.character(x[, name])) {
            text <- paste(text, "string")
            x[, name] <- squote((x[, name]))
        }
        else if (inherits(x[, name], "Date")) {
            text <- paste(text, "date \"yyyy-MM-dd\"")
            x[, name] <- squote(format(x[, name]))
        }
        else if (inherits(x[, name], "POSIXt")) {
            text <- paste(text, "date \"yyyy-MM-dd HH:mm:ss\"")
            x[, name] <- squote(format(x[, name]))
        }
        else text <- paste(text, "numeric")
        writeLines(text, file, sep = eol)
    }
    writeLines("@data", file)
    write.table(x, file = file, na = "?", sep = ",", eol = eol, 
        quote = FALSE, row.names = FALSE, col.names = FALSE)
}
<bytecode: 0x0000000013c0f5b0>
<environment: namespace:foreign>



On Sun, Dec 25, 2016 at 1:05 AM, Martin [via WEKA] <[hidden email]> wrote:


Thanks Martin. I am sorry but I don't understand what you mean by " you need to use attributes that have text only (i.e., not to keep missing attributes from string type). "
Do you mean that if the entire "column" of data is empty, I should remove that attribute(column)? The data set is large (1.2 million records), so I believe every column has some non-empty records.

Yes, that's right. Avoid any sort of confusion in your data structure. Have a look at the attached file.​

Regards,
Martin



On Sun, Dec 25, 2016 at 12:08 AM, Martin [via WEKA] <[hidden email]> wrote:



Here is the first line. The first line caused an error. I had to mask things though so I don't know if it would be useful.
What does it mean for Token[] to have nothing inside the square brackets? Isn't there any way to see which field is causing the error other than manually inspecting every field?

In fact, your first problem is because of the attribute "@attribute pushff_at_nfw fatf "yyyy-MM-ff"", where you should replace it with @attribute Date date 'yyyy-MM-dd'. In addition, for the design of your data, you need to use attributes that have text only (i.e., not to keep missing attributes from string type). 

Regards,
Martin 




On Sat, Dec 24, 2016 at 12:47 AM, Martin [via WEKA] <[hidden email]> wrote:
Hi Jenna, 

Your data has a problem in the design structure. Token is any symbol, so you need to attach a sample of your data to figure it out. 

Regards, 
Martin 

On 23 December 2016 at 12:46, Jenna [via WEKA] <[hidden email]> wrote:
Hello. I have 700 plus attributes that I am trying to load into Explorer. I got the message:
"number expected, read" "Token[]"
How can I tell which one is the problem.
Also, what does Token[] mean as opposed to something like Token[FALSE]. I assume that Token[FALSE] means that it found a value of FALSE where it was expecting something else (like number) but then what does Token[] mean?


If you reply to this email, your message will be added to the discussion below:
http://weka.8497.n7.nabble.com/error-message-number-expected-read-Token-with-700-attributes-tp39066.html
To unsubscribe from WEKA, click here.
NAML




If you reply to this email, your message will be added to the discussion below:
http://weka.8497.n7.nabble.com/error-message-number-expected-read-Token-with-700-attributes-tp39066p39069.html
To unsubscribe from error message "number expected, read Token[]" with 700 attributes, click here.
NAML


sampleForForum.txt (47K) Download Attachment

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html



_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html



If you reply to this email, your message will be added to the discussion below:
http://weka.8497.n7.nabble.com/error-message-number-expected-read-Token-with-700-attributes-tp39066p39073.html
To unsubscribe from error message "number expected, read Token[]" with 700 attributes, click here.
NAML


_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html



_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html



If you reply to this email, your message will be added to the discussion below:
http://weka.8497.n7.nabble.com/error-message-number-expected-read-Token-with-700-attributes-tp39066p39075.html
To unsubscribe from error message "number expected, read Token[]" with 700 attributes, click here.
NAML


_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html



_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: error message "number expected, read Token[]" with 700 attributes

Michael Hall
In reply to this post by Jenna
On Dec 24, 2016, at 10:10 AM, Jenna <[hidden email]> wrote:


    write.table(x, file = file, na = "?", sep = ",", eol = eol, 
        quote = FALSE, row.names = FALSE, col.names = FALSE)
}
<bytecode: 0x0000000013c0f5b0>
<environment: namespace:foreign>

You might try write.arff from the RWeka package instead of the foreign package.
This does look like it’s doing the ‘right thing’ for na’s in changing them to ? characters but it might not do this for empty strings.
You could preprocess your data to either convert the empty strings to na’s or directly to the ? character yourself.

Michael Hall





_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: error message "number expected, read Token[]" with 700 attributes

Eibe Frank-2
Administrator
In reply to this post by Jenna
They are fine if they occur in a string attribute but the error message indicates that they occur in your data when a numeric attribute value is expected.

Cheers,
Eibe

> On 24 Dec 2016, at 20:50, Jenna <[hidden email]> wrote:
>
> Thank you. So empty string is generally not allowed?
>
> On Sat, Dec 24, 2016 at 4:49 PM, Eibe Frank-2 [via WEKA] <[hidden email]> wrote:
> It looks like several of the attributes have an empty string as their value (''), which is consistent with the error message you report. Maybe replace them with a question mark (WEKA's indicator for a missing value).
>
> Cheers,
> Eibe
>
> > On 24 Dec 2016, at 14:28, Jenna <[hidden email]> wrote:
> >
> > Here is the first line. The first line caused an error. I had to mask things though so I don't know if it would be useful.
> > What does it mean for Token[] to have nothing inside the square brackets? Isn't there any way to see which field is causing the error other than manually inspecting every field?
> >
> >
> >
> >
> > On Sat, Dec 24, 2016 at 12:47 AM, Martin [via WEKA] <[hidden email]> wrote:
>
> > Hi Jenna,
> >
> > Your data has a problem in the design structure. Token is any symbol, so you need to attach a sample of your data to figure it out.
> >
> > Regards,
> > Martin
> >
> > On 23 December 2016 at 12:46, Jenna [via WEKA] <[hidden email]> wrote:
> > Hello. I have 700 plus attributes that I am trying to load into Explorer. I got the message:
> > "number expected, read" "Token[]"
> > How can I tell which one is the problem.
> > Also, what does Token[] mean as opposed to something like Token[FALSE]. I assume that Token[FALSE] means that it found a value of FALSE where it was expecting something else (like number) but then what does Token[] mean?
> >
> > If you reply to this email, your message will be added to the discussion below:
> > http://weka.8497.n7.nabble.com/error-message-number-expected-read-Token-with-700-attributes-tp39066.html
> > To unsubscribe from WEKA, click here.
> > NAML
> >
> >
> >
> > If you reply to this email, your message will be added to the discussion below:
> > http://weka.8497.n7.nabble.com/error-message-number-expected-read-Token-with-700-attributes-tp39066p39069.html
> > To unsubscribe from error message "number expected, read Token[]" with 700 attributes, click here.
> > NAML
> >
> >
> >  sampleForForum.txt (47K) Download Attachment
> >
> > View this message in context: Re: error message "number expected, read Token[]" with 700 attributes
> > Sent from the WEKA mailing list archive at Nabble.com.
> > _______________________________________________
> > Wekalist mailing list
> > Send posts to: [hidden email]
> > List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
> > List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
>
> _______________________________________________
> Wekalist mailing list
> Send posts to: [hidden email]
> List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
> List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
>
>
> If you reply to this email, your message will be added to the discussion below:
> http://weka.8497.n7.nabble.com/error-message-number-expected-read-Token-with-700-attributes-tp39066p39071.html
> To unsubscribe from error message "number expected, read Token[]" with 700 attributes, click here.
> NAML
>
>
> View this message in context: Re: error message "number expected, read Token[]" with 700 attributes
> Sent from the WEKA mailing list archive at Nabble.com.
> _______________________________________________
> Wekalist mailing list
> Send posts to: [hidden email]
> List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
> List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Loading...