PRTools Contents PRTools User Guide
proxm

PROXM

### Proximity mapping

W = PROXM(A,TYPE,P,WEIGHTS)
W = A*PROXM([],TYPE,P,WEIGHTS)
W = A*PROXM(TYPE,P,WEIGHTS)
D = B*W

 Input A Dataset used for representation B Dataset applied to the representation set TYPE Type of the proximity (optional; default: 'distance') P Parameter of the proximity (optional; default: 1) WEIGHTS Weights (optional; default: all 1)

 Output W Proximity mapping D Dataset, proximity matrix between B and A

### Description

Computation of the [K x M] proximity mapping (or kernel) defined by  the [M x K] dataset A. Unlabeled objects in A are neglected unless A is  entirely unlabeled. If B is an [N x K] dataset, then D=B*W is the [N x M] proximity matrix between B and A. The proximities can be defined by the  following types (A and B are here 1 x K vectors)

'polynomial'   || 'p': SIGN(A*B'+1).*(A*B'+1).^P
'homogeneous'  || 'h': SIGN(A*B').*(A*B').^P
'exponential'  || 'e': EXP(-(||A-B||)/P)
'radial_basis' || 'r': EXP(-(||A-B||.^2)/(P*P))
'sigmoid'      || 's': SIGM((SIGN(A*B').*(A*B'))/P)
'distance'     || 'd': ||A-B||.^P
'minkowski'    || 'm': SUM(|A-B|.^P).^(1/P)
'city-block'   || 'c': SUM(|A-B|)
'cosine'       || 'o': 1 - (A*B')/||A||*||B||
'ndiff'        || 'n': SUM(A~=B)
'hellinger'    || 'g': ||A.^0.5-B.^0.5||

In the polynomial case for a non-integer P, the proximity is computed  as D = SIGN(S+1).*ABS(S+1).^P, in order to avoid problems with negative  inner products S = A*B'. The features of the objects in A and B may be  weighted by the weights in the vector WEIGHTS.

Note that for computing (squared) Euclidean distances DISTM is much  faster than PROXM.

### Example(s)

W = A*proxm('m',1);              % define L1 distances
W = A*proxm('m',1); D = B*W;     % L1 distances between B and A
W = proxm('r',2)*mapex; D = A*W; % Distances between A and itself