Hello Thomas, Peter, Federico and others

In the end of the day I two problems with the results of multiple
correspondence analysis (MCA in FactoMineR package).
Python structures output in a form of a tree of dictionaries.
Apparently when Python composes output of a R method, results are
transformed into dictionaries and some info is lost.

For instance, I need four things from the result
1. names of var
2. coordinates of var
3. names of quali.sup
4. coordinates of quali.sup

and in R everything is perfect, I have these two commands, each of which
gives me names and coordinates
1. res.mca$var$coord
2. res.mca$quali.sup$coord

In Python I have these three commands

1. resmca['var']['coord']
2. resmcap['quali.sup']['coord']
3. resmca['call']['marge.col'].keys()

that give me only three out of four things that I need. That is both
coordinates and names of var, but names of quali.sup simply dissapear from
result. They are not to be found. And the size of result is 8MB! Even the
names of var I have to pull from some other dictionary called 'call'. This
is the first problem, missing names of quali.sup variables. What to do?

Second problem. The result is composed from these dictionaries
['quali.sup', 'svd', 'var', 'call', 'eig', 'ind'] and I need to match names
and coordinates that originate from different dictionaries, which probably
leaves me with zero hope to ever match them, because they have different
order. I instaled OrderedDict using easy_install as Thomas advised and it
works, but I could use that only when building new dictionaries, I can't
use that on the result, that is already structured by Python. It is
interesting however that in resmcap['quali.sup']['coord'] there are two
dimensions, each represented by one dictionary, and these two are matched.
I guess that inside a low leaf level the dictionaries are matched, but
taking dictionaries from different branches they cannot be matched. Maybe
someone can tell me something about that? I am interested.

'coord':

{'Dim 2': [0.018844468730371617, 0.08358675474690605,
-0.053305877493825871, -0.037773512211075236, 0.017979504422211724,
-0.0070650649683571343, -0.012159276712239854, -0.0032867062434344531,
0.050351907734665545, -0.079065744770015961, 0.12432252209176869,
-0.010664658712975896],

'Dim 1': [0.038401278860227518, -0.011148401384974754,
0.022704084976514861, -0.065512902547502749, 0.14365804844522603,
-0.14654975548062379, -0.030872076241075429, -0.037910924175302299,
-0.1490915069177525, -0.1433624082077779, 0.15792769671596391,
0.016173865576526572]}},

I would like to know if there is any other solution besides taking a new
multiple correspondence method from another package? I fear same sort of
problems might appear again.


Thank you all a lot. Sorry for spamming such long emails.




Marko








On Fri, Dec 9, 2011 at 10:20 AM, Thomas Kluyver <tak...@gmail.com> wrote:

> On 9 December 2011 07:11, Marko Limbek <marko.lim...@valicon.net> wrote:
>
>> When I try to import OrderedDict I get this error. I am afraid I cannot
>> import it with my python version. Is that true?
>
>
> If you're using Python 2.6, you need to download the module Federico
> linked to. It's available from collections in 2.7.
>
> Whether OrderedDict is what you want, I don't know - I'm still not sure
> what you're trying to do.
>
> Thomas
>
>
> ------------------------------------------------------------------------------
> Cloud Services Checklist: Pricing and Packaging Optimization
> This white paper is intended to serve as a reference, checklist and point
> of
> discussion for anyone considering optimizing the pricing and packaging
> model
> of a cloud services business. Read Now!
> http://www.accelacomm.com/jaw/sfnl/114/51491232/
> _______________________________________________
> rpy-list mailing list
> rpy-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rpy-list
>
>
------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to