You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by "Grant Ingersoll (Created) (JIRA)" <ji...@apache.org> on 2011/11/30 18:05:40 UTC

[jira] [Created] (MAHOUT-904) SplitInput should support randomizing the input

SplitInput should support randomizing the input
-----------------------------------------------

                 Key: MAHOUT-904
                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
             Project: Mahout
          Issue Type: Improvement
            Reporter: Grant Ingersoll
            Assignee: Grant Ingersoll


For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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

        

Re: [jira] [Commented] (MAHOUT-904) SplitInput should support randomizing the input

Posted by Grant Ingersoll <gs...@apache.org>.
What about just having the intermediate key be Text and just taking the original key adding some separator and then tacking on the random number and then in the reducer stripping off the random number?

On Dec 21, 2011, at 9:06 AM, Raphael Cendrillon wrote:

> Thanks Lance and Grant. My concern is that the current approach I've adopted is a bit of a hack, which is why I'm interested to hear your suggestions. 
> 
> I've thought about this a bit more, and there's a cleaner implementation for this (I'll post a new patch shortly). Basically I'm thinking we can leave the keys and values as they are and do the random permutation using a custom comparator that just generates a random number in the compare operation. 
> 
> The advantage of this is that since the key and value don't need to be packed together, no new value class is needed for the mapper output, avoiding the ObjectWritable issue.
> 
> The only painful thing at the moment is that having full control over the output directories for the test and training data requires MultipleOutputFormat, which explicitly tests to make sure that the new API is not being used, so a little bit of rewriting is required to use the old API. 
> 
> Thanks for your help!
> 
> On Dec 21, 2011, at 5:45 AM, Grant Ingersoll <gs...@apache.org> wrote:
> 
>> I'd suggest we stick w/ what you have for now and we can generalize later if needed.
>> 
>> On Dec 19, 2011, at 3:08 AM, Raphael Cendrillon wrote:
>> 
>>> That's a very good point.  Using this type of framework will make things much cleaner.
>>> 
>>> This comment (from the top of the TupleWritable file) is what makes me a little concerned:
>>> 
>>> This is *not* a general-purpose tuple type. In almost all cases, users are encouraged to implement their own serializable types, which can perform better validation and provide more efficient encodings than this class is capable. TupleWritable relies on the join framework for type safety and assumes its instances will rarely be persisted, assumptions not only incompatible with, but contrary to the general case.
>>> 
>>> If we don't mind storing the class name, would it be better to use ObjectWritable for the vector, or whatever else happens to be there?
>>> 
>>> 
>>> On 18 Dec, 2011, at 11:26 PM, Lance Norskog wrote:
>>> 
>>>> But the Writables in each tuple include a vector which could be
>>>> hundreds of doubles. It's not a big deal.
>>>> 
>>>> On Sun, Dec 18, 2011 at 9:29 PM, Raphael Cendrillon
>>>> <ce...@gmail.com> wrote:
>>>>> Yes, but tuplewritable is pretty inefficient since it stores the classname with every record.  This seems wasteful given that the class is always the same.
>>>>> 
>>>>> On 18 Dec, 2011, at 9:19 PM, Lance Norskog wrote:
>>>>> 
>>>>>> JIRA is acting up, so posting here instead.
>>>>>> 
>>>>>> You have already made RandomPermuteJob extend AbstractJob. Never mind.
>>>>>> 
>>>>>> bq. Does this seem like a reasonable approach? It would require that a
>>>>>> class be created for each object type of interest which is somewhat
>>>>>> painfull. However I can't see a simpler approach since
>>>>>> setMapOutputValueClass() needs to take a class that has a default
>>>>>> constructor (and PairWritable doesn't have a default constructor since
>>>>>> it doesn't know how to call new for first and second since it doesn't
>>>>>> know what class first and second belong to).
>>>>>> 
>>>>>> TupleWritable handles this by writing the classname. Looking at this
>>>>>> again, can't this just use TupleWritable?
>>>>>> 
>>>>>> http://grepcode.com/file/repo1.maven.org/maven2/org.jvnet.hudson.hadoop/hadoop-core/0.19.1-hudson-3/org/apache/hadoop/mapred/join/TupleWritable.java
>>>>>> 
>>>>>> On Sun, Dec 18, 2011 at 7:48 PM, Raphael Cendrillon (Commented) (JIRA)
>>>>>> <ji...@apache.org> wrote:
>>>>>>> 
>>>>>>> [ https://issues.apache.org/jira/browse/MAHOUT-904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13172021#comment-13172021 ]
>>>>>>> 
>>>>>>> Raphael Cendrillon commented on MAHOUT-904:
>>>>>>> -------------------------------------------
>>>>>>> 
>>>>>>> Hi Lance. Is that a general comment, or specifically for the issue regarding PairWritable/IntVectorWritable?
>>>>>>> 
>>>>>>>> SplitInput should support randomizing the input
>>>>>>>> -----------------------------------------------
>>>>>>>> 
>>>>>>>>              Key: MAHOUT-904
>>>>>>>>              URL: https://issues.apache.org/jira/browse/MAHOUT-904
>>>>>>>>          Project: Mahout
>>>>>>>>       Issue Type: Improvement
>>>>>>>>         Reporter: Grant Ingersoll
>>>>>>>>         Assignee: Raphael Cendrillon
>>>>>>>>           Labels: MAHOUT_INTRO_CONTRIBUTE
>>>>>>>>      Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>>>>>>>> 
>>>>>>>> 
>>>>>>>> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.
>>>>>>> 
>>>>>>> --
>>>>>>> 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
>>>>>>> 
>>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> --
>>>>>> Lance Norskog
>>>>>> goksron@gmail.com
>>>>> 
>>>> 
>>>> 
>>>> 
>>>> -- 
>>>> Lance Norskog
>>>> goksron@gmail.com
>>> 
>> 
>> --------------------------------------------
>> Grant Ingersoll
>> http://www.lucidimagination.com
>> 
>> 
>> 

--------------------------------------------
Grant Ingersoll
http://www.lucidimagination.com




Re: [jira] [Commented] (MAHOUT-904) SplitInput should support randomizing the input

Posted by Raphael Cendrillon <ce...@gmail.com>.
Thanks Lance and Grant. My concern is that the current approach I've adopted is a bit of a hack, which is why I'm interested to hear your suggestions. 

I've thought about this a bit more, and there's a cleaner implementation for this (I'll post a new patch shortly). Basically I'm thinking we can leave the keys and values as they are and do the random permutation using a custom comparator that just generates a random number in the compare operation. 

The advantage of this is that since the key and value don't need to be packed together, no new value class is needed for the mapper output, avoiding the ObjectWritable issue.

The only painful thing at the moment is that having full control over the output directories for the test and training data requires MultipleOutputFormat, which explicitly tests to make sure that the new API is not being used, so a little bit of rewriting is required to use the old API. 

Thanks for your help!

On Dec 21, 2011, at 5:45 AM, Grant Ingersoll <gs...@apache.org> wrote:

> I'd suggest we stick w/ what you have for now and we can generalize later if needed.
> 
> On Dec 19, 2011, at 3:08 AM, Raphael Cendrillon wrote:
> 
>> That's a very good point.  Using this type of framework will make things much cleaner.
>> 
>> This comment (from the top of the TupleWritable file) is what makes me a little concerned:
>> 
>> This is *not* a general-purpose tuple type. In almost all cases, users are encouraged to implement their own serializable types, which can perform better validation and provide more efficient encodings than this class is capable. TupleWritable relies on the join framework for type safety and assumes its instances will rarely be persisted, assumptions not only incompatible with, but contrary to the general case.
>> 
>> If we don't mind storing the class name, would it be better to use ObjectWritable for the vector, or whatever else happens to be there?
>> 
>> 
>> On 18 Dec, 2011, at 11:26 PM, Lance Norskog wrote:
>> 
>>> But the Writables in each tuple include a vector which could be
>>> hundreds of doubles. It's not a big deal.
>>> 
>>> On Sun, Dec 18, 2011 at 9:29 PM, Raphael Cendrillon
>>> <ce...@gmail.com> wrote:
>>>> Yes, but tuplewritable is pretty inefficient since it stores the classname with every record.  This seems wasteful given that the class is always the same.
>>>> 
>>>> On 18 Dec, 2011, at 9:19 PM, Lance Norskog wrote:
>>>> 
>>>>> JIRA is acting up, so posting here instead.
>>>>> 
>>>>> You have already made RandomPermuteJob extend AbstractJob. Never mind.
>>>>> 
>>>>> bq. Does this seem like a reasonable approach? It would require that a
>>>>> class be created for each object type of interest which is somewhat
>>>>> painfull. However I can't see a simpler approach since
>>>>> setMapOutputValueClass() needs to take a class that has a default
>>>>> constructor (and PairWritable doesn't have a default constructor since
>>>>> it doesn't know how to call new for first and second since it doesn't
>>>>> know what class first and second belong to).
>>>>> 
>>>>> TupleWritable handles this by writing the classname. Looking at this
>>>>> again, can't this just use TupleWritable?
>>>>> 
>>>>> http://grepcode.com/file/repo1.maven.org/maven2/org.jvnet.hudson.hadoop/hadoop-core/0.19.1-hudson-3/org/apache/hadoop/mapred/join/TupleWritable.java
>>>>> 
>>>>> On Sun, Dec 18, 2011 at 7:48 PM, Raphael Cendrillon (Commented) (JIRA)
>>>>> <ji...@apache.org> wrote:
>>>>>> 
>>>>>>  [ https://issues.apache.org/jira/browse/MAHOUT-904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13172021#comment-13172021 ]
>>>>>> 
>>>>>> Raphael Cendrillon commented on MAHOUT-904:
>>>>>> -------------------------------------------
>>>>>> 
>>>>>> Hi Lance. Is that a general comment, or specifically for the issue regarding PairWritable/IntVectorWritable?
>>>>>> 
>>>>>>> SplitInput should support randomizing the input
>>>>>>> -----------------------------------------------
>>>>>>> 
>>>>>>>               Key: MAHOUT-904
>>>>>>>               URL: https://issues.apache.org/jira/browse/MAHOUT-904
>>>>>>>           Project: Mahout
>>>>>>>        Issue Type: Improvement
>>>>>>>          Reporter: Grant Ingersoll
>>>>>>>          Assignee: Raphael Cendrillon
>>>>>>>            Labels: MAHOUT_INTRO_CONTRIBUTE
>>>>>>>       Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>>>>>>> 
>>>>>>> 
>>>>>>> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.
>>>>>> 
>>>>>> --
>>>>>> 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
>>>>>> 
>>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> --
>>>>> Lance Norskog
>>>>> goksron@gmail.com
>>>> 
>>> 
>>> 
>>> 
>>> -- 
>>> Lance Norskog
>>> goksron@gmail.com
>> 
> 
> --------------------------------------------
> Grant Ingersoll
> http://www.lucidimagination.com
> 
> 
> 

Re: [jira] [Commented] (MAHOUT-904) SplitInput should support randomizing the input

Posted by Grant Ingersoll <gs...@apache.org>.
I'd suggest we stick w/ what you have for now and we can generalize later if needed.

On Dec 19, 2011, at 3:08 AM, Raphael Cendrillon wrote:

> That's a very good point.  Using this type of framework will make things much cleaner.
> 
> This comment (from the top of the TupleWritable file) is what makes me a little concerned:
> 
> This is *not* a general-purpose tuple type. In almost all cases, users are encouraged to implement their own serializable types, which can perform better validation and provide more efficient encodings than this class is capable. TupleWritable relies on the join framework for type safety and assumes its instances will rarely be persisted, assumptions not only incompatible with, but contrary to the general case.
> 
> If we don't mind storing the class name, would it be better to use ObjectWritable for the vector, or whatever else happens to be there?
> 
> 
> On 18 Dec, 2011, at 11:26 PM, Lance Norskog wrote:
> 
>> But the Writables in each tuple include a vector which could be
>> hundreds of doubles. It's not a big deal.
>> 
>> On Sun, Dec 18, 2011 at 9:29 PM, Raphael Cendrillon
>> <ce...@gmail.com> wrote:
>>> Yes, but tuplewritable is pretty inefficient since it stores the classname with every record.  This seems wasteful given that the class is always the same.
>>> 
>>> On 18 Dec, 2011, at 9:19 PM, Lance Norskog wrote:
>>> 
>>>> JIRA is acting up, so posting here instead.
>>>> 
>>>> You have already made RandomPermuteJob extend AbstractJob. Never mind.
>>>> 
>>>> bq. Does this seem like a reasonable approach? It would require that a
>>>> class be created for each object type of interest which is somewhat
>>>> painfull. However I can't see a simpler approach since
>>>> setMapOutputValueClass() needs to take a class that has a default
>>>> constructor (and PairWritable doesn't have a default constructor since
>>>> it doesn't know how to call new for first and second since it doesn't
>>>> know what class first and second belong to).
>>>> 
>>>> TupleWritable handles this by writing the classname. Looking at this
>>>> again, can't this just use TupleWritable?
>>>> 
>>>> http://grepcode.com/file/repo1.maven.org/maven2/org.jvnet.hudson.hadoop/hadoop-core/0.19.1-hudson-3/org/apache/hadoop/mapred/join/TupleWritable.java
>>>> 
>>>> On Sun, Dec 18, 2011 at 7:48 PM, Raphael Cendrillon (Commented) (JIRA)
>>>> <ji...@apache.org> wrote:
>>>>> 
>>>>>   [ https://issues.apache.org/jira/browse/MAHOUT-904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13172021#comment-13172021 ]
>>>>> 
>>>>> Raphael Cendrillon commented on MAHOUT-904:
>>>>> -------------------------------------------
>>>>> 
>>>>> Hi Lance. Is that a general comment, or specifically for the issue regarding PairWritable/IntVectorWritable?
>>>>> 
>>>>>> SplitInput should support randomizing the input
>>>>>> -----------------------------------------------
>>>>>> 
>>>>>>                Key: MAHOUT-904
>>>>>>                URL: https://issues.apache.org/jira/browse/MAHOUT-904
>>>>>>            Project: Mahout
>>>>>>         Issue Type: Improvement
>>>>>>           Reporter: Grant Ingersoll
>>>>>>           Assignee: Raphael Cendrillon
>>>>>>             Labels: MAHOUT_INTRO_CONTRIBUTE
>>>>>>        Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>>>>>> 
>>>>>> 
>>>>>> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.
>>>>> 
>>>>> --
>>>>> 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
>>>>> 
>>>>> 
>>>> 
>>>> 
>>>> 
>>>> --
>>>> Lance Norskog
>>>> goksron@gmail.com
>>> 
>> 
>> 
>> 
>> -- 
>> Lance Norskog
>> goksron@gmail.com
> 

--------------------------------------------
Grant Ingersoll
http://www.lucidimagination.com




Re: [jira] [Commented] (MAHOUT-904) SplitInput should support randomizing the input

Posted by Lance Norskog <go...@gmail.com>.
Heck if I know. Stick with what you wrote until you decide it does not work.

On Mon, Dec 19, 2011 at 12:08 AM, Raphael Cendrillon
<ce...@gmail.com> wrote:
> That's a very good point.  Using this type of framework will make things much cleaner.
>
> This comment (from the top of the TupleWritable file) is what makes me a little concerned:
>
> This is *not* a general-purpose tuple type. In almost all cases, users are encouraged to implement their own serializable types, which can perform better validation and provide more efficient encodings than this class is capable. TupleWritable relies on the join framework for type safety and assumes its instances will rarely be persisted, assumptions not only incompatible with, but contrary to the general case.
>
> If we don't mind storing the class name, would it be better to use ObjectWritable for the vector, or whatever else happens to be there?
>
>
> On 18 Dec, 2011, at 11:26 PM, Lance Norskog wrote:
>
>> But the Writables in each tuple include a vector which could be
>> hundreds of doubles. It's not a big deal.
>>
>> On Sun, Dec 18, 2011 at 9:29 PM, Raphael Cendrillon
>> <ce...@gmail.com> wrote:
>>> Yes, but tuplewritable is pretty inefficient since it stores the classname with every record.  This seems wasteful given that the class is always the same.
>>>
>>> On 18 Dec, 2011, at 9:19 PM, Lance Norskog wrote:
>>>
>>>> JIRA is acting up, so posting here instead.
>>>>
>>>> You have already made RandomPermuteJob extend AbstractJob. Never mind.
>>>>
>>>> bq. Does this seem like a reasonable approach? It would require that a
>>>> class be created for each object type of interest which is somewhat
>>>> painfull. However I can't see a simpler approach since
>>>> setMapOutputValueClass() needs to take a class that has a default
>>>> constructor (and PairWritable doesn't have a default constructor since
>>>> it doesn't know how to call new for first and second since it doesn't
>>>> know what class first and second belong to).
>>>>
>>>> TupleWritable handles this by writing the classname. Looking at this
>>>> again, can't this just use TupleWritable?
>>>>
>>>> http://grepcode.com/file/repo1.maven.org/maven2/org.jvnet.hudson.hadoop/hadoop-core/0.19.1-hudson-3/org/apache/hadoop/mapred/join/TupleWritable.java
>>>>
>>>> On Sun, Dec 18, 2011 at 7:48 PM, Raphael Cendrillon (Commented) (JIRA)
>>>> <ji...@apache.org> wrote:
>>>>>
>>>>>    [ https://issues.apache.org/jira/browse/MAHOUT-904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13172021#comment-13172021 ]
>>>>>
>>>>> Raphael Cendrillon commented on MAHOUT-904:
>>>>> -------------------------------------------
>>>>>
>>>>> Hi Lance. Is that a general comment, or specifically for the issue regarding PairWritable/IntVectorWritable?
>>>>>
>>>>>> SplitInput should support randomizing the input
>>>>>> -----------------------------------------------
>>>>>>
>>>>>>                 Key: MAHOUT-904
>>>>>>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>>>>>>             Project: Mahout
>>>>>>          Issue Type: Improvement
>>>>>>            Reporter: Grant Ingersoll
>>>>>>            Assignee: Raphael Cendrillon
>>>>>>              Labels: MAHOUT_INTRO_CONTRIBUTE
>>>>>>         Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>>>>>>
>>>>>>
>>>>>> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.
>>>>>
>>>>> --
>>>>> 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
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Lance Norskog
>>>> goksron@gmail.com
>>>
>>
>>
>>
>> --
>> Lance Norskog
>> goksron@gmail.com
>



-- 
Lance Norskog
goksron@gmail.com

Re: [jira] [Commented] (MAHOUT-904) SplitInput should support randomizing the input

Posted by Raphael Cendrillon <ce...@gmail.com>.
That's a very good point.  Using this type of framework will make things much cleaner.

This comment (from the top of the TupleWritable file) is what makes me a little concerned:

This is *not* a general-purpose tuple type. In almost all cases, users are encouraged to implement their own serializable types, which can perform better validation and provide more efficient encodings than this class is capable. TupleWritable relies on the join framework for type safety and assumes its instances will rarely be persisted, assumptions not only incompatible with, but contrary to the general case.

If we don't mind storing the class name, would it be better to use ObjectWritable for the vector, or whatever else happens to be there?


On 18 Dec, 2011, at 11:26 PM, Lance Norskog wrote:

> But the Writables in each tuple include a vector which could be
> hundreds of doubles. It's not a big deal.
> 
> On Sun, Dec 18, 2011 at 9:29 PM, Raphael Cendrillon
> <ce...@gmail.com> wrote:
>> Yes, but tuplewritable is pretty inefficient since it stores the classname with every record.  This seems wasteful given that the class is always the same.
>> 
>> On 18 Dec, 2011, at 9:19 PM, Lance Norskog wrote:
>> 
>>> JIRA is acting up, so posting here instead.
>>> 
>>> You have already made RandomPermuteJob extend AbstractJob. Never mind.
>>> 
>>> bq. Does this seem like a reasonable approach? It would require that a
>>> class be created for each object type of interest which is somewhat
>>> painfull. However I can't see a simpler approach since
>>> setMapOutputValueClass() needs to take a class that has a default
>>> constructor (and PairWritable doesn't have a default constructor since
>>> it doesn't know how to call new for first and second since it doesn't
>>> know what class first and second belong to).
>>> 
>>> TupleWritable handles this by writing the classname. Looking at this
>>> again, can't this just use TupleWritable?
>>> 
>>> http://grepcode.com/file/repo1.maven.org/maven2/org.jvnet.hudson.hadoop/hadoop-core/0.19.1-hudson-3/org/apache/hadoop/mapred/join/TupleWritable.java
>>> 
>>> On Sun, Dec 18, 2011 at 7:48 PM, Raphael Cendrillon (Commented) (JIRA)
>>> <ji...@apache.org> wrote:
>>>> 
>>>>    [ https://issues.apache.org/jira/browse/MAHOUT-904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13172021#comment-13172021 ]
>>>> 
>>>> Raphael Cendrillon commented on MAHOUT-904:
>>>> -------------------------------------------
>>>> 
>>>> Hi Lance. Is that a general comment, or specifically for the issue regarding PairWritable/IntVectorWritable?
>>>> 
>>>>> SplitInput should support randomizing the input
>>>>> -----------------------------------------------
>>>>> 
>>>>>                 Key: MAHOUT-904
>>>>>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>>>>>             Project: Mahout
>>>>>          Issue Type: Improvement
>>>>>            Reporter: Grant Ingersoll
>>>>>            Assignee: Raphael Cendrillon
>>>>>              Labels: MAHOUT_INTRO_CONTRIBUTE
>>>>>         Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>>>>> 
>>>>> 
>>>>> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.
>>>> 
>>>> --
>>>> 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
>>>> 
>>>> 
>>> 
>>> 
>>> 
>>> --
>>> Lance Norskog
>>> goksron@gmail.com
>> 
> 
> 
> 
> -- 
> Lance Norskog
> goksron@gmail.com


Re: [jira] [Commented] (MAHOUT-904) SplitInput should support randomizing the input

Posted by Lance Norskog <go...@gmail.com>.
But the Writables in each tuple include a vector which could be
hundreds of doubles. It's not a big deal.

On Sun, Dec 18, 2011 at 9:29 PM, Raphael Cendrillon
<ce...@gmail.com> wrote:
> Yes, but tuplewritable is pretty inefficient since it stores the classname with every record.  This seems wasteful given that the class is always the same.
>
> On 18 Dec, 2011, at 9:19 PM, Lance Norskog wrote:
>
>> JIRA is acting up, so posting here instead.
>>
>> You have already made RandomPermuteJob extend AbstractJob. Never mind.
>>
>> bq. Does this seem like a reasonable approach? It would require that a
>> class be created for each object type of interest which is somewhat
>> painfull. However I can't see a simpler approach since
>> setMapOutputValueClass() needs to take a class that has a default
>> constructor (and PairWritable doesn't have a default constructor since
>> it doesn't know how to call new for first and second since it doesn't
>> know what class first and second belong to).
>>
>> TupleWritable handles this by writing the classname. Looking at this
>> again, can't this just use TupleWritable?
>>
>> http://grepcode.com/file/repo1.maven.org/maven2/org.jvnet.hudson.hadoop/hadoop-core/0.19.1-hudson-3/org/apache/hadoop/mapred/join/TupleWritable.java
>>
>> On Sun, Dec 18, 2011 at 7:48 PM, Raphael Cendrillon (Commented) (JIRA)
>> <ji...@apache.org> wrote:
>>>
>>>    [ https://issues.apache.org/jira/browse/MAHOUT-904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13172021#comment-13172021 ]
>>>
>>> Raphael Cendrillon commented on MAHOUT-904:
>>> -------------------------------------------
>>>
>>> Hi Lance. Is that a general comment, or specifically for the issue regarding PairWritable/IntVectorWritable?
>>>
>>>> SplitInput should support randomizing the input
>>>> -----------------------------------------------
>>>>
>>>>                 Key: MAHOUT-904
>>>>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>>>>             Project: Mahout
>>>>          Issue Type: Improvement
>>>>            Reporter: Grant Ingersoll
>>>>            Assignee: Raphael Cendrillon
>>>>              Labels: MAHOUT_INTRO_CONTRIBUTE
>>>>         Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>>>>
>>>>
>>>> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.
>>>
>>> --
>>> 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
>>>
>>>
>>
>>
>>
>> --
>> Lance Norskog
>> goksron@gmail.com
>



-- 
Lance Norskog
goksron@gmail.com

Re: [jira] [Commented] (MAHOUT-904) SplitInput should support randomizing the input

Posted by Raphael Cendrillon <ce...@gmail.com>.
Yes, but tuplewritable is pretty inefficient since it stores the classname with every record.  This seems wasteful given that the class is always the same.

On 18 Dec, 2011, at 9:19 PM, Lance Norskog wrote:

> JIRA is acting up, so posting here instead.
> 
> You have already made RandomPermuteJob extend AbstractJob. Never mind.
> 
> bq. Does this seem like a reasonable approach? It would require that a
> class be created for each object type of interest which is somewhat
> painfull. However I can't see a simpler approach since
> setMapOutputValueClass() needs to take a class that has a default
> constructor (and PairWritable doesn't have a default constructor since
> it doesn't know how to call new for first and second since it doesn't
> know what class first and second belong to).
> 
> TupleWritable handles this by writing the classname. Looking at this
> again, can't this just use TupleWritable?
> 
> http://grepcode.com/file/repo1.maven.org/maven2/org.jvnet.hudson.hadoop/hadoop-core/0.19.1-hudson-3/org/apache/hadoop/mapred/join/TupleWritable.java
> 
> On Sun, Dec 18, 2011 at 7:48 PM, Raphael Cendrillon (Commented) (JIRA)
> <ji...@apache.org> wrote:
>> 
>>    [ https://issues.apache.org/jira/browse/MAHOUT-904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13172021#comment-13172021 ]
>> 
>> Raphael Cendrillon commented on MAHOUT-904:
>> -------------------------------------------
>> 
>> Hi Lance. Is that a general comment, or specifically for the issue regarding PairWritable/IntVectorWritable?
>> 
>>> SplitInput should support randomizing the input
>>> -----------------------------------------------
>>> 
>>>                 Key: MAHOUT-904
>>>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>>>             Project: Mahout
>>>          Issue Type: Improvement
>>>            Reporter: Grant Ingersoll
>>>            Assignee: Raphael Cendrillon
>>>              Labels: MAHOUT_INTRO_CONTRIBUTE
>>>         Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>>> 
>>> 
>>> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.
>> 
>> --
>> 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
>> 
>> 
> 
> 
> 
> -- 
> Lance Norskog
> goksron@gmail.com


Re: [jira] [Commented] (MAHOUT-904) SplitInput should support randomizing the input

Posted by Lance Norskog <go...@gmail.com>.
JIRA is acting up, so posting here instead.

You have already made RandomPermuteJob extend AbstractJob. Never mind.

bq. Does this seem like a reasonable approach? It would require that a
class be created for each object type of interest which is somewhat
painfull. However I can't see a simpler approach since
setMapOutputValueClass() needs to take a class that has a default
constructor (and PairWritable doesn't have a default constructor since
it doesn't know how to call new for first and second since it doesn't
know what class first and second belong to).

TupleWritable handles this by writing the classname. Looking at this
again, can't this just use TupleWritable?

http://grepcode.com/file/repo1.maven.org/maven2/org.jvnet.hudson.hadoop/hadoop-core/0.19.1-hudson-3/org/apache/hadoop/mapred/join/TupleWritable.java

On Sun, Dec 18, 2011 at 7:48 PM, Raphael Cendrillon (Commented) (JIRA)
<ji...@apache.org> wrote:
>
>    [ https://issues.apache.org/jira/browse/MAHOUT-904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13172021#comment-13172021 ]
>
> Raphael Cendrillon commented on MAHOUT-904:
> -------------------------------------------
>
> Hi Lance. Is that a general comment, or specifically for the issue regarding PairWritable/IntVectorWritable?
>
>> SplitInput should support randomizing the input
>> -----------------------------------------------
>>
>>                 Key: MAHOUT-904
>>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>>             Project: Mahout
>>          Issue Type: Improvement
>>            Reporter: Grant Ingersoll
>>            Assignee: Raphael Cendrillon
>>              Labels: MAHOUT_INTRO_CONTRIBUTE
>>         Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>>
>>
>> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.
>
> --
> 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
>
>



-- 
Lance Norskog
goksron@gmail.com

Re: [jira] [Commented] (MAHOUT-904) SplitInput should support randomizing the input

Posted by Raphael Cendrillon <ce...@gmail.com>.
The biggest issue I'm having at the moment is that MultipleOutputs under 0.20 doesn't give you complete control over the output path. MultipleOutputFormat on the other hand gives complete control, but it looks like they've put some checks inside to ensure that this output format is never called from the new API.

In my case I tried going back to the old API in order to use MultipleOutputFormat, but this lead to another issue, specifically that I cannot access the configuration from generateFileNameForKeyValue().

On 22 Dec, 2011, at 7:45 AM, Ted Dunning wrote:

> It isn't clear that we will move to 0.21.  My guess is that, if anything,
> we will skip to 0.23 and try to maintain 0.20 compatibility for a long time.
> 
> On Thu, Dec 22, 2011 at 7:33 AM, Raphael Cendrillon (Commented) (JIRA) <
> jira@apache.org> wrote:
> 
>> I think this can be made a little neater once we move to Hadoop 0.21.


Re: [jira] [Commented] (MAHOUT-904) SplitInput should support randomizing the input

Posted by Ted Dunning <te...@gmail.com>.
It isn't clear that we will move to 0.21.  My guess is that, if anything,
we will skip to 0.23 and try to maintain 0.20 compatibility for a long time.

On Thu, Dec 22, 2011 at 7:33 AM, Raphael Cendrillon (Commented) (JIRA) <
jira@apache.org> wrote:

>  I think this can be made a little neater once we move to Hadoop 0.21.

[jira] [Commented] (MAHOUT-904) SplitInput should support randomizing the input

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

Raphael Cendrillon commented on MAHOUT-904:
-------------------------------------------

At the moment this is written only to handle vectors. I'm having an issue extending this to cover any record type. One option is to use a GenericWritable however this could be wasteful since the classname is stored with every record. Another approach could be to use generics, however I can't seem to use generics in setMapOutputKeyClass(). I'd like to do something like this:

  job.setMapOutputKeyClass(PairWritable<IntWritable,VectorWritable>.class);

Any suggestions would be very welcome!
                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Grant Ingersoll
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

jiraposter@reviews.apache.org commented on MAHOUT-904:
------------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/3092/#review3876
-----------------------------------------------------------


Thoughts:
this class is often run from the command line, so we should add CLI support for telling it to randomly permute.

I wonder if we should make this a map-reduce job.  Perhaps we split out the existing version and leave as is and then add a new MR one that can do the permutation.  One idea there would be to generate random keys (by appending onto the existing key) and letting the shuffle effectively do the permutations.  Then, during reduce phase we simply strip off the random part of the key and output.  I don't know how bad this would hurt the shuffle, but it seems like it would work functionally anyway.

Otherwise, the approach seems reasonable.  I don't know off hand if there is a better way of doing it (even though I wish there were).

- Grant


On 2011-12-09 08:57:18, Raphael Cendrillon wrote:
bq.  
bq.  -----------------------------------------------------------
bq.  This is an automatically generated e-mail. To reply, visit:
bq.  https://reviews.apache.org/r/3092/
bq.  -----------------------------------------------------------
bq.  
bq.  (Updated 2011-12-09 08:57:18)
bq.  
bq.  
bq.  Review request for Grant Ingersoll.
bq.  
bq.  
bq.  Summary
bq.  -------
bq.  
bq.  Early support for randomizing input in SplitInput class. This is an early start but I've posted it up just to check if I'm on the right track.  A couple of comments:
bq.  
bq.    - currently the code runs through the entire file looking for the line corresponding to the random index. This has to be repeated for every line, which is slow and somewhat ugly.
bq.    - the permutation indices are stored in an array. This could lead to scaling issues if the number of input lines is large. This problem may also exist with ridx in the existing code. One option is to use a linear feedback shift register to generate a permutation sequence on the fly.
bq.  
bq.  Any suggestions would be very welcome!
bq.  
bq.  
bq.  This addresses bug MAHOUT-904.
bq.      https://issues.apache.org/jira/browse/MAHOUT-904
bq.  
bq.  
bq.  Diffs
bq.  -----
bq.  
bq.    /trunk/integration/src/main/java/org/apache/mahout/utils/SplitInput.java 1212249 
bq.    /trunk/examples/src/test/java/org/apache/mahout/classifier/bayes/SplitBayesInputTest.java 1212249 
bq.  
bq.  Diff: https://reviews.apache.org/r/3092/diff
bq.  
bq.  
bq.  Testing
bq.  -------
bq.  
bq.  
bq.  Thanks,
bq.  
bq.  Raphael
bq.  
bq.


                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Grant Ingersoll
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

Remi Melisson updated MAHOUT-904:
---------------------------------

    Comment: was deleted

(was: Hi,
I had a look on it too, and one question remains :
Do we need to randomize all the set (training and test) or only the training data ?

@Raphael Let me know if you already started, because I planned to begin dev soon.)
    
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Grant Ingersoll
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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

        

Re: [jira] [Commented] (MAHOUT-904) SplitInput should support randomizing the input

Posted by Raphael Cendrillon <ce...@gmail.com>.
Thanks Sean. Currently I'm thinking of reading out the current key class from the SequenceFile and just propagating it through. Do you think that's reasonable?

On Dec 23, 2011, at 4:52 AM, "Sean Owen (Commented) (JIRA)" <ji...@apache.org> wrote:

> 
>    [ https://issues.apache.org/jira/browse/MAHOUT-904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13175408#comment-13175408 ] 
> 
> Sean Owen commented on MAHOUT-904:
> ----------------------------------
> 
> (I don't know if this is a relevant comment, but we ought to be using VarIntWritable and VarLongWritable, not IntWritable and LongWritable, for better space savings.)
> 
>> SplitInput should support randomizing the input
>> -----------------------------------------------
>> 
>>                Key: MAHOUT-904
>>                URL: https://issues.apache.org/jira/browse/MAHOUT-904
>>            Project: Mahout
>>         Issue Type: Improvement
>>           Reporter: Grant Ingersoll
>>           Assignee: Raphael Cendrillon
>>             Labels: MAHOUT_INTRO_CONTRIBUTE
>>        Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>> 
>> 
>> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.
> 
> --
> 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-904) SplitInput should support randomizing the input

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

Sean Owen commented on MAHOUT-904:
----------------------------------

(I don't know if this is a relevant comment, but we ought to be using VarIntWritable and VarLongWritable, not IntWritable and LongWritable, for better space savings.)
                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Raphael Cendrillon
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

Raphael Cendrillon updated MAHOUT-904:
--------------------------------------

    Attachment:     (was: MAHOUT-904.patch)
    
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Grant Ingersoll
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

Raphael Cendrillon commented on MAHOUT-904:
-------------------------------------------

I think we can replace IntWritable with WritableComparable and it should take care of this. I'll update the patch and post shortly.
                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Raphael Cendrillon
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

Raphael Cendrillon commented on MAHOUT-904:
-------------------------------------------

Hi Grant,

The diffs on reviewboard are all absolute, so you can just save the latest revision as a patch file and apply it to trunk. I'll update the attachment here as well.
                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Raphael Cendrillon
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

jiraposter@reviews.apache.org commented on MAHOUT-904:
------------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/3092/
-----------------------------------------------------------

(Updated 2011-12-16 01:37:06.294565)


Review request for Grant Ingersoll.


Changes
-------

Rewrote as map-reduce job using downsampling and random key in mapper stage. Actual key from mapper input is preserved and recovered at reducer. Added IntVectorWritable class to support concatenation of actual key with vector.


Summary
-------

Early support for randomizing input in SplitInput class. This is an early start but I've posted it up just to check if I'm on the right track.  A couple of comments:

  - currently the code runs through the entire file looking for the line corresponding to the random index. This has to be repeated for every line, which is slow and somewhat ugly.
  - the permutation indices are stored in an array. This could lead to scaling issues if the number of input lines is large. This problem may also exist with ridx in the existing code. One option is to use a linear feedback shift register to generate a permutation sequence on the fly.

Any suggestions would be very welcome!


This addresses bug MAHOUT-904.
    https://issues.apache.org/jira/browse/MAHOUT-904


Diffs (updated)
-----

  /trunk/integration/src/main/java/org/apache/mahout/utils/RandomPermuteJob.java PRE-CREATION 
  /trunk/integration/src/test/java/org/apache/mahout/utils/TestRandomPermuteJob.java PRE-CREATION 
  /trunk/integration/src/main/java/org/apache/mahout/utils/IntVectorWritable.java PRE-CREATION 

Diff: https://reviews.apache.org/r/3092/diff


Testing
-------


Thanks,

Raphael


                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Grant Ingersoll
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

jiraposter@reviews.apache.org commented on MAHOUT-904:
------------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/3092/
-----------------------------------------------------------

(Updated 2011-12-22 16:03:47.932528)


Review request for mahout, Ted Dunning, lancenorskog, and Grant Ingersoll.


Changes
-------

Grant's changes


Summary
-------

Early support for randomizing input in SplitInput class. This is an early start but I've posted it up just to check if I'm on the right track.  A couple of comments:

  - currently the code runs through the entire file looking for the line corresponding to the random index. This has to be repeated for every line, which is slow and somewhat ugly.
  - the permutation indices are stored in an array. This could lead to scaling issues if the number of input lines is large. This problem may also exist with ridx in the existing code. One option is to use a linear feedback shift register to generate a permutation sequence on the fly.

Any suggestions would be very welcome!


This addresses bug MAHOUT-904.
    https://issues.apache.org/jira/browse/MAHOUT-904


Diffs (updated)
-----

  /trunk/core/src/main/java/org/apache/mahout/common/AbstractJob.java 1222286 
  /trunk/integration/src/main/java/org/apache/mahout/utils/SplitInput.java 1222286 
  /trunk/integration/src/main/java/org/apache/mahout/utils/SplitInputJob.java PRE-CREATION 
  /trunk/integration/src/test/java/org/apache/mahout/utils/SplitInputTest.java 1222286 

Diff: https://reviews.apache.org/r/3092/diff


Testing
-------


Thanks,

Raphael


                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Raphael Cendrillon
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

Grant Ingersoll updated MAHOUT-904:
-----------------------------------

    Attachment: MAHOUT-904.patch

Adds driver, reuses Pair, not integrated into SplitInput yet.
                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Raphael Cendrillon
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

jiraposter@reviews.apache.org commented on MAHOUT-904:
------------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/3092/
-----------------------------------------------------------

Review request for Grant Ingersoll.


Summary
-------

Early support for randomizing input in SplitInput class


This addresses bug MAHOUT-904.
    https://issues.apache.org/jira/browse/MAHOUT-904


Diffs
-----

  /trunk/integration/src/main/java/org/apache/mahout/utils/SplitInput.java 1212249 
  /trunk/examples/src/test/java/org/apache/mahout/classifier/bayes/SplitBayesInputTest.java 1212249 

Diff: https://reviews.apache.org/r/3092/diff


Testing
-------


Thanks,

Raphael


                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Grant Ingersoll
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

jiraposter@reviews.apache.org commented on MAHOUT-904:
------------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/3092/
-----------------------------------------------------------

(Updated 2011-12-16 02:01:25.825802)


Review request for mahout, Ted Dunning, lancenorskog, and Grant Ingersoll.


Summary
-------

Early support for randomizing input in SplitInput class. This is an early start but I've posted it up just to check if I'm on the right track.  A couple of comments:

  - currently the code runs through the entire file looking for the line corresponding to the random index. This has to be repeated for every line, which is slow and somewhat ugly.
  - the permutation indices are stored in an array. This could lead to scaling issues if the number of input lines is large. This problem may also exist with ridx in the existing code. One option is to use a linear feedback shift register to generate a permutation sequence on the fly.

Any suggestions would be very welcome!


This addresses bug MAHOUT-904.
    https://issues.apache.org/jira/browse/MAHOUT-904


Diffs
-----

  /trunk/integration/src/main/java/org/apache/mahout/utils/RandomPermuteJob.java PRE-CREATION 
  /trunk/integration/src/test/java/org/apache/mahout/utils/TestRandomPermuteJob.java PRE-CREATION 
  /trunk/integration/src/main/java/org/apache/mahout/utils/IntVectorWritable.java PRE-CREATION 

Diff: https://reviews.apache.org/r/3092/diff


Testing
-------


Thanks,

Raphael


                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Grant Ingersoll
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

Raphael Cendrillon updated MAHOUT-904:
--------------------------------------

    Resolution: Fixed
        Status: Resolved  (was: Patch Available)
    
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Raphael Cendrillon
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>             Fix For: 0.6
>
>         Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

Raphael Cendrillon updated MAHOUT-904:
--------------------------------------

    Attachment: MAHOUT-904.patch
    
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Grant Ingersoll
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

jiraposter@reviews.apache.org commented on MAHOUT-904:
------------------------------------------------------



bq.  On 2011-12-13 13:19:13, Grant Ingersoll wrote:
bq.  > Thoughts:
bq.  > this class is often run from the command line, so we should add CLI support for telling it to randomly permute.
bq.  > 
bq.  > I wonder if we should make this a map-reduce job.  Perhaps we split out the existing version and leave as is and then add a new MR one that can do the permutation.  One idea there would be to generate random keys (by appending onto the existing key) and letting the shuffle effectively do the permutations.  Then, during reduce phase we simply strip off the random part of the key and output.  I don't know how bad this would hurt the shuffle, but it seems like it would work functionally anyway.
bq.  > 
bq.  > Otherwise, the approach seems reasonable.  I don't know off hand if there is a better way of doing it (even though I wish there were).
bq.  
bq.  Ted Dunning wrote:
bq.      Separating the randomization sounds like a nice idea.  I still think that the SGD jobs need to be able to randomize within a single map as well.
bq.      
bq.      Permuting in the shuffle should work fine.

Lance had a similar suggestion. I think there are two tasks required here. One is to randomize the training examples within a split, and the other is to randomize the order of different splits. I'll update this to use map reduce to randomize the splits aswell. Lance had a good suggestion for this based on hashing/randomizing the key.

Given that we will be parallelizing this, I guess each split should fit comfortably into memory? If that's the case randomization of the lines within a split can be done much more efficiently.


- Raphael


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/3092/#review3876
-----------------------------------------------------------


On 2011-12-09 08:57:18, Raphael Cendrillon wrote:
bq.  
bq.  -----------------------------------------------------------
bq.  This is an automatically generated e-mail. To reply, visit:
bq.  https://reviews.apache.org/r/3092/
bq.  -----------------------------------------------------------
bq.  
bq.  (Updated 2011-12-09 08:57:18)
bq.  
bq.  
bq.  Review request for Grant Ingersoll.
bq.  
bq.  
bq.  Summary
bq.  -------
bq.  
bq.  Early support for randomizing input in SplitInput class. This is an early start but I've posted it up just to check if I'm on the right track.  A couple of comments:
bq.  
bq.    - currently the code runs through the entire file looking for the line corresponding to the random index. This has to be repeated for every line, which is slow and somewhat ugly.
bq.    - the permutation indices are stored in an array. This could lead to scaling issues if the number of input lines is large. This problem may also exist with ridx in the existing code. One option is to use a linear feedback shift register to generate a permutation sequence on the fly.
bq.  
bq.  Any suggestions would be very welcome!
bq.  
bq.  
bq.  This addresses bug MAHOUT-904.
bq.      https://issues.apache.org/jira/browse/MAHOUT-904
bq.  
bq.  
bq.  Diffs
bq.  -----
bq.  
bq.    /trunk/integration/src/main/java/org/apache/mahout/utils/SplitInput.java 1212249 
bq.    /trunk/examples/src/test/java/org/apache/mahout/classifier/bayes/SplitBayesInputTest.java 1212249 
bq.  
bq.  Diff: https://reviews.apache.org/r/3092/diff
bq.  
bq.  
bq.  Testing
bq.  -------
bq.  
bq.  
bq.  Thanks,
bq.  
bq.  Raphael
bq.  
bq.


                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Grant Ingersoll
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

Raphael Cendrillon updated MAHOUT-904:
--------------------------------------

    Attachment: MAHOUT-904.patch
    
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Grant Ingersoll
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

jiraposter@reviews.apache.org commented on MAHOUT-904:
------------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/3092/
-----------------------------------------------------------

(Updated 2011-12-22 04:38:08.261769)


Review request for mahout, Ted Dunning, lancenorskog, and Grant Ingersoll.


Changes
-------

Implemented downsampling more efficiently through mapper run(), implemented random permutation through sort comparator class, added driver, integrated into SplitInput


Summary
-------

Early support for randomizing input in SplitInput class. This is an early start but I've posted it up just to check if I'm on the right track.  A couple of comments:

  - currently the code runs through the entire file looking for the line corresponding to the random index. This has to be repeated for every line, which is slow and somewhat ugly.
  - the permutation indices are stored in an array. This could lead to scaling issues if the number of input lines is large. This problem may also exist with ridx in the existing code. One option is to use a linear feedback shift register to generate a permutation sequence on the fly.

Any suggestions would be very welcome!


This addresses bug MAHOUT-904.
    https://issues.apache.org/jira/browse/MAHOUT-904


Diffs (updated)
-----

  /trunk/integration/src/main/java/org/apache/mahout/utils/SplitInput.java 1215567 
  /trunk/integration/src/main/java/org/apache/mahout/utils/SplitInputJob.java PRE-CREATION 
  /trunk/integration/src/test/java/org/apache/mahout/utils/SplitInputTest.java 1215567 

Diff: https://reviews.apache.org/r/3092/diff


Testing
-------


Thanks,

Raphael


                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Raphael Cendrillon
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

Raphael Cendrillon commented on MAHOUT-904:
-------------------------------------------

This is an early start but I've posted it up just to check if I'm on the right track.

A couple of comments:
  - currently the code runs through the entire file looking for the line corresponding to the random index. This has to be repeated for every line, which is slow and somewhat ugly.
  - the permutation indices are stored in an array. This could lead to scaling issues if the number of input lines is large. This problem may also exist with ridx in the existing code. One option is to use a linear feedback shift register to generate a permutation sequence on the fly.

Any suggestions would be very welcome!
                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Grant Ingersoll
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

Raphael Cendrillon updated MAHOUT-904:
--------------------------------------

    Attachment: MAHOUT-904.patch

Implemented downsampling more efficiently through mapper run(), implemented random permutation through sort comparator class, added driver, integrated into SplitInput
                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Raphael Cendrillon
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

Raphael Cendrillon commented on MAHOUT-904:
-------------------------------------------

Thanks Grant. I was wondering the same thing, for example supporting randomSelectionSize in addition to randomSelectionPct. However supporting size based splits may not be quite so straightforward since the size is generally unknown if the SequenceFile is large, plus its split across mappers.

I also would have liked to have the training and test outputs go to different directories (instead of just using different filename prefixes), but this is not quite so straightforward due to issues with the new API (unless I just write to the SequenceFile by hand in the reducer which raises its own issues).  I think this can be made a little neater once we move to Hadoop 0.21.

Is there something else that you had in mind?




                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Raphael Cendrillon
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

Grant Ingersoll commented on MAHOUT-904:
----------------------------------------

Note, I think we can still run all of this from the SplitInput driver.
                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Grant Ingersoll
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

Raphael Cendrillon updated MAHOUT-904:
--------------------------------------

    Attachment: MAHOUT-904.patch
    
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Raphael Cendrillon
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch, MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

Grant Ingersoll updated MAHOUT-904:
-----------------------------------

    Attachment: MAHOUT-904.patch

upping the cardinality seems to fix things.  Now need to try w/ more labels.
                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Raphael Cendrillon
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>             Fix For: 0.6
>
>         Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

Grant Ingersoll updated MAHOUT-904:
-----------------------------------

    Attachment: MAHOUT-904.patch

This needs some more work, as I don't think we can assume IntWritables.  For instance, see the usage in asf-email-examples.sh which needs to use the split functionality.

This patch does not fully work yet.
                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Raphael Cendrillon
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

jiraposter@reviews.apache.org commented on MAHOUT-904:
------------------------------------------------------



bq.  On 2011-12-13 13:19:13, Grant Ingersoll wrote:
bq.  > Thoughts:
bq.  > this class is often run from the command line, so we should add CLI support for telling it to randomly permute.
bq.  > 
bq.  > I wonder if we should make this a map-reduce job.  Perhaps we split out the existing version and leave as is and then add a new MR one that can do the permutation.  One idea there would be to generate random keys (by appending onto the existing key) and letting the shuffle effectively do the permutations.  Then, during reduce phase we simply strip off the random part of the key and output.  I don't know how bad this would hurt the shuffle, but it seems like it would work functionally anyway.
bq.  > 
bq.  > Otherwise, the approach seems reasonable.  I don't know off hand if there is a better way of doing it (even though I wish there were).

Separating the randomization sounds like a nice idea.  I still think that the SGD jobs need to be able to randomize within a single map as well.

Permuting in the shuffle should work fine.


- Ted


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/3092/#review3876
-----------------------------------------------------------


On 2011-12-09 08:57:18, Raphael Cendrillon wrote:
bq.  
bq.  -----------------------------------------------------------
bq.  This is an automatically generated e-mail. To reply, visit:
bq.  https://reviews.apache.org/r/3092/
bq.  -----------------------------------------------------------
bq.  
bq.  (Updated 2011-12-09 08:57:18)
bq.  
bq.  
bq.  Review request for Grant Ingersoll.
bq.  
bq.  
bq.  Summary
bq.  -------
bq.  
bq.  Early support for randomizing input in SplitInput class. This is an early start but I've posted it up just to check if I'm on the right track.  A couple of comments:
bq.  
bq.    - currently the code runs through the entire file looking for the line corresponding to the random index. This has to be repeated for every line, which is slow and somewhat ugly.
bq.    - the permutation indices are stored in an array. This could lead to scaling issues if the number of input lines is large. This problem may also exist with ridx in the existing code. One option is to use a linear feedback shift register to generate a permutation sequence on the fly.
bq.  
bq.  Any suggestions would be very welcome!
bq.  
bq.  
bq.  This addresses bug MAHOUT-904.
bq.      https://issues.apache.org/jira/browse/MAHOUT-904
bq.  
bq.  
bq.  Diffs
bq.  -----
bq.  
bq.    /trunk/integration/src/main/java/org/apache/mahout/utils/SplitInput.java 1212249 
bq.    /trunk/examples/src/test/java/org/apache/mahout/classifier/bayes/SplitBayesInputTest.java 1212249 
bq.  
bq.  Diff: https://reviews.apache.org/r/3092/diff
bq.  
bq.  
bq.  Testing
bq.  -------
bq.  
bq.  
bq.  Thanks,
bq.  
bq.  Raphael
bq.  
bq.


                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Grant Ingersoll
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

Raphael Cendrillon reassigned MAHOUT-904:
-----------------------------------------

    Assignee: Raphael Cendrillon  (was: Grant Ingersoll)
    
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Raphael Cendrillon
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

Raphael Cendrillon updated MAHOUT-904:
--------------------------------------

    Status: Patch Available  (was: Open)

Implemented downsampling more efficiently through mapper run(), implemented random permutation through sort comparator class, added driver, integrated into SplitInput
                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Raphael Cendrillon
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

jiraposter@reviews.apache.org commented on MAHOUT-904:
------------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/3092/
-----------------------------------------------------------

(Updated 2011-12-22 15:45:05.856640)


Review request for mahout, Ted Dunning, lancenorskog, and Grant Ingersoll.


Changes
-------

Grant's changes


Summary
-------

Early support for randomizing input in SplitInput class. This is an early start but I've posted it up just to check if I'm on the right track.  A couple of comments:

  - currently the code runs through the entire file looking for the line corresponding to the random index. This has to be repeated for every line, which is slow and somewhat ugly.
  - the permutation indices are stored in an array. This could lead to scaling issues if the number of input lines is large. This problem may also exist with ridx in the existing code. One option is to use a linear feedback shift register to generate a permutation sequence on the fly.

Any suggestions would be very welcome!


This addresses bug MAHOUT-904.
    https://issues.apache.org/jira/browse/MAHOUT-904


Diffs (updated)
-----

  /trunk/core/src/main/java/org/apache/mahout/common/AbstractJob.java 1222286 
  /trunk/integration/src/main/java/org/apache/mahout/utils/SplitInput.java 1222286 
  /trunk/integration/src/test/java/org/apache/mahout/utils/SplitInputTest.java 1222286 

Diff: https://reviews.apache.org/r/3092/diff


Testing
-------


Thanks,

Raphael


                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Raphael Cendrillon
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

Raphael Cendrillon commented on MAHOUT-904:
-------------------------------------------

Thanks Grant. I'll update to drop the Pair class in and integrate into SplitInput.

By the way, did you notice the way that PairWritable needs to be extended for each object type (e.g. IntVectorWritable if the object is a Vector)?

Does this seem like a reasonable approach? It would require that a class be created for each object type of interest which is somewhat painfull. However I can't see a simpler approach since setMapOutputValueClass() needs to take a class that has a default constructor (and PairWritable doesn't have a default constructor since it doesn't know how to call new for first and second since it doesn't know what class first and second belong to).




                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Raphael Cendrillon
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

Hudson commented on MAHOUT-904:
-------------------------------

Integrated in Mahout-Quality #1287 (See [https://builds.apache.org/job/Mahout-Quality/1287/])
    MAHOUT-904: Add randomization to split input

gsingers : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1226475
Files : 
* /mahout/trunk/core/src/main/java/org/apache/mahout/common/AbstractJob.java
* /mahout/trunk/examples/bin/asf-email-examples.sh
* /mahout/trunk/examples/src/main/java/org/apache/mahout/classifier/sgd/TestASFEmail.java
* /mahout/trunk/examples/src/main/java/org/apache/mahout/classifier/sgd/TrainASFEmail.java
* /mahout/trunk/integration/src/main/java/org/apache/mahout/utils/SplitInput.java
* /mahout/trunk/integration/src/main/java/org/apache/mahout/utils/SplitInputJob.java
* /mahout/trunk/integration/src/test/java/org/apache/mahout/utils/SplitInputTest.java

                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Raphael Cendrillon
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>             Fix For: 0.6
>
>         Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

Raphael Cendrillon updated MAHOUT-904:
--------------------------------------

    Attachment: MAHOUT-904.patch

Replaced IntWritable with WritableComparable so that any key class can be used. Added instantiation of Configuration to make sure tests pass when using SplitInputJob from within code
                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Raphael Cendrillon
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

Grant Ingersoll updated MAHOUT-904:
-----------------------------------

    Attachment: MAHOUT-904.patch

Converts SplitInput to use AbstractJob.

I think this is pretty close to being ready.  I wonder if there is more opportunity for overlap between the sequential and the m/r version, but we can iterate on that later if people want.
                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Raphael Cendrillon
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

jiraposter@reviews.apache.org commented on MAHOUT-904:
------------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/3092/
-----------------------------------------------------------

(Updated 2011-12-16 19:09:13.382909)


Review request for mahout, Ted Dunning, lancenorskog, and Grant Ingersoll.


Changes
-------

Modified to accept any writable as the value (instead of just VectorWritable). This still requires the generic class PairWritable to be extended for each class of interest so that this extended class can be passed into setMapOutputValueClass(). I'm not sure if this is the best approach, any suggestions would be appreciated!


Summary
-------

Early support for randomizing input in SplitInput class. This is an early start but I've posted it up just to check if I'm on the right track.  A couple of comments:

  - currently the code runs through the entire file looking for the line corresponding to the random index. This has to be repeated for every line, which is slow and somewhat ugly.
  - the permutation indices are stored in an array. This could lead to scaling issues if the number of input lines is large. This problem may also exist with ridx in the existing code. One option is to use a linear feedback shift register to generate a permutation sequence on the fly.

Any suggestions would be very welcome!


This addresses bug MAHOUT-904.
    https://issues.apache.org/jira/browse/MAHOUT-904


Diffs (updated)
-----

  /trunk/integration/src/main/java/org/apache/mahout/utils/RandomPermuteJob.java PRE-CREATION 
  /trunk/integration/src/main/java/org/apache/mahout/utils/PairWritable.java PRE-CREATION 
  /trunk/integration/src/main/java/org/apache/mahout/utils/IntVectorWritable.java PRE-CREATION 
  /trunk/integration/src/test/java/org/apache/mahout/utils/TestRandomPermuteJob.java PRE-CREATION 

Diff: https://reviews.apache.org/r/3092/diff


Testing
-------


Thanks,

Raphael


                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Grant Ingersoll
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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

        

Re: [jira] [Commented] (MAHOUT-904) SplitInput should support randomizing the input

Posted by Ted Dunning <te...@gmail.com>.
On Wed, Dec 14, 2011 at 1:01 PM, Raphael Cendrillon <
cendrillon1978@gmail.com> wrote:

> Thanks Lance. If I understand you correctly you're proposing the following:
>
> Map: (K1,V1) -> (K2,V2)
>  V2 = V1
>  K2 = hashcode(K1)
>

Preserving K1 may be important.  In that case you may prefer


>  emit(K2,V2)
>

emit(K2, [K1, V1])


>
> Combine: (K2,V2) -> (K3,V3)
> (e.g. if we want to keep 10% of samples)
>  if ( ! K2%10 ) {
>

Why not keep this in the mapper?

>
> Also I'm wondering if we can do downsampling at the mapper? Would that be
> more efficient?
>

Yes.  It would be.

Re: [jira] [Commented] (MAHOUT-904) SplitInput should support randomizing the input

Posted by Raphael Cendrillon <ce...@gmail.com>.
Thanks Lance. If I understand you correctly you're proposing the following:

Map: (K1,V1) -> (K2,V2)
  V2 = V1
  K2 = hashcode(K1)
  emit(K2,V2)

Combine: (K2,V2) -> (K3,V3)
(e.g. if we want to keep 10% of samples)
  if ( ! K2%10 ) {
    V3 = V2
    K3 = K2
    emit(K3, V3)
  }

Reduce: (K3,V3)
  SequenceFile.Writer.append(K3,V3)

Is that correct?

Also I'm wondering if we can do downsampling at the mapper? Would that be
more efficient?

Thanks

On Thu, Dec 8, 2011 at 3:05 PM, Lance Norskog <go...@gmail.com> wrote:

> To get random sampling and sorting:
>
> Generate a hashcode from each of your "real" keys, then map on the hashcode
> instead. This gives a random sort. Make the reducer do a modulo at the
> beginning of the method and return without writing anything. Now, make the
> reducer a combiner also. Now, only your desired subset of samples goes
> across the wire. Each real reducer only gets one live sample, so just save
> it. You now have a randomly sorted and sampled output. Use a Partitioner or
> just one reducer, depending on size.
>
> This is deterministic. To get a different random set each time, munge each
> hashcode with a random number.

Re: [jira] [Commented] (MAHOUT-904) SplitInput should support randomizing the input

Posted by Lance Norskog <go...@gmail.com>.
To get random sampling and sorting:

Generate a hashcode from each of your "real" keys, then map on the hashcode
instead. This gives a random sort. Make the reducer do a modulo at the
beginning of the method and return without writing anything. Now, make the
reducer a combiner also. Now, only your desired subset of samples goes
across the wire. Each real reducer only gets one live sample, so just save
it. You now have a randomly sorted and sampled output. Use a Partitioner or
just one reducer, depending on size.

This is deterministic. To get a different random set each time, munge each
hashcode with a random number.

On Thu, Dec 8, 2011 at 10:24 AM, Raphael Cendrillon <
cendrillon1978@gmail.com> wrote:

> Hi Remi,
>
> I've started coding this up. One issue is how to generate the random
> permutation. This could be done in memory however for large data sets this
> is going to be an issue.
>
> Another possibility is to just generate random numbers and accept that
> repetitions will sometimes occur.
>
> Third approach is to generate a random permutation on the fly, which is a
> little more tricky.
>
> On Dec 8, 2011, at 9:49 AM, "Remi Melisson (Commented) (JIRA)" <
> jira@apache.org> wrote:
>
> >
> >    [
> https://issues.apache.org/jira/browse/MAHOUT-904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13165353#comment-13165353]
> >
> > Remi Melisson commented on MAHOUT-904:
> > --------------------------------------
> >
> > Hi,
> > I had a look on it too, and one question remains :
> > Do we need to randomize all the set (training and test) or only the
> training data ?
> >
> > @Raphael Let me know if you already started, because I planned to begin
> dev soon.
> >
> >> SplitInput should support randomizing the input
> >> -----------------------------------------------
> >>
> >>                Key: MAHOUT-904
> >>                URL: https://issues.apache.org/jira/browse/MAHOUT-904
> >>            Project: Mahout
> >>         Issue Type: Improvement
> >>           Reporter: Grant Ingersoll
> >>           Assignee: Grant Ingersoll
> >>             Labels: MAHOUT_INTRO_CONTRIBUTE
> >>
> >> For some learning tasks, we need the input to be randomized (SGD)
> instead of blocks of labels all at once.  SplitInput is a useful tool for
> setting up train/test files but it currently doesn't support randomizing
> the input.
> >
> > --
> > 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
> >
> >
>



-- 
Lance Norskog
goksron@gmail.com

Re: [jira] [Commented] (MAHOUT-904) SplitInput should support randomizing the input

Posted by Raphael Cendrillon <ce...@gmail.com>.
Hi Remi,

I've started coding this up. One issue is how to generate the random permutation. This could be done in memory however for large data sets this is going to be an issue. 

Another possibility is to just generate random numbers and accept that repetitions will sometimes occur. 

Third approach is to generate a random permutation on the fly, which is a little more tricky.

On Dec 8, 2011, at 9:49 AM, "Remi Melisson (Commented) (JIRA)" <ji...@apache.org> wrote:

> 
>    [ https://issues.apache.org/jira/browse/MAHOUT-904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13165353#comment-13165353 ] 
> 
> Remi Melisson commented on MAHOUT-904:
> --------------------------------------
> 
> Hi,
> I had a look on it too, and one question remains :
> Do we need to randomize all the set (training and test) or only the training data ?
> 
> @Raphael Let me know if you already started, because I planned to begin dev soon.
> 
>> SplitInput should support randomizing the input
>> -----------------------------------------------
>> 
>>                Key: MAHOUT-904
>>                URL: https://issues.apache.org/jira/browse/MAHOUT-904
>>            Project: Mahout
>>         Issue Type: Improvement
>>           Reporter: Grant Ingersoll
>>           Assignee: Grant Ingersoll
>>             Labels: MAHOUT_INTRO_CONTRIBUTE
>> 
>> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.
> 
> --
> 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-904) SplitInput should support randomizing the input

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

Remi Melisson commented on MAHOUT-904:
--------------------------------------

Hi,
I had a look on it too, and one question remains :
Do we need to randomize all the set (training and test) or only the training data ?

@Raphael Let me know if you already started, because I planned to begin dev soon.
                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Grant Ingersoll
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

Grant Ingersoll commented on MAHOUT-904:
----------------------------------------

Is there a patch here for your latest?  I see the diff, but not the patch.
                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Raphael Cendrillon
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

Grant Ingersoll commented on MAHOUT-904:
----------------------------------------

OK.  I still just like patches ;-).

Couple of things: 

# We have a Pair class already, we should just make PairWritable use that and put it in the appropriate package.
# I think we should try to hook this into SplitInput such that we can still have many of it's options available, just done at bigger scale.  Either that or we need a Driver for this.  Ultimately, though, we need a way to create train/test splits where the train split is randomized.


                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Raphael Cendrillon
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

Grant Ingersoll updated MAHOUT-904:
-----------------------------------

    Fix Version/s: 0.6
    
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Raphael Cendrillon
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>             Fix For: 0.6
>
>         Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

Grant Ingersoll commented on MAHOUT-904:
----------------------------------------

Go for it!
                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Grant Ingersoll
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

Raphael Cendrillon commented on MAHOUT-904:
-------------------------------------------

Hi Lance. Is that a general comment, or specifically for the issue regarding PairWritable/IntVectorWritable?
                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Raphael Cendrillon
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

jiraposter@reviews.apache.org commented on MAHOUT-904:
------------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/3092/
-----------------------------------------------------------

(Updated 2011-12-23 23:14:34.869723)


Review request for mahout, Ted Dunning, lancenorskog, and Grant Ingersoll.


Changes
-------

Replaced IntWritable with WritableComparable so that any key class can be used. Added instantiation of Configuration to make sure tests pass when using SplitInputJob from within code


Summary
-------

Early support for randomizing input in SplitInput class. This is an early start but I've posted it up just to check if I'm on the right track.  A couple of comments:

  - currently the code runs through the entire file looking for the line corresponding to the random index. This has to be repeated for every line, which is slow and somewhat ugly.
  - the permutation indices are stored in an array. This could lead to scaling issues if the number of input lines is large. This problem may also exist with ridx in the existing code. One option is to use a linear feedback shift register to generate a permutation sequence on the fly.

Any suggestions would be very welcome!


This addresses bug MAHOUT-904.
    https://issues.apache.org/jira/browse/MAHOUT-904


Diffs (updated)
-----

  /trunk/core/src/main/java/org/apache/mahout/common/AbstractJob.java 1221886 
  /trunk/examples/bin/asf-email-examples.sh 1221886 
  /trunk/integration/src/main/java/org/apache/mahout/utils/SplitInput.java 1221886 
  /trunk/integration/src/main/java/org/apache/mahout/utils/SplitInputJob.java PRE-CREATION 
  /trunk/integration/src/test/java/org/apache/mahout/utils/SplitInputTest.java 1221886 

Diff: https://reviews.apache.org/r/3092/diff


Testing
-------


Thanks,

Raphael


                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Raphael Cendrillon
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

Lance Norskog commented on MAHOUT-904:
--------------------------------------

Hi-

Don't see the 'add review' button. Can it extend AbstractJob?
                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Raphael Cendrillon
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

jiraposter@reviews.apache.org commented on MAHOUT-904:
------------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/3092/
-----------------------------------------------------------

(Updated 2011-12-09 08:57:18.798303)


Review request for Grant Ingersoll.


Summary (updated)
-------

Early support for randomizing input in SplitInput class. This is an early start but I've posted it up just to check if I'm on the right track.  A couple of comments:

  - currently the code runs through the entire file looking for the line corresponding to the random index. This has to be repeated for every line, which is slow and somewhat ugly.
  - the permutation indices are stored in an array. This could lead to scaling issues if the number of input lines is large. This problem may also exist with ridx in the existing code. One option is to use a linear feedback shift register to generate a permutation sequence on the fly.

Any suggestions would be very welcome!


This addresses bug MAHOUT-904.
    https://issues.apache.org/jira/browse/MAHOUT-904


Diffs
-----

  /trunk/integration/src/main/java/org/apache/mahout/utils/SplitInput.java 1212249 
  /trunk/examples/src/test/java/org/apache/mahout/classifier/bayes/SplitBayesInputTest.java 1212249 

Diff: https://reviews.apache.org/r/3092/diff


Testing
-------


Thanks,

Raphael


                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Grant Ingersoll
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

Raphael Cendrillon commented on MAHOUT-904:
-------------------------------------------

Thanks Grant!
                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Raphael Cendrillon
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>             Fix For: 0.6
>
>         Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

Raphael Cendrillon commented on MAHOUT-904:
-------------------------------------------

Is this still open? If so I could start to take a look.
                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Grant Ingersoll
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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-904) SplitInput should support randomizing the input

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

Grant Ingersoll updated MAHOUT-904:
-----------------------------------

    Attachment: MAHOUT-904.patch

ASF examples at least run for SGD now, although the results are horrible.
                
> SplitInput should support randomizing the input
> -----------------------------------------------
>
>                 Key: MAHOUT-904
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-904
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Raphael Cendrillon
>              Labels: MAHOUT_INTRO_CONTRIBUTE
>         Attachments: MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch, MAHOUT-904.patch
>
>
> For some learning tasks, we need the input to be randomized (SGD) instead of blocks of labels all at once.  SplitInput is a useful tool for setting up train/test files but it currently doesn't support randomizing the input.

--
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