Python のデータフレーム

目次


オープンデータ (open data) とソースデータ (source data)

資料: ../../tools/od/data

オープンデータ (open data)

rdataset.html よりデータを充実メタデータの作成。その2点を目指す.

データフレーム

オープンでないソースデータ (source data)


データのバリエーション, 種々の演算 (type)

段階的に 「オープンデータ の Web ページ」でも公開中

DEM

画像 (image)

OpenData

距離行列を求め、多次元尺度法で2次元あるいは3次元にマッピングしたとする。 その後、mutiviarate gaussian モデルをあてはめるのは容易である。 次元ののろいがあるかも知れぬ。そこで、距離行列に非線形の関数を当てはめたい。もともと N 次元のランダムな点を 2,3 次元にマッピングするわけである。 このとき、関数を決めるという問題がある.

icp

icp.zip

配列 (array)

配列の change point

library(changepoint)
data(Lai2005fig4)
plot(Lai2005fig4[,4])
plot( cpt.mean(Lai2005fig4[,5],method='PELT') )
cpts( cpt.mean(Lai2005fig4[,5],method='PELT') )

時系列 (time series)

配列データ

ftp://ftp.ddbj.nig.ac.jp/ddbj_database/dra/DRA000/DRA000583/DRX001619/


ソーシャルビッグデータ基盤, センサネットワークデータベース基盤 (plat)

計測データ、合成データ、単位、プロファイルの記述体型. 計測日時、計測機器(誤差等)の記述体型. データ探索システムでの処理フローの記録. 合成されたデータの検算・算出プロセスの記録

前提知識


データエクスプローラ,Web インタラクションとデータベース (interact)

フォーム、データフロー、Web インタラクション、データの提示における一般性の抽出と、データ記述. 課題の例:

前提知識

キーワード: redis, redis-cli, redis to object mapping

http://memo.saitodev.com/home/arm/arm_cross_compile/, http://absolutearea.blogspot.jp/2012/07/android.html


統計基礎、機械学習基礎、画像特徴基礎 (stat)

統計演算の見える化、統計演算の一貫性と検算.視点移動画像の挙動分析.データエクスプローラ

前提知識

OpenCV sample program code 特徴量のバリエーション imop.html and od/data/opencv/opencv_surf.cpp human retima opencv_folder/samples/cpp/tutorial_code/contrib/retina_tutorial.cpp Image Stitching opencv_stitching command Feature Matching with FLANN https://docs.opencv.org/doc/tutorials/features2d/feature_flann_matcher/feature_flann_matcher.html#feature-flann-matcher Create training and testing samples opencv_createsamples command, train_cascade command http://www.makelinux.net/man/1/O/opencv_createsamples Poisson Blending http://opencv.jp/opencv2-x-samples/poisson-blending 2値化 http://opencv.jp/opencv2-x-samples/image_binarize Segmentation http://opencv.jp/sample/segmentation_and_connection.html#meanshiftsegm Denoise non local mean filter, bilateral filter denoise.cpp // g++ -o a.out denoise.cpp -I/usr/local/include/opencv2 -I/usr/local/include/opencv -L/usr/local/lib -lopencv_highgui -lopencv_imgproc -lopencv_core ./a.out

DOT によるフローの記述

関連する外部ページhttp://cran.r-project.org/web/views/Multivariate.html

Deep Learning Building high-level features using large scale unsupervised learning Quoc Le and Marc'Aurelio Ranzato and Rajat Monga and Matthieu Devin and Kai Chen and Greg Corrado and Jeff Dean and Andrew Ng, 2012, International Conference in Machine Learning

画像特徴

  • Matlab codes

    URL: http://www.cse.oulu.fi/CMV/Downloads

    see www.cse.oulu.fi facerec image garally

  • Outex Texture Database

    Columbia-Utrecht Reflectance and Texture Database

    URL: http://www.cs.columbia.edu/CAVE/software/curet/html/download.html

    see CUReT


    集団行動解析、交通解析 (group)

    前提知識

    • Android 開発環境: Android Studio, Android SDK, Android NDK, adb 等のツール
    • Java
    • Android アプリ: Wifi analyzer, Wifi Rader
    • 背景除去方式
    • 動体検知方式

    キーワード:カメラ式検知器の研究開発、人や商店や駅の集団行動分析.転倒転落、シチュエーション分析、個体識別、交通情報

    • 検知システム(カメラビュー、履歴ビュー).ビューの表示方式.各座標系の設定と可視化指定方式
    • センサーの誤差、計測可能範囲、ノイズ、時間遅れに関するソースデータと統計的推定
    • 計測機器の時間遅れ推定法と時間遅れに関する制約式
    • 距離センサーと監視カメラのセンサーから読み取れる挙動(過去履歴含む)を表示するシステム (個別識別はせず)
    • Kinect 型センサーでの監視点決定問題(トラッキングを含む)、設置場所決定問題
    • 個体番号と日時を含むセンサーデータの管理: 加速度、方向、GPS、カメラ、pcl
    • 画像: BLOB を使用, pcl と冗長になるのは許容する

    アンドロイドセンサーアプリ

    • /home/www/group/Sensor.tar.gz: 加速度、GPS,コンパス計測アプリ. Android Studio などで import して使用.

    BT タグ・アプリ (BT tag)

    提供されたサンプルプログラム /home/kkaneko/docs/group/2_06_2014.tar を使用

    1. Android SDK manager を起動し、実機と同じバージョンの Android SDK をインストール
    2. Android Studio で import project 操作

      import 元として Android/sample/BTBoxManagerSample を指定

    3. インポートしたプロジェクトの External Library を右クリック.Newを選び、Android を選び、プロジェクトの External Libraries 下に Android API 19 Platform を入れる
    4. 「Build」→「Rebuild」操作
    5. 「Run」→「Run」操作
    1. BaseDeviceListActivity
      findViewById の DeviceListActivity, FilteredDeviceListActivity の部分を削除

    背景除去と動体検知 (background subtraction and object tracking) (group)

    • dlib C++ Library

      http://sourceforge.net/projects/dclib/

      cd /tmp
      tar -xvjof dlib-18.7.tar.bz2
      cd dlib-18.7
      cd examples
      cmake .
      sed -i 's/-llapack/-llapack -L\/usr\/lib\/atlas-base -latlas/' CMakeFiles/*.txt CMakeFiles/*/*.txt
      cmake --build . --config Release
      

      dlib の画像処理の機能の一部 (Web ページ作成中)

      Face_Detection
      FHOG_Feature_Extraction
      FHOG_Object_Detection
      Image
      SURF
      

      dlib の機械学習の機能の一部 (tobe)

      Object_Detector
      Object_Detector_Advanced
      Train_Object_Detector
      Graph_Labeling
      Unsupervised
      cca
      empirical_kernel_map
      kcentroid
      linearly_independent_subset_finder
      sammon_projection
      svm_one_class_trainer
      vector_normalizer
      vector_normalizer_pca
      Kernel_Centroid
      Kernel_K-Means_Clustering
      Kernel_Ridge_Regression
      Kernel_RLS_Filtering
      Kernel_RLS_Regression
      KRR_Classification
      Linear_Manifold_Regularizer
      Multiclass_Classification
      
    • http://sourceforge.net/projects/vxl/?source=directory

    画像処理、機械学習の機能をもったソフトウェア

  • Scene GPS カメラ用の背景除去と動体検知ソフトウェア

    http://sourceforge.net/projects/scene/files/?source=navbar

    cd /tmp
    sudo dkpg -i  Scene-1.0.3-i386.deb
    


    地図データベースの高度応用 (map)

    前提知識

    • グラフ: 有向グラフ、無向グラフ、mixed graph、multi graph
    • XML: Apache Xaran
    • OpenStreetMap object, R's sp object
    • DOT 記法: R の DOT パッケージ
    • 多次元尺度法: 一般の多次元尺度法,supervised MDS
    • JavaScript + Shiny: Shiny での SVG, Google Map (Java Script) と SVG での重ね書き on Shiny
    • network analysis and visualization: R の igraph パッケージ
  • 超グラフ
    source("http://bioconductor.org/biocLite.R")
    biocLite("hypergraph")
    biocLite("RBGL")
    biocLite("GraphPart")
    biocLite("Rgraphviz")
    # to turn the snacoreex.gxl (from RBGL package) graph to a hypergraph
    # this is a rough example
    kc_hg_n <- c("A", "C", "B", "E", "F", "D", "G", "H", "J", "K", "I", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U")
    kc_hg_e <- list(c("A", "C"), c("B", "C"), c("C", "E"), c("C", "F"), c("E", "D"), c("E", "F"), c("D", "G"), c("D", "H"), c("D", "J"), c("H", "G"), c("H", "J"), c("G", "J"), c("J", "M"), c("J", "K"), c("M", "K"), c("M", "O"), c("M", "N"), c("K", "N"), c("K", "F"), c("K", "I"), c("K", "L"), c("F", "I"), c("I", "L"), c("F", "L"), c("P", "Q"), c("Q", "R"), c("Q", "S"), c("R", "T"), c("S", "T"))
    kc_hg_he <- lapply(kc_hg_e, "Hyperedge")
    kc_hg <- new("Hypergraph", nodes=kc_hg_n, hyperedges=kc_hg_he)
    plot(
    kCoresHypergraph(kc_hg)
    

    一人称型・視点移動画像 (motion)

    • キーポイント
    • Saliency
    • OpenCV のテンプレートによる動き検出
    • image denoise

    コーナー

    コーナー検出(EigenValue,Harris,FAST) | OpenCV.jp http://opencv.jp/opencv2-x-samples/corner_detection

    keypoints

  • openSURF

    インストール手順

    1. OpenSURF の Web ページ http://www.chrisevansdev.com/computer-vision.html
    2. 「OpenSURF C++」をクリックして、ダウンロード
    3. ダウンロードした OpenSURFcpp.zip を解凍
      cd /tmp
      unzip OpenSURFcpp.zip
      
    4. ビルド

      ◆ Ubuntu でのビルド手順例

      1. Makefile.gcc の CFLAGS に -fPIC を追加
      2. make -f Makefile.gcc

    5. Web カメラをつなぎ ./surf を実行

    情報源

    see https://aidiary.hatenablog.com/entry/20091030/1256905218 see https://github.com/YusukeSuzuki/opencv_sample_list_jp/blob/master/samples_cpp.rst
  • Lowe's SIFT 9 robust algorithm

    D. G. Lowe. Distinctive image features from scale-invariantkeypoints. International Journal of Computer Vision (IJCV), 60(2):91-110, 2004.

  • PCA SIFT 8

    Y. Ke and R. Sukthankar. PCA-SIFT: A More Distinctive Representation for Local Image Descriptors. 2004.

  • GLOH 12 K. Mikolajczyk and C. Schmid. A performance evaluation of local descriptors. IEEE Transactions on Pattern Analysis and Machine Intelligence (PAMI), 2:1115-1125, 2005.
  • BRISK

    URL: http://www.asl.ethz.ch/people/lestefan/personal/BRISK

    see BRISK

  • SURF 2 http://opencv.jp/opencv2-x-samples/surf_extraction

    H. Bay, A. Ess, T. Tuytelaars, and L. V. Gool. SURF: Speeded up robust features. Computer Vision and Image Un- derstanding (CVIU), 110(3):346-359, 2008.

  • FAST 14 E. Rosten and T. Drummond. Machine learning for high- speed corner detection. In Proceedings of the European Con- ference on Computer Vision (ECCV), 2006.
  • BRIEF 4 M. Calonder, V. Lepetit, C. Strecha, and P. Fua. BRIEF: Binary Robust Independent Elementary Features. In Pro- ceedings of the European Conference on Computer Vision (ECCV), 2010.

    applications using keypoints

  • SLAM
  • RANSAC

    https://docs.opencv.org/doc/tutorials/features2d/feature_homography/feature_homography.html


    3次元再構成,パノラマ画像,3次元物の特徴量化 (3d)

    屋内全域の再構成、平面成分の分析、法線ベクトルのクラスタリング、色とテクスチャの分析

    必要となる知識

    • パノラマ画像の撮影と表示: photoshpere, jThree
    • メッシュ: cloudcompare, meshlab
    • ZOTAC Tegra Note 7 + Forge
    • Sense の使用法


    3次元顔 (human face)

  • analytical 3D model of the face
    • Y. Taigman and L. Wolf. Leveraging billions of faces to overcome performance barriers in unconstrained face recognition. arXiv:1108.1122, 2011.
    • T. Hassner. Viewing real-world faces in 3D. In International Con- ference on Computer Vision (ICCV), Dec. 2013.
  • fiducial point detector アルゴリズム
    • X. Zhu and D. Ramanan. Face detection, pose estimation, and land-mark localization in the wild. In CVPR, 2012.
  • searching for similar fiducial-points configurations from an external dataset to infer
    • Y. Bengio. Learning deep architectures for AI. Foundations and Trends in Machine Learning, 2009.
    • T. Berg and P. N. Belhumeur. Tom-vs-pete classifiers and identity- preserving alignment for face verification. In BMVC, 2012.
  • unsupervised methods that find a similarity transformation for the pixels [17, 15].
    • G. B. Huang, V. Jain, and E. G. Learned-Miller. Unsupervised joint alignment of complex images. In ICCV, 2007.
    • G. B. Huang, M. A. Mattar, H. Lee, and E. G. Learned-Miller. Learn- ing to align from scratch. In NIPS, pages 773781, 2012.
  • face alignment アルゴリズム, frontalization (warp a facial crop to a 3D frontal mode)
  • deep learning アルゴリズム
  • 顔認証システム: DeepFace
  • 3D file formats: STL, color STL, PLY
  • www-bl20.spring8.or.jp
  • labeled face dataset:
    • the Labeled Faces in the Wild benchmark (LFW)
      G. B. Huang, M. Ramesh, T. Berg, and E. Learned-miller. Labeled faces in the wild: A database for studying face recognition in un- constrained environments. In ECCV Workshop on Faces in Real-life Images, 2008
    • the YouTube Faces dataset (YTF)
      L. Wolf, T. Hassner, and I. Maoz. Face recognition in unconstrained videos with matched background similarity. In CVPR, 2011.
    • 顔の向きの自動判別
    • 顔の要素
    • 色、テクスチャ、形状の特徴量化の例として

    関連する外部ページhttps://docs.opencv.org/trunk/modules/contrib/doc/facerec/

  • install PCL

    Point Cloud Rendering http://opencv.jp/opencv2-x-samples/point-cloud-rendering

    sudo add-apt-repository ppa:v-launchpad-jochen-sprickerhof-de/pcl
    sudo apt-get update
    sudo apt-get install libpcl-all
    
  • PCL has many more tutorials and lots sample code here: http://pointclouds.org/documentation/tutorials/. A
    • Statistical Outlier Removal using libpcl
      Filter points based on their local point densities. Remove points
      that are sparse relative to the mean point density of the whole
      cloud.
      filtering.cpp
      
      pcl::StatisticalOutlierRemoval sor
      sor.setInputCloud(cloud);
      sor.setMeanK(50);
      sor.setStddevMulThresh(1.0);
      sor.filter(∗cloudfiltered);
      
    • Detecting 3D SIFT Keypoints using pcl
      void
      detectkeypoints(pcl::PointCloud::Ptr&points,floatminscale,
      intnroctaves,int nrscalesperoctave,floatmincontrast, pcl::PointCloud::Ptr&keypointsout)
      {
        pcl::SIFTKeypointsiftdetect;
        //UseaFLANN−b
        asedKdTreetoperformneighborhoodsearches
        siftdetect.setSearchMethod(pcl::search::KdTree::Ptr(newpcl::search::KdTree));
        //Setthedetectionparameters
        siftdetect.setScales(minscale,nroctaves,nrscalesperoctave);
        siftdetect.setMinimumContrast(mincontrast);
        //Settheinput
        siftdetect.setInputCloud(points);
        //Detectthekeypointsandstorethemin”keypointsout”
        siftdetect.compute(∗keypointsout);
      }
      
    • Computing PFH Features at Keypoints
      void
      PFHfeaturesatkeypoints(pcl::PointCloud::Ptr&points,
      pcl::PointCloud::Ptr&normals,
      pcl::PointCloud::Ptr&keypoints,
      floatfeatureradius,
      pcl::PointCloud::Ptr&descriptorsout)
      {
      //CreateaPFHEstimationobject
      pcl::PFHEstimationpfhest;
      pfhest.setSearchMethod(pcl::search::KdTree::Ptr
      (newpcl::search::KdTree));
      //SpecifytheradiusofthePFHfeature
      pfhest.setRadiusSearch(featureradius);
      //CopyXYZdataforuseinestimatingfeatures
      pcl::PointCloud::Ptrkeypointsxyzrgb
      (newpcl::PointCloud);
      pcl::copyPointCloud(∗keypoints,∗keypointsxyzrgb);
      //Useallofthepointsforanalyzingthelocalstructureofthecloud
      pfhest.setSearchSurface(points);
      pfhest.setInputNormals(normals);
      //Butonlycomputefeaturesatthekeypoints
      pfhest.setInputCloud(keypointsxyzrgb);
      //Computethefeatures
      pfhest.compute(∗descriptorsout);
      }
      
    • Finding Correspondences
      keypoints.cpp
      void
      featurecorrespondences(pcl::PointCloud::Ptr&sourcedescriptorspcl::PointCloud::Ptr&targetdescriptorsstd::vector&correspondencesout,
      std::vector&correspondencescoresout)
      {
      //Resizetheoutputvector
      correspondencesout.resize(sourcedescriptors−>s
      ize());
      correspondencescoresout.resize(sourcedescriptors−>s
      ize());
      //UseaKdTreetosearchforthenearestmatchesinfeaturepcl::search::KdTreedescriptorkdtree;
      descriptorkdtree.setInputCloud(targetdescriptors);
      space
      //Findtheindexofthebestmatchforeachkeypoint
      constintk=1;
      std::vectorkindices(k);
      std::vectorksquareddistances(k);
      for(sizeti=0;is
      ize();++i)
      {
      descriptorkdtree.nearestKSearch(∗sourcedescriptors,i,k,
      kindices,ksquareddistances);
      correspondencesout[i]=kindices[0];
      correspondencescoresout[i]=ksquareddistances[0];
      }
      }
      
    • Plane Fitting with RANSAC
      #include
      #include
      #include
      
      std::vector inliers;
      //createdRandomSampleConsensusobjectandcomputethemodel
      pcl::SampleConsensusModelPlane::Ptr
      modelp(newpcl::SampleConsensusModelPlane(cloudpcl::RandomSampleConsensusransac(modelp);
      ransac.setDistanceThreshold(.01);
      ransac.computeModel();
      ransac.getInliers(inliers);
      //copiesallinliersofthemodelcomputedtoanotherPointCloud
      pcl::copyPointCloud(∗cloud,inliers,∗final);
      
    • euclidean_cluster_extraction.cpp
      #include
      
      pcl::search::KdTree::Ptr tree(new pcl::search::KdTreesetInputCloud(cloud_filtered)
      
      std::vector cluster_indices;
      pcl::EuclideanClusterExtractionec;
      ec.setClusterTolerance(0.02);//2cm
      ec.setMinClusterSize(100);
      ec.setMaxClusterSize(25000);
      ec.setSearchMethod(tree);
      ec.setInputCloud(cloudfiltered);
      ec.extract(clusterindices);
      for(std::vector::constiterator
      it=clusterindices.beginit!=clusterindices.end();++it)
      {
        pcl::PointCloud::Ptrcloudcluster
        (newpcl::PointCloud);
        for(std::vector::const iterator pit=it−>indices.begin();
            pit != it−>indices.end();  pit++)
              cloud_cluster−>points.pushback(cloudfiltered−>points[∗pit]);
      
      cloudcluster−>width=cloudcluster−>points.size();
      cloudcluster−>height=1;
      cloudcluster−>isdense=true;
      }
      
    • Iterative Closest Point
      #include
      ...
      pcl::IterativeClosestPoint icp;
      icp.setInputCloud(cloud2);
      icp.setInputTarget(cloud1);
      icp.setMaximumIterations(20);
      icp.setMaxCorrespondenceDistance(0.1);
      Eigen::Matrix4ftrafo;
      icp.align(∗cloud2);
      (∗cloud2)+=∗(cloud1);
      
    • to be: ColorFERETDatabase に付属の face2norm norm2cova, norm2samp, cova2eigv, eigne_regog_MANG の手順
    • ColorFERETDatabase の顔画像操作
      #!/bin/bash
      # 64x96 サイズの pgm 画像生成
      cd /home/kkaneko/rinkou/od/data/ColorFERETDatabase/colorferet/dvd2/data/images/00740
      cp *.bz2 /tmp
      cd /tmp
      bzip2 -d *.ppm.bz2
      for i in *.ppm; do
        echo $i
        convert -resize 64x96 $i `basename $i .ppm`.pgm
      done
      

    情報源

    • http://people.kyb.tuebingen.mpg.de/kienzle/facedemo/facedemo.htm: fdlib
    • libface
      http://libface.sourceforge.net/file/Download.html
      cmake -DBUILD_EXAMPLES_GUI=1 -DBUILD_EXAMPLES=1 .
      g++ -I/usr/local/include -o FaceDetection FaceDetection.cpp -L/usr/local/lib -lface -lhighgui -lcv -lcxcore -lcvaux
      
    • OpenBiometry

      http://sourceforge.net/projects/openbio/

      Visual C++ でコンパイルできる

    プログラムなど

    see: od/data/att_faces.tar.Z

    数値ベクトルの集合 (a set of numeric vectors)

    • 数値ベクトルの集合 (a set of numeric vectors) https://www.google.co.jp/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&ved=0CCkQFjAA&url=http%3A%2F%2Fwww.nstac.go.jp%2Fservices%2Fpdf%2Fsankousiryou2408.pdf&ei=zb_pUtS7FJGakgWW64GYBA&usg=AFQjCNFlqbomz927-aavZbh44jYwjOehaA&sig2=8f7AsubGl1UbuqVozXWjLA&bvm=bv.60444564,d.dGI https://www.google.co.jp/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&ved=0CDEQFjAB&url=http%3A%2F%2Fwww.nstac.go.jp%2Fservices%2Fpdf%2Fsankousiryou2508.pdf&ei=zb_pUtS7FJGakgWW64GYBA&usg=AFQjCNEMKJgHCQEIFJsG8ULHink4bHAg-A&sig2=Rj51Is52DWa7DBAWpQjPrg&bvm=bv.60444564,d.dGI https://www.google.co.jp/url?sa=t&rct=j&q=&esrc=s&source=web&cd=3&cad=rja&ved=0CDkQFjAC&url=http%3A%2F%2Fwww.nstac.go.jp%2Fservices%2Fsociety_paper%2F25_02_01.pdf&ei=zb_pUtS7FJGakgWW64GYBA&usg=AFQjCNHCRrOvjwwT5qlrly6JyZHFTabwsg&sig2=aBkmy0SNRLvwbNCUqJ3E0Q&bvm=bv.60444564,d.dGI doubiousity (doubious score) (1)ある観測値がエラーである可能性と(2)あるエラーの推定値に与える影響度合 単変量で、混合gauss分布の各分布の平均と分散がわかっているとき、 「(1)ある観測値がエラーである可能性」はz scoreで求めることができる Di Zio, Guarnera, and Luzi (2003)では、混合モデルに基づき、エラーを確率的に形式 化するモデルベースの手法を提唱 Di Zio, Marco, Ugo Guarnera, and Orietta Luzi. (2003). “Using Mixture Modelling to Deal with Unity Measure Error,” Work Session on Statistical Data Editing, Conference of European Statisticians, Madrid, Spain, 20-22 October 2003. 単変量に対する robust な外れ値検出 箱ひげ図 多変量に対する robust な外れ値検出 マハラノビス距離、マハラノビス平方距離 ロバスト主成分分析 Modified Stahel-Donoho(MSD)法 ロバストに推計されたマハラノビス平方距離のプロット D-D plot Q-Q plot Patak(1990)は、SD 法によりロバスト推定された分散・共分散行列を用いた主成分分析を提 案し、カナダ統計局はこれを用いて破壊点が約 0.5 (理論的には 50%近い外れ値の混入に耐える。) と高く、直交変換不変な多変量外れ値検出法を実現した[Franklin and Brodeur(1997)]。 さらに、EUREDIT プロジェクトで、カナダ統計局の手法の改良法が提案されている [Bguin and Hulliger (2003)]。 [] Patak, Z.(1990), Robust principal component analysis via projection pursuit, M. Sc. Thesis, University of British Columbia, Canada [] Bguin, C. and B. Hulliger(2003), Robust Multivariate Outlier Detection and Imputation with Incomplete Survey Data, EUREDIT Deliverable D4/5.2.1/2 Part C 外れ値とは、データの全体的なパターンから大きく逸脱した観測値であり、測定誤差、他の母集団に属 すべき観測値、特異な観測値のことである(Weiss, 2005, p.122)。 マハラノビス平方距離 D 2 ( x i ) の検定統計量 Fi は、 い、下式により求めることができる。 Fi = (n - p) n D (xi) / (n*n - 1) p 外れ値と判定する検定統計量 Fi の基準は、Franklin and Brodeur(1997)に準じて、99.9%値とする 岡本 (2004)が詳しく、M-推定量、 MCD 法、射影追跡法、Forward Search 法、感染アルゴリズム法、NNVE 法、クラスター 分析法、ロバスト回帰木モデルの調査研究を行っている。 もし確率密度関数 で汚染(contaminate)している側の分布の分散が大きい場合、 ある いは、平均値が とは大幅に異なる場合、汚染している側の分布から得られた観測値は、他 の観測値から大きく外れている可能性が高い(DeGroot and Schervish, 2002, p.577) 8. DeGroot, Morris H. and Mark J. Schervish. (2002). Probability and Statistics. Boston: Addison-Wesley. Di Zio, Guarnera, and Luzi (2008)では、Ghosh-Dastidar and Schafer (2006)を参考に、外れ値検出法として混淆正規分布モデルを採用 Ghosh-Dastidar, Bonnie. and J. L. Schafer. (2006). “Outlier Detection and Editing Procedures for Continuous Multivariate Data,” Journal of Official Statistics vol.22, no.3: 487-506. Di Zio, Marco, Ugo Guarnera, and Orietta Luzi. (2008). “Contamination Models for the Detection of Outliers and Influential Errors in Continuous Multivariate Data,” Work Session on Statistical Data Editing, Conference of European Statisticians, Vienna, Austria, 21-23 April 2008. Bellisai, Di Zio, Guarnera, and Luzi (2009)では、混淆正規分布モデルによる 多変量外れ値検出法の理論化を発展させた。混淆正規分布モデルを使うことで、エラーと 残差の変動部分との区別をつけることが可能となり、観測値のスコアを該当ユニットのエ ラーの期待値と直接的に関連付けることができるようになった Bellisai, Diego, Marco Di Zio, Ugo Guarnera and Orietta Luzi. (2009). “A Selective Editing Approach Based on Contamination Models: An Application to an Istat Business Survey,” Work Session on Statistical Data Editing, Conference of European Statisticians, Neuchtel, Switzerland, 5-7 October 2009. Buglielli, Di Zio, Guarnera, and Pogelli (2011)では、混淆正規分布モデルによる外れ値検出法を、R の SeleMix パッケージとして実装 Buglielli, M. Teresa, Marco Di Zio, Ugo Guarnera, and Francesca R. Pogelli. (2011). “An R Package for Selective Editing Based on a Latent Class Model,” Work Session on Statistical Data Editing, Conference of European Statisticians, Ljubljana, Slovenia, 9-11 May 2011.

      点の分布をN次元の正規分布で表現.正規分布の主軸をN個求めることを行いたい.

      keywords: mclust, density plot

      mvoutlier packages

    ベクトルの classifier (classifier)

     
    • facerec-master の k-nn
          k-Nearest Neighbor; available distance metrics
              Euclidean Distance
              Cosine Distance
              ChiSquare Distance
              Bin Ratio Distance
      

      前準備として facerec の knn.m などを準備しておく

      P=[1,21,20,2,4,30; 1,21,20,2,4,30]
      y=[1, 3, 3, 2, 2, 3]
      Q=[1;1]
      
      % returns 1
      knn(P,y,Q,1)
      % returns 2
      knn(P,y,Q,3)
      % returns 3
      knn(P,y,Q,6)
      
    • facerec の lda.m

      to be filled

    • facerec の pca.m

      to be filled

    SVD using OpenCV Matrix3d P = Matrix3d::Random(3, 3); JacobiSVD svd(P, Eigen::ComputeFullU | Eigen::ComputeFullV); MatrixXd S = svd.singularValues(); Matrix3d U = svd.matrixU(); Matrix3d V = svd.matrixV();





    cascade classifier https://docs.opencv.org/doc/tutorials/objdetect/cascade_classifier/cascade_classifier.html#cascade-classifier

    rubust pca robust pca sample

    image histogram

    • http://www.mathworks.com/matlabcentral/fileexchange/28681-imhistogram
    • http://www.mathworks.com/matlabcentral/fileexchange/43630-color-histogram-of-an-rgb-image

    グラフ作成

    この Web ページで行うこと: プログラムによるグラフ作成

    Point Cloud

    key word: libpcl, in-hand 3d scanner, data capture

  • ../../tools/od/data/progs/convert_bmp.cpp g++ -I/usr/include/eigen3 -I/usr/include/pcl-1.7 -o a.out convert_bmp.cpp -lpcl_io -lpcl_common -lboost_system
  • meshlab を用いてポリゴンに変換
  • 全国基準地域メッシュデータ (mesh05.html)

    asc to off converter

    require "csv"
    # 行数カウント
    lines=0
    reader = CSV.open("/tmp/Sinus_pts.asc", "r")
    reader.each do |row|
      lines = lines + 1
    end
    reader.close
    # 出力
    print "OFF\n"
    print "#{lines} 0 0 \n"
    reader = CSV.open("/tmp/Sinus_pts.asc", "r")
    reader.each do |row|
      print "#{row[0]} #{row[1]} #{row[2]}\n"
    end
    reader.close
    
    Computer Vision and Geometry Group https://www.google.co.jp/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&sqi=2&ved=0CCsQFjAA&url=http%3A%2F%2Fwww.cvg.ethz.ch%2Fteaching%2F2012spring%2F3dphoto%2FSlides%2F3dphoto_pcl_tutorial.pdf&ei=M1B0UoSrLof3lAX3s4EQ&usg=AFQjCNHg0Zje3kCIxP2c7PucrMDg_ndarg&sig2=sEKO4QmbX0XJI5eFO-Gupg&bvm=bv.55819444,d.dGI unzip data_capture.zip 'cmake ../data_capture' and then execute 'make'.

    3次元地図

    PCL / STL / PLY

    http://www.archeos.eu/wiki/doku.php/

    http://www.blensor.org/ # python3.3 sudo apt-get install python-software-properties sudo add-apt-repository ppa:fkrull/deadsnakes sudo apt-get update sudo apt-get install python3.3 sudo apt-get install python3.3-dev wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py sudo python3.3 ez_setup.py git clone https://github.com/mgschwan/blensor.git cd blensor mkdir a cd a cmake -DWITH_PYTHON=OFF -DPYTHON_VERSION=3.3m PYTHON_INCLUDE_DIR=/usr/include/python3.3m -DWITH_OPENIMAGEIO=OFF -DWITH_IMAGE_OPENJPEG=OFF -DWITH_OPENAL=OFF -DWITH_SPACENAV=OFF -DWITH_CYCLES=OFF -DWITH_SYSTEM_GLEW=OFF -DWIGH_GPU=OFF .. some features BSS-1 implementation of a Kinect Sensor Support to obtain accurate depth map information Support the output to the PCD format from the PCL (Point cloud library) Starting with version 1.0.10 the RGB values of the material are stored in the PCD and EVD file Tutorial for PCL developers/users Render a pointcloud in blender

    http://graphics.stanford.edu/data/3Dscanrep/

    https://d.hatena.ne.jp/etopirika5/20101027/1288152036



    辞書


    * bio の例(normalize を例題に) * R のパッケージ https://github.com/ajdamico/usgsd/blob/master/National%20Health%20Interview%20Survey/download%20all%20microdata.R usgsd / National Health Interview Survey / download all microdata.R library(rgl) --- library(rgl) open3d() x <- sort(rnorm(1000)) y <- rnorm(1000) z <- rnorm(1000) + atan2(x,y) plot3d(x, y, z, col=rainbow(1000)) --- points3d(x, y = NULL, z = NULL, ...) lines3d(x, y = NULL, z = NULL, ...) segments3d(x, y = NULL, z = NULL, ...) triangles3d(x, y = NULL, z = NULL, ...) quads3d(x, y = NULL, z = NULL, ...) --- library(foreign) --- library(foreign) read.spss() write.foreign( "SPSS" ) library(misc3d) --- library(misc3d) contour3d(...) kde3d(...) d <- kde3d(quakes$long, quakes$lat, quakes$depth, n = 40) contour3d(d$d, exp(-12), d$x/22, d$y/28, d$z/640, color = "green", color2 = "gray", scale=FALSE, engine = "standard") plot3d(quakes$lat, quakes$long, quakes$depth, col=rainbow(1000)) --- ----- terasvirta test library(tseries) x <- runif(1000, -1, 1) y <- x^2 - x^3 + 0.1*rnorm(x) plot(x,y) terasvirta.test(x, y) terasvirta.test(cbind(x,x^2,x^3), y) x[1] <- 1.0 for(i in (2:n)) { x[i] <- 0.98*x[i-1] + 0.01 } x <- as.ts(x) plot(x) terasvirta.test(x) terasvirta.test(cbind(x,x^2,x^3)) help.zelig("models") https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=4&cad=rja&ved=0CE0QFjAD&url=http%3A%2F%2Fwww.slideshare.net%2Fizahn%2Frstatistics&ei=S3DyUYPPIcKnkAXA1YGACg&usg=AFQjCNF_FBDkMjpj7vEC-nJ17igMYTmKaQ&sig2=CjWahfa1dXy-O3hLWffgTg http://cran.r-project.org/web/views/TimeSeries.html library( forecast ) tsdisplay( LakeHuron ) data1 <- auto.arima( LakeHuron ) plot( forecast( data1, h=10 ) ) 現在あるいは直近の測定値に加えて、 過去の測定値の集積から、統計的手法などを用いて、直近の測定値と現在時刻の時間のずれの補償や、 測定漏れの補間や、将来の予測を行うとする. たとえば、 ありえる事象の集合である母集団の個々の観測値を表す確率変数Xについて、 Xが正規分布に従うことが前もって分かっていたり、 母集団の観測の集積から、Xが正規分布の従うということがある確からしさで言えるとする。 確率モデルから、観測値あるいは観測値の時系列集合を自動的に生成できるし、 観測値の集積から確率モデルを導くことができる。 この両方向の処理を繰り返しても、確率モデルが変化しないとき、この確率モデルは安心して使うことができる。 Xが time-variable (時系列変数)であるとき、 この場合、  ずれの補償:   補間:  将来の予測: 過去の測定値の集計から、ある時刻tでの値を予測し、これを実測値にあてはめることで、予測の良さを評価することもできる。 <要因とランダム性> 要因のランダム性によって、ある変数Yの値が変化するとする.要因Xがランダム変数であり、要因YがXの積分値とすると、Yは典型的なランダムウオークである. このときYの統計モデルではなく、要因の統計モデルが作られる 要因の統計モデルと観測値 派生変数の観測値、 <要因の予測とランダム性> 要因がランダムであるというからには、予測はしがたい. 単に「平均E,分散sの正規分布で値集合を合成し、その中から、ランダムに選ぶ」ということになる(モンテカルロシミュレーションのような状況になる. 予測と言っているのは、無限区間での一様分布(まったくの無知識)よりも、統計モデルがあったほうが、現実に近い要因知を合成できると言っているに過ぎない。  要因をすべて無視して、「速度」は正規分布であるという仮説を立てることもできる。  (要因なし。派生変数を直接、統計モデル化)  ある要因を入れることで、精度がAだけ向上する確率(精度の尺度は別途定義する)はPだということができるようになる.例えば混合ガウス分布。この場合には、要因は確率変数だが、派生変数は、要因に従属する変数である。  要因、派生変数ともに観測可能な値であるとする。 3章 では、  ・緯度経度のプロット  ・バス停の到着と発車はわかる  ・バス停の到着と発車の集積もある このとき、 要因と派生変数の関連の仮設を立て、 派生変数の観測値から、要因の統計モデルと観測値を作りたいとする.  要因   曜日区分:平日、土曜・日曜・祝日、土曜、日曜、祝日、三連休、年末年始、お盆   天候   時間帯   未知の突発行事  始点の出発時刻。始点の乗客数はある確度で言える。  観測される派生変数は、  各バス停における到着時刻と乗客数である.  将来、各バス停における到着時刻、各バス停における乗客数、現在位置、現在速度を推定したい。(例えば、信頼区間やp値を使って) <検定> 時系列の変数Yの任意の時刻の観測値Y(t)を、t以前の値から推定し、観測値との差の平均の差、標準偏差、尖度、歪度を求める さまざまな表示法 <地図での、あなたはここです。バスはここです。お探しの場所はここです表示> <地図での、バスに固有の表示法> <バス時刻表だが。。。> 10 | 10 30 50 10 | 14 33 50-54 下段は過去の実績だったり、予測値だったりする。 予測値の区間 [l, u]について、lの値は、100%どんなことがあっても、これより早くは来ない。という意味になる。 l は、いまのバスまでの走行距離/法定速度、あるいは、過去の実績の最高速度 <いまは混んでいるのか、空いているのかの予測表示> 状態そのものの表示 先行するバスがあると、後ろのバスは早いという現象



    ビデオ素材 (video)

    連続する2フレームから keypoint の時間特徴量をとりだす。 さらに、離れたフレームの列から大域的な情報を出す(x, y, size, angle 等の時間変化になる)。 これで分析を行う。

    Optical Flow (OpenCV 2.4.7) farneback tvl1 brox pyrlk