You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by "Rares Vernica (Created) (JIRA)" <ji...@apache.org> on 2012/01/25 21:19:40 UTC

[jira] [Created] (MAHOUT-959) VectorWritable does not preserve the laxPrecision flag

VectorWritable does not preserve the laxPrecision flag
------------------------------------------------------

                 Key: MAHOUT-959
                 URL: https://issues.apache.org/jira/browse/MAHOUT-959
             Project: Mahout
          Issue Type: Bug
          Components: Math
    Affects Versions: 0.6
            Reporter: Rares Vernica


When reading a vector, VectorWritable uses the laxPrecision flag to read with the right precision, but it does not preserve the flag in case the vector is written back.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (MAHOUT-959) VectorWritable does not preserve the laxPrecision flag

Posted by "Rares Vernica (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MAHOUT-959?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rares Vernica updated MAHOUT-959:
---------------------------------

    Attachment: VerctorWritable-laxPrecicison.patch

Patch from trunk against revision 1235897 that fixes the issue.
                
> VectorWritable does not preserve the laxPrecision flag
> ------------------------------------------------------
>
>                 Key: MAHOUT-959
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-959
>             Project: Mahout
>          Issue Type: Bug
>          Components: Math
>    Affects Versions: 0.6
>            Reporter: Rares Vernica
>         Attachments: VerctorWritable-laxPrecicison.patch
>
>
> When reading a vector, VectorWritable uses the laxPrecision flag to read with the right precision, but it does not preserve the flag in case the vector is written back.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MAHOUT-959) VectorWritable does not preserve the laxPrecision flag

Posted by "Rares Vernica (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MAHOUT-959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13194077#comment-13194077 ] 

Rares Vernica commented on MAHOUT-959:
--------------------------------------

bq. Your change does not 'fix' this.

I understood this. I stopped advocating my patch a few comments ago. :-)

bq. The point is saving I/O and disk space.

That is exactly what I meant.
                
> VectorWritable does not preserve the laxPrecision flag
> ------------------------------------------------------
>
>                 Key: MAHOUT-959
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-959
>             Project: Mahout
>          Issue Type: Bug
>          Components: Math
>    Affects Versions: 0.6
>            Reporter: Rares Vernica
>            Assignee: Sean Owen
>         Attachments: MAHOUT-959.patch, VerctorWritable-laxPrecicison.patch
>
>
> When reading a vector, VectorWritable uses the laxPrecision flag to read with the right precision, but it does not preserve the flag in case the vector is written back.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MAHOUT-959) VectorWritable does not preserve the laxPrecision flag

Posted by "Dmitriy Lyubimov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MAHOUT-959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13193369#comment-13193369 ] 

Dmitriy Lyubimov commented on MAHOUT-959:
-----------------------------------------

another way to handle it is perhaps to have a flag that is off by default and that enables last read precision inheritance for subsequent writes, which is what the author seems to desire here. But that can't be the default behavior IMO.
                
> VectorWritable does not preserve the laxPrecision flag
> ------------------------------------------------------
>
>                 Key: MAHOUT-959
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-959
>             Project: Mahout
>          Issue Type: Bug
>          Components: Math
>    Affects Versions: 0.6
>            Reporter: Rares Vernica
>            Assignee: Dmitriy Lyubimov
>             Fix For: 0.6, 0.7
>
>         Attachments: VerctorWritable-laxPrecicison.patch
>
>
> When reading a vector, VectorWritable uses the laxPrecision flag to read with the right precision, but it does not preserve the flag in case the vector is written back.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MAHOUT-959) VectorWritable does not preserve the laxPrecision flag

Posted by "Dmitriy Lyubimov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MAHOUT-959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13193366#comment-13193366 ] 

Dmitriy Lyubimov commented on MAHOUT-959:
-----------------------------------------

Hm. After applying the patch and looking at the code for the second time, i am tentatively changing vote to -1 on this, seeking for more input (perhaps from Ted)?

What this patch really does, is ensuring that the next vector set into writable will be written lax or not based on last read operation of such wrtable envelope. 

This doesn't seem conceptually coherent: 
* last vector read is not necessarily the same vector written. So perhaps nothing necessarily connects read data and data written  logically. 
* VectorWritable is just a serialization envelope, but not the actual data object. Hence, laxPrecision acts here as property of serialization only, but not actual vector use (the vector itself will always be using double arithmetics precision once materialized). 

Perhaps this patch should really address interrogation of last read operation for precision and then set that (if desired) for all writes from now on explicitly, if that's what really meant. Not surprisingly, the method is called "writesLaxPrecision", emphasizing that is property of write serialization only. 

I would probably have added a method, something like "getLastReadLaxPrecision()" to interrogate last read precision, if that's really what is desired here. But i would keep write precision in isolation from read effects by default.


                
> VectorWritable does not preserve the laxPrecision flag
> ------------------------------------------------------
>
>                 Key: MAHOUT-959
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-959
>             Project: Mahout
>          Issue Type: Bug
>          Components: Math
>    Affects Versions: 0.6
>            Reporter: Rares Vernica
>            Assignee: Dmitriy Lyubimov
>             Fix For: 0.6, 0.7
>
>         Attachments: VerctorWritable-laxPrecicison.patch
>
>
> When reading a vector, VectorWritable uses the laxPrecision flag to read with the right precision, but it does not preserve the flag in case the vector is written back.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (MAHOUT-959) VectorWritable does not preserve the laxPrecision flag

Posted by "Jeff Eastman (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MAHOUT-959?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeff Eastman updated MAHOUT-959:
--------------------------------

    Fix Version/s: 0.6

This is a very simple patch and I'm ok with slipping it under the wire for 0.6. It's your call.
                
> VectorWritable does not preserve the laxPrecision flag
> ------------------------------------------------------
>
>                 Key: MAHOUT-959
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-959
>             Project: Mahout
>          Issue Type: Bug
>          Components: Math
>    Affects Versions: 0.6
>            Reporter: Rares Vernica
>             Fix For: 0.6, 0.7
>
>         Attachments: VerctorWritable-laxPrecicison.patch
>
>
> When reading a vector, VectorWritable uses the laxPrecision flag to read with the right precision, but it does not preserve the flag in case the vector is written back.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MAHOUT-959) VectorWritable does not preserve the laxPrecision flag

Posted by "Rares Vernica (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MAHOUT-959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13193420#comment-13193420 ] 

Rares Vernica commented on MAHOUT-959:
--------------------------------------

My original vectors are floats and after they are read I was hoping to have them written back as floats by default or be able to detect they were floats. But I guess you don't end up writing back your input data very often. It would have been a nice feature to have if the resolution was just the original patch, but since I misunderstood the structure I am fine with the resolution. Thanks for clarifying!
                
> VectorWritable does not preserve the laxPrecision flag
> ------------------------------------------------------
>
>                 Key: MAHOUT-959
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-959
>             Project: Mahout
>          Issue Type: Bug
>          Components: Math
>    Affects Versions: 0.6
>            Reporter: Rares Vernica
>            Assignee: Sean Owen
>         Attachments: MAHOUT-959.patch, VerctorWritable-laxPrecicison.patch
>
>
> When reading a vector, VectorWritable uses the laxPrecision flag to read with the right precision, but it does not preserve the flag in case the vector is written back.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (MAHOUT-959) VectorWritable does not preserve the laxPrecision flag

Posted by "Dmitriy Lyubimov (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MAHOUT-959?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dmitriy Lyubimov reassigned MAHOUT-959:
---------------------------------------

    Assignee: Dmitriy Lyubimov
    
> VectorWritable does not preserve the laxPrecision flag
> ------------------------------------------------------
>
>                 Key: MAHOUT-959
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-959
>             Project: Mahout
>          Issue Type: Bug
>          Components: Math
>    Affects Versions: 0.6
>            Reporter: Rares Vernica
>            Assignee: Dmitriy Lyubimov
>             Fix For: 0.6, 0.7
>
>         Attachments: VerctorWritable-laxPrecicison.patch
>
>
> When reading a vector, VectorWritable uses the laxPrecision flag to read with the right precision, but it does not preserve the flag in case the vector is written back.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MAHOUT-959) VectorWritable does not preserve the laxPrecision flag

Posted by "Dmitriy Lyubimov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MAHOUT-959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13193329#comment-13193329 ] 

Dmitriy Lyubimov commented on MAHOUT-959:
-----------------------------------------

Ok, i will push it tonight.

Thanks to Rares.
                
> VectorWritable does not preserve the laxPrecision flag
> ------------------------------------------------------
>
>                 Key: MAHOUT-959
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-959
>             Project: Mahout
>          Issue Type: Bug
>          Components: Math
>    Affects Versions: 0.6
>            Reporter: Rares Vernica
>            Assignee: Dmitriy Lyubimov
>             Fix For: 0.6, 0.7
>
>         Attachments: VerctorWritable-laxPrecicison.patch
>
>
> When reading a vector, VectorWritable uses the laxPrecision flag to read with the right precision, but it does not preserve the flag in case the vector is written back.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MAHOUT-959) VectorWritable does not preserve the laxPrecision flag

Posted by "Sean Owen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MAHOUT-959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13193682#comment-13193682 ] 

Sean Owen commented on MAHOUT-959:
----------------------------------

Writable is an agent for serialization, not data itself. In practice, the code that writes and reads data would rarely share a Writable. I suppose I would find it surprising if reading one vector affected how another potentially unrelated vector was written, as I don't think any Writable I know works this way.

There is no parallel set of in-memory representations for Vector that use float; it would add complexity but it would be nice to have. Your change does not 'fix' this. The point is not saving RAM; the Writable's role is serialization to network or storage. The point is saving I/O and disk space.

@Ted no it's quite simple to remember this, just needs a bit, and in fact has long recorded and read this in serialized form.
                
> VectorWritable does not preserve the laxPrecision flag
> ------------------------------------------------------
>
>                 Key: MAHOUT-959
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-959
>             Project: Mahout
>          Issue Type: Bug
>          Components: Math
>    Affects Versions: 0.6
>            Reporter: Rares Vernica
>            Assignee: Sean Owen
>         Attachments: MAHOUT-959.patch, VerctorWritable-laxPrecicison.patch
>
>
> When reading a vector, VectorWritable uses the laxPrecision flag to read with the right precision, but it does not preserve the flag in case the vector is written back.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (MAHOUT-959) VectorWritable does not preserve the laxPrecision flag

Posted by "Sean Owen (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MAHOUT-959?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sean Owen updated MAHOUT-959:
-----------------------------

       Resolution: Not A Problem
    Fix Version/s:     (was: 0.7)
                       (was: 0.6)
         Assignee: Sean Owen  (was: Dmitriy Lyubimov)
           Status: Resolved  (was: Patch Available)

I wrote VectorWritable so I can explain it. 

I disagree with the issue report since readVector() does read the flag and does use it to read floats or doubles correctly.

writesLaxPrecision is a flag that is used for writing only. It tells the wrapper whether to use floats or doubles when writing, since this is not a property of the Vector implementation itself (all use doubles).
                
> VectorWritable does not preserve the laxPrecision flag
> ------------------------------------------------------
>
>                 Key: MAHOUT-959
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-959
>             Project: Mahout
>          Issue Type: Bug
>          Components: Math
>    Affects Versions: 0.6
>            Reporter: Rares Vernica
>            Assignee: Sean Owen
>         Attachments: VerctorWritable-laxPrecicison.patch
>
>
> When reading a vector, VectorWritable uses the laxPrecision flag to read with the right precision, but it does not preserve the flag in case the vector is written back.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MAHOUT-959) VectorWritable does not preserve the laxPrecision flag

Posted by "Sean Owen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MAHOUT-959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13193449#comment-13193449 ] 

Sean Owen commented on MAHOUT-959:
----------------------------------

No, this is wrong. The vectors are most certainly read back as they are written. That is why there is a flag written into the 'header'. This is *not* the same as laxPrecision.

The issue is this: when serializing / writing a vector, which in memory always uses a double, how do you specify that it should be written as floats? that is the one and only purpose of laxPrecision in VectorWritable. It has no role in reading a vector. When reading a vector, the serialized form says whether the data is 'lax' or not.
                
> VectorWritable does not preserve the laxPrecision flag
> ------------------------------------------------------
>
>                 Key: MAHOUT-959
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-959
>             Project: Mahout
>          Issue Type: Bug
>          Components: Math
>    Affects Versions: 0.6
>            Reporter: Rares Vernica
>            Assignee: Sean Owen
>         Attachments: MAHOUT-959.patch, VerctorWritable-laxPrecicison.patch
>
>
> When reading a vector, VectorWritable uses the laxPrecision flag to read with the right precision, but it does not preserve the flag in case the vector is written back.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (MAHOUT-959) VectorWritable does not preserve the laxPrecision flag

Posted by "Dmitriy Lyubimov (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MAHOUT-959?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dmitriy Lyubimov updated MAHOUT-959:
------------------------------------

    Fix Version/s: 0.7

tentatively putting it on the 0.7 roadmap as 0.6 is currently under freeze.
                
> VectorWritable does not preserve the laxPrecision flag
> ------------------------------------------------------
>
>                 Key: MAHOUT-959
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-959
>             Project: Mahout
>          Issue Type: Bug
>          Components: Math
>    Affects Versions: 0.6
>            Reporter: Rares Vernica
>             Fix For: 0.7
>
>         Attachments: VerctorWritable-laxPrecicison.patch
>
>
> When reading a vector, VectorWritable uses the laxPrecision flag to read with the right precision, but it does not preserve the flag in case the vector is written back.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MAHOUT-959) VectorWritable does not preserve the laxPrecision flag

Posted by "Rares Vernica (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MAHOUT-959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13193462#comment-13193462 ] 

Rares Vernica commented on MAHOUT-959:
--------------------------------------

bq. The vectors are most certainly read back as they are written.

I fully understand this. I actually state this in the first sentence of the issue description.

My point was, that after VectorWritable reads some floats it might as well write them back as floats. I understand that they are used as doubles anyway, but what is the point of doubling the required storage space (by default) if they had single precision to begin with. It seemed as an easy fix, but now I see that it is not as straightforward as I thought.

It seemed strange that you have the possibility to write as float, they are read correctly as float, but what you read as float ends up written as double.
                
> VectorWritable does not preserve the laxPrecision flag
> ------------------------------------------------------
>
>                 Key: MAHOUT-959
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-959
>             Project: Mahout
>          Issue Type: Bug
>          Components: Math
>    Affects Versions: 0.6
>            Reporter: Rares Vernica
>            Assignee: Sean Owen
>         Attachments: MAHOUT-959.patch, VerctorWritable-laxPrecicison.patch
>
>
> When reading a vector, VectorWritable uses the laxPrecision flag to read with the right precision, but it does not preserve the flag in case the vector is written back.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MAHOUT-959) VectorWritable does not preserve the laxPrecision flag

Posted by "Ted Dunning (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MAHOUT-959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13193539#comment-13193539 ] 

Ted Dunning commented on MAHOUT-959:
------------------------------------

{quote}
It seemed strange that you have the possibility to write as float, they are read correctly as float, but what you read as float ends up written as double.
{quote}
It is a little strange, but as you say, there isn't any easy way for the vector itself to remember what it came from.
                
> VectorWritable does not preserve the laxPrecision flag
> ------------------------------------------------------
>
>                 Key: MAHOUT-959
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-959
>             Project: Mahout
>          Issue Type: Bug
>          Components: Math
>    Affects Versions: 0.6
>            Reporter: Rares Vernica
>            Assignee: Sean Owen
>         Attachments: MAHOUT-959.patch, VerctorWritable-laxPrecicison.patch
>
>
> When reading a vector, VectorWritable uses the laxPrecision flag to read with the right precision, but it does not preserve the flag in case the vector is written back.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (MAHOUT-959) VectorWritable does not preserve the laxPrecision flag

Posted by "Sean Owen (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MAHOUT-959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13193682#comment-13193682 ] 

Sean Owen edited comment on MAHOUT-959 at 1/26/12 9:46 AM:
-----------------------------------------------------------

Writable is an agent for serialization, not data itself. In practice, the code that writes and reads data would rarely share a Writable. I suppose I would find it surprising if reading one vector affected how another potentially unrelated vector was written, as I don't think any Writable I know works this way.

There is no parallel set of in-memory representations for Vector that use float; it would add complexity but it would be nice to have. Your change does not 'fix' this. The point is not saving RAM; the Writable's role is serialization to network or storage. The point is saving I/O and disk space.

@Ted edited to say: yes you are right that Vector does not track its lax-ness; the serialized form certainly does.
                
      was (Author: srowen):
    Writable is an agent for serialization, not data itself. In practice, the code that writes and reads data would rarely share a Writable. I suppose I would find it surprising if reading one vector affected how another potentially unrelated vector was written, as I don't think any Writable I know works this way.

There is no parallel set of in-memory representations for Vector that use float; it would add complexity but it would be nice to have. Your change does not 'fix' this. The point is not saving RAM; the Writable's role is serialization to network or storage. The point is saving I/O and disk space.

@Ted no it's quite simple to remember this, just needs a bit, and in fact has long recorded and read this in serialized form.
                  
> VectorWritable does not preserve the laxPrecision flag
> ------------------------------------------------------
>
>                 Key: MAHOUT-959
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-959
>             Project: Mahout
>          Issue Type: Bug
>          Components: Math
>    Affects Versions: 0.6
>            Reporter: Rares Vernica
>            Assignee: Sean Owen
>         Attachments: MAHOUT-959.patch, VerctorWritable-laxPrecicison.patch
>
>
> When reading a vector, VectorWritable uses the laxPrecision flag to read with the right precision, but it does not preserve the flag in case the vector is written back.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MAHOUT-959) VectorWritable does not preserve the laxPrecision flag

Posted by "Dmitriy Lyubimov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MAHOUT-959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13193407#comment-13193407 ] 

Dmitriy Lyubimov commented on MAHOUT-959:
-----------------------------------------

bq. There is no way of knowing that it was originally written with laxPrecision=true.

do you want to know? What's the use case? 

Like i said, Mahout in-core computation and all vector materializations will be double precision regardless whether they come from single-precision serialized state anyway. So it's not that it could really matter once vector is materialized. 
                
> VectorWritable does not preserve the laxPrecision flag
> ------------------------------------------------------
>
>                 Key: MAHOUT-959
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-959
>             Project: Mahout
>          Issue Type: Bug
>          Components: Math
>    Affects Versions: 0.6
>            Reporter: Rares Vernica
>            Assignee: Sean Owen
>         Attachments: MAHOUT-959.patch, VerctorWritable-laxPrecicison.patch
>
>
> When reading a vector, VectorWritable uses the laxPrecision flag to read with the right precision, but it does not preserve the flag in case the vector is written back.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MAHOUT-959) VectorWritable does not preserve the laxPrecision flag

Posted by "Dmitriy Lyubimov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MAHOUT-959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13193386#comment-13193386 ] 

Dmitriy Lyubimov commented on MAHOUT-959:
-----------------------------------------

yes, agree with Sean.
                
> VectorWritable does not preserve the laxPrecision flag
> ------------------------------------------------------
>
>                 Key: MAHOUT-959
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-959
>             Project: Mahout
>          Issue Type: Bug
>          Components: Math
>    Affects Versions: 0.6
>            Reporter: Rares Vernica
>            Assignee: Sean Owen
>         Attachments: MAHOUT-959.patch, VerctorWritable-laxPrecicison.patch
>
>
> When reading a vector, VectorWritable uses the laxPrecision flag to read with the right precision, but it does not preserve the flag in case the vector is written back.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (MAHOUT-959) VectorWritable does not preserve the laxPrecision flag

Posted by "Rares Vernica (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MAHOUT-959?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rares Vernica updated MAHOUT-959:
---------------------------------

    Status: Patch Available  (was: Open)

The attached patch fixes the issue.
                
> VectorWritable does not preserve the laxPrecision flag
> ------------------------------------------------------
>
>                 Key: MAHOUT-959
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-959
>             Project: Mahout
>          Issue Type: Bug
>          Components: Math
>    Affects Versions: 0.6
>            Reporter: Rares Vernica
>         Attachments: VerctorWritable-laxPrecicison.patch
>
>
> When reading a vector, VectorWritable uses the laxPrecision flag to read with the right precision, but it does not preserve the flag in case the vector is written back.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (MAHOUT-959) VectorWritable does not preserve the laxPrecision flag

Posted by "Dmitriy Lyubimov (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MAHOUT-959?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dmitriy Lyubimov updated MAHOUT-959:
------------------------------------

    Attachment: MAHOUT-959.patch

for illustrative purposes, i am enclosing my version of the issue to demonstrate what i mean.
                
> VectorWritable does not preserve the laxPrecision flag
> ------------------------------------------------------
>
>                 Key: MAHOUT-959
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-959
>             Project: Mahout
>          Issue Type: Bug
>          Components: Math
>    Affects Versions: 0.6
>            Reporter: Rares Vernica
>            Assignee: Sean Owen
>         Attachments: MAHOUT-959.patch, VerctorWritable-laxPrecicison.patch
>
>
> When reading a vector, VectorWritable uses the laxPrecision flag to read with the right precision, but it does not preserve the flag in case the vector is written back.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MAHOUT-959) VectorWritable does not preserve the laxPrecision flag

Posted by "Dmitriy Lyubimov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MAHOUT-959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13193292#comment-13193292 ] 

Dmitriy Lyubimov commented on MAHOUT-959:
-----------------------------------------

looks simple enough. if it is ok, i'd commit it to 0.6 target.
                
> VectorWritable does not preserve the laxPrecision flag
> ------------------------------------------------------
>
>                 Key: MAHOUT-959
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-959
>             Project: Mahout
>          Issue Type: Bug
>          Components: Math
>    Affects Versions: 0.6
>            Reporter: Rares Vernica
>             Fix For: 0.7
>
>         Attachments: VerctorWritable-laxPrecicison.patch
>
>
> When reading a vector, VectorWritable uses the laxPrecision flag to read with the right precision, but it does not preserve the flag in case the vector is written back.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MAHOUT-959) VectorWritable does not preserve the laxPrecision flag

Posted by "Rares Vernica (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MAHOUT-959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13193405#comment-13193405 ] 

Rares Vernica commented on MAHOUT-959:
--------------------------------------

OK, I see. I agree that VectorWritable is just an envelope and the flags might differ from vector to vector. So, just to get this right, if when you read a  VectorWritable written with {{laxPrecision=true}} the follwoing are true:

# It won't be written back with {{laxPrecision=true}} by default;
# There is no way of knowing that it was originally written with {{laxPrecision=true}}.

                
> VectorWritable does not preserve the laxPrecision flag
> ------------------------------------------------------
>
>                 Key: MAHOUT-959
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-959
>             Project: Mahout
>          Issue Type: Bug
>          Components: Math
>    Affects Versions: 0.6
>            Reporter: Rares Vernica
>            Assignee: Sean Owen
>         Attachments: MAHOUT-959.patch, VerctorWritable-laxPrecicison.patch
>
>
> When reading a vector, VectorWritable uses the laxPrecision flag to read with the right precision, but it does not preserve the flag in case the vector is written back.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira