|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
在运行Laplace score的例子
! ^( H$ O5 X9 q, hidAOccur = find( A == idA );
! \. r. m; i& m这个单独运行没问题
% i/ [# ~3 Z4 T. V8 W& X, y8 t. c- g但是处在! B e& w S8 C' t: d h4 z
function qw = qq( A, B )
% T5 q- u+ h Iif length( A ) ~= length( B)
& R( L' s9 r; z* k: t/ k error('length( A ) must == length( B)');0 y. T; R5 @" P( P* Q
end
* o, W, g1 p* ~3 [& [: ntotal = length(A);8 L j, u0 `" x. E5 @2 b8 ^( e
A_ids = unique(A);; K0 V+ y3 ?3 Y* o5 J) I3 i6 @
B_ids = unique(B);2 N0 l6 f* ?$ i; V7 c# q
MI = 0;
- Z A C6 x. C- \/ Hfor idA = A_ids+ M+ U4 K y, l0 ?* o
for idB = B_ids
) S% D! _: }, N idAOccur = find( A == idA );
4 f' U6 ^; A6 I5 `( Y 8 m' p' a# U6 w
% eps : the smallest positive number
+ t. m9 h0 H& C8 _ end
L7 m/ w) o/ Uend
7 p# j5 \6 L) | lqw=MI
2 X) x f$ V0 ~6 |0 n9 r4 w kend3 s- D8 Z7 S) s9 ~( [4 N1 b, t5 C* q
就会出现在这行idAOccur = find( A == idA );的错误,即表现在矩阵维度必须一致上 | 6 t, d5 I* y* K: l/ f' {+ y
|
|