You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by Satendra Tiwari <sa...@gmail.com> on 2012/09/22 20:13:47 UTC

GenericBooleanPrefDataModel Constructor

Hi

I am not understanding this constructor :
DataModel model = new
GenericBooleanPrefDataModel(GenericBooleanPrefDataModel.toDataMap(new
FileDataModel(new File("ua.base"))));
My doubts are :
1.We use Generic data models when we want to base our data representation
programatically rather than basing it on external source of data like file,
but here we are taking data from file, so why are using
GenericBooleanPrefDataModel ?
2.GenericBooleanPrefDataModel stores associations as FastIDSets, but we
have not given it as a parameter here.
3.What is GenericBooleanPrefDataModel.toDataMap doing?
I am new to Mahout so may be aking very basic things, please help me
building my concepts.

Thanks & Regards
Satendra

Re: GenericBooleanPrefDataModel Constructor

Posted by Sean Owen <sr...@gmail.com>.
It's copying from memory to memory. Just read the code if you really
need to know what it does.

On Sat, Sep 22, 2012 at 7:55 PM, Satendra Tiwari
<sa...@gmail.com> wrote:
> Sir,
>
> I am just trying to understand this constructor & from your explaination
> its like a copy constructor where we are copying data from file to memory.
> am i correct?
>
> again i m new to mahout n have started from today only, just want to keep
> basics correct.

Re: GenericBooleanPrefDataModel Constructor

Posted by Satendra Tiwari <sa...@gmail.com>.
Sir,

I am just trying to understand this constructor & from your explaination
its like a copy constructor where we are copying data from file to memory.
am i correct?

again i m new to mahout n have started from today only, just want to keep
basics correct.


On Sun, Sep 23, 2012 at 12:00 AM, Sean Owen <sr...@gmail.com> wrote:

> No, it's translating its internal representation to something usable
> directly by GenericBooleanPrefDataModel. Take a look at the code.
> I'm not really sure what you're getting at, or what you are trying to
> do / solve.
>
> On Sat, Sep 22, 2012 at 7:27 PM, Satendra Tiwari
>  <sa...@gmail.com> wrote:
> > So toDataMap is taking File and implementing FastIDSet so
> > GenericBooleanPrefDataModel.toDataMap(new FileDataModel(new
> > File("ua.base")) should complete constructor what is the outer class
> doing?
> >
> > On Sat, Sep 22, 2012 at 11:48 PM, Sean Owen <sr...@gmail.com> wrote:
> >
> >> FileDataModel already uses GenericBooleanPrefDataModel or
> >> GenericDataModel internally. This is their relation. You can do what's
> >> in this line of code but it's not even necessary. FastIDSet is an
> >> implementation detail. But it is actually passed from toDataMap()
> >> method. It's just translating into a representation that's necessary
> >> for this copy constructor.
> >>
> >> On Sat, Sep 22, 2012 at 7:13 PM, Satendra Tiwari
> >> <sa...@gmail.com> wrote:
> >> > Hi
> >> >
> >> > I am not understanding this constructor :
> >> > DataModel model = new
> >> > GenericBooleanPrefDataModel(GenericBooleanPrefDataModel.toDataMap(new
> >> > FileDataModel(new File("ua.base"))));
> >> > My doubts are :
> >> > 1.We use Generic data models when we want to base our data
> representation
> >> > programatically rather than basing it on external source of data like
> >> file,
> >> > but here we are taking data from file, so why are using
> >> > GenericBooleanPrefDataModel ?
> >> > 2.GenericBooleanPrefDataModel stores associations as FastIDSets, but
> we
> >> > have not given it as a parameter here.
> >> > 3.What is GenericBooleanPrefDataModel.toDataMap doing?
> >> > I am new to Mahout so may be aking very basic things, please help me
> >> > building my concepts.
> >> >
> >> > Thanks & Regards
> >> > Satendra
> >>
>

Re: GenericBooleanPrefDataModel Constructor

Posted by Sean Owen <sr...@gmail.com>.
No, it's translating its internal representation to something usable
directly by GenericBooleanPrefDataModel. Take a look at the code.
I'm not really sure what you're getting at, or what you are trying to
do / solve.

On Sat, Sep 22, 2012 at 7:27 PM, Satendra Tiwari
<sa...@gmail.com> wrote:
> So toDataMap is taking File and implementing FastIDSet so
> GenericBooleanPrefDataModel.toDataMap(new FileDataModel(new
> File("ua.base")) should complete constructor what is the outer class doing?
>
> On Sat, Sep 22, 2012 at 11:48 PM, Sean Owen <sr...@gmail.com> wrote:
>
>> FileDataModel already uses GenericBooleanPrefDataModel or
>> GenericDataModel internally. This is their relation. You can do what's
>> in this line of code but it's not even necessary. FastIDSet is an
>> implementation detail. But it is actually passed from toDataMap()
>> method. It's just translating into a representation that's necessary
>> for this copy constructor.
>>
>> On Sat, Sep 22, 2012 at 7:13 PM, Satendra Tiwari
>> <sa...@gmail.com> wrote:
>> > Hi
>> >
>> > I am not understanding this constructor :
>> > DataModel model = new
>> > GenericBooleanPrefDataModel(GenericBooleanPrefDataModel.toDataMap(new
>> > FileDataModel(new File("ua.base"))));
>> > My doubts are :
>> > 1.We use Generic data models when we want to base our data representation
>> > programatically rather than basing it on external source of data like
>> file,
>> > but here we are taking data from file, so why are using
>> > GenericBooleanPrefDataModel ?
>> > 2.GenericBooleanPrefDataModel stores associations as FastIDSets, but we
>> > have not given it as a parameter here.
>> > 3.What is GenericBooleanPrefDataModel.toDataMap doing?
>> > I am new to Mahout so may be aking very basic things, please help me
>> > building my concepts.
>> >
>> > Thanks & Regards
>> > Satendra
>>

Re: GenericBooleanPrefDataModel Constructor

Posted by Satendra Tiwari <sa...@gmail.com>.
So toDataMap is taking File and implementing FastIDSet so
GenericBooleanPrefDataModel.toDataMap(new FileDataModel(new
File("ua.base")) should complete constructor what is the outer class doing?

On Sat, Sep 22, 2012 at 11:48 PM, Sean Owen <sr...@gmail.com> wrote:

> FileDataModel already uses GenericBooleanPrefDataModel or
> GenericDataModel internally. This is their relation. You can do what's
> in this line of code but it's not even necessary. FastIDSet is an
> implementation detail. But it is actually passed from toDataMap()
> method. It's just translating into a representation that's necessary
> for this copy constructor.
>
> On Sat, Sep 22, 2012 at 7:13 PM, Satendra Tiwari
> <sa...@gmail.com> wrote:
> > Hi
> >
> > I am not understanding this constructor :
> > DataModel model = new
> > GenericBooleanPrefDataModel(GenericBooleanPrefDataModel.toDataMap(new
> > FileDataModel(new File("ua.base"))));
> > My doubts are :
> > 1.We use Generic data models when we want to base our data representation
> > programatically rather than basing it on external source of data like
> file,
> > but here we are taking data from file, so why are using
> > GenericBooleanPrefDataModel ?
> > 2.GenericBooleanPrefDataModel stores associations as FastIDSets, but we
> > have not given it as a parameter here.
> > 3.What is GenericBooleanPrefDataModel.toDataMap doing?
> > I am new to Mahout so may be aking very basic things, please help me
> > building my concepts.
> >
> > Thanks & Regards
> > Satendra
>

Re: GenericBooleanPrefDataModel Constructor

Posted by Sean Owen <sr...@gmail.com>.
FileDataModel already uses GenericBooleanPrefDataModel or
GenericDataModel internally. This is their relation. You can do what's
in this line of code but it's not even necessary. FastIDSet is an
implementation detail. But it is actually passed from toDataMap()
method. It's just translating into a representation that's necessary
for this copy constructor.

On Sat, Sep 22, 2012 at 7:13 PM, Satendra Tiwari
<sa...@gmail.com> wrote:
> Hi
>
> I am not understanding this constructor :
> DataModel model = new
> GenericBooleanPrefDataModel(GenericBooleanPrefDataModel.toDataMap(new
> FileDataModel(new File("ua.base"))));
> My doubts are :
> 1.We use Generic data models when we want to base our data representation
> programatically rather than basing it on external source of data like file,
> but here we are taking data from file, so why are using
> GenericBooleanPrefDataModel ?
> 2.GenericBooleanPrefDataModel stores associations as FastIDSets, but we
> have not given it as a parameter here.
> 3.What is GenericBooleanPrefDataModel.toDataMap doing?
> I am new to Mahout so may be aking very basic things, please help me
> building my concepts.
>
> Thanks & Regards
> Satendra