Percentile

지정된 축을 따라 행렬/벡터 요소 또는 요소 값의 지정된 백분위수를 반환합니다.

double vector::Percentile(
  const int  percent      // 
   );
 
double matrix::Percentile(
  const int  percent      // 
   );
 
vector matrix::Percentile(
  const int  percent,     // 
  const int  axis         // axis
   );

매개 변수

percent

【in】 계산할 백분위수는 반드시 0에서 100 사이여야 합니다.

axis

[in]  Axis. 0 — 가로축, 1 — 세로축.

반환값

백분위수: 스칼라 또는 벡터.

참조

'percent' 매개변수의 유효한 값은 [0, 100] 범위입니다. 선형 알고리즘은 백분위수를 계산하는 데 사용됩니다. percentiles를 올바르게 계산하려면 순서를 정렬해야 합니다.

   matrixf matrix_a={{1,2,3},{4,5,6},{7,8,9},{10,11,12}};
   Print("matrix_a\n",matrix_a);
 
   vectorf cols_percentile=matrix_a.Percentile(50,0);
   vectorf rows_percentile=matrix_a.Percentile(50,1);
   float matrix_percentile=matrix_a.Percentile(50);
 
   Print("cols_percentile ",cols_percentile);
   Print("rows_percentile ",rows_percentile);
   Print("percentile value  ",matrix_percentile);
 
 
   /*
   matrix_a
   [[1,2,3]
    [4,5,6]
    [7,8,9]
    [10,11,12]]
   cols_percentile [5.5,6.5,7.5]
   rows_percentile [2,5,8,11]
   percentile value  6.5
   */