Giter Site home page Giter Site logo

knn-excersices's Introduction

knn-excersices

最近傍識別器の演習

準備

    1. Matlab か Octave をインストールする.
    1. Download stu-hikkoshiset.2001271132.tgz and find a folder names "mfiles". Many matlab functions are under the folder "mfiles". Put the functions somewhere and add the directories to the path variable for Matlab or Octave.

最近傍識別器の課題

Download hayuci13a.zip. This file contains five data files: yXT_car.csv, yXT_seeds.csv, yXT_wine.csv, yXT_winequality-white.csv, yXT_yeast.csv. Each line corresponds to one example. The format is

 Class, Feature1, Feature2,... , Feature n

Do the followings:

    1. データセット wine に対して, 最初の行の例題を評価用, 残りの行の例題を訓練用として, 最近傍識別を行え. ただし,k-最近傍識別器 の近傍数は k=1 とせよ.
    1. 各データセットに対して, 最初の行の例題を評価用, 残りの行の例題を訓練用として, 最近傍識別を行え. ただし,k-最近傍識別器 の近傍数は k=1 とせよ.
    1. データセット wine に対して, 各クラスのデータを訓練用と評価用を 7:3 にランダムに分けよ.
    1. データセット wine に対して, k-最近傍識別器 の k=1 とし,評価用データの識別率を出せ.
      1. を10回繰り返して,識別率の平均値と標準偏差を算出せよ.
    1. 各データセットに対して,各クラスのデータを訓練用と評価用を 7:3 にランダムに分け,k-最近傍識別器 の k=1 とし, 評価用データの識別率を出せ.
    1. 各データセットに対して,6. を10回繰り返して,識別率の平均値と標準偏差を算出せよ.
    1. k-最近傍識別器 の k=1,2,3,4,5 を試せ. ただし,重みつきの voting をせよ. 重みは exp( - (ユークリッド距離)^2/(2σ^2)) で求めよ. ただし,σは訓練用データの距離値の中間値とする. これは,距離行列 D をまず計算し,$median(D(:))$ から求める.
    • Translation into English: Test k-NN classifiers with k=1,2,3,4,5. Therein, the weighted voting should be used. The weight is defined as
  exp(-(d^2/2\sigma^2) )

where d is the Euclidean distance and \sigma is the median of training data. In particular, $\sigma := median(D(:))$ where $D$ is the distance matrix.

  • 余裕があったら,C言語風にコーディングする場合と 行列計算でコーディングする場合とで計算時間を比較して みてください.
    • Translation into English: Compare the computational time of two implementations. The one is that the code does not use matrix computation but use for-loop like C language. The other uses matrix computation.

knn-excersices's People

Contributors

kroobose avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.