Ok, how would I form the cartesian cross-product of these 4 vectors:

age   =: i. 2   NB. young, pre-presbyopic, presbyopic
spec  =: i. 1   NB. myope, hypermetrope
astig =: i. 1   NB. no, yes
tear  =: i. 1   NB. reduced, normal


I presume the resulting cross product will be a rank-4 array. Call it r4a

Ok, now what if I wanted to take one "slice" of this array and pick off the age,
spec, astig, and tear for this slice using 
age_i =: [ spec_i =: 0 [ astig_i =: 0 [ tear_i =: 0

tear =: tear_i { ( astig_i { ( spec_i { ( age_i { r4a ) ) )

But there must be a simpler way to extract each value at the indices age_i,
spec_i, astig_i and tear_i

Ok, so given that age_i is zero, how would we come up with English for each
value on each axis? 
Here, I store the English associations for the indexes:

age_tbl =:  3 2 $ ( 0;'young' ) , (1;'pre-presbyopic') , ( 2;'presbyopic' )
NB. how to avoid having to specify the "depth" of the array. In other words,
NB. how to say take this data and make it into an n by 2 array?

I'm sorry about being impatient, if someone wants to refer me to the appropriate
chapter in "Learning J" I will go study it myself.

I happen to be reading a book on Machine Learning and want to munge my data with
J instead of Perl.


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to