GithubHelp home page GithubHelp logo

larix / knn Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 1.0 722 KB

kNN((k-nearest neighbors algorithm),此專案以ETtoday新聞進行kNN範例之實作

Home Page: https://en.wikipedia.org/wiki/K-nearest_neighbors_algorithm

Python 100.00%
knn news tf-idf cosine-similarity

knn's Introduction

kNN(k-nearest neighbors algorithm)

此專案以新聞分類進行kNN範例之實作

kNN Introduction:

最近鄰居法(KNN演算法,又譯K-近鄰演算法)是一種用於分類和回歸的無母數統計方法,KNN常用來做資料分類。
KNN是一種監督式學習(Supervised Learning),監督式學習需透過資料訓練出一個model,但KNN沒有做training的動作。
K為使用者自己定義的常數,KNN就是選擇離自己最近的K的鄰居(Data),之後觀察哪一種類別(Tag)的鄰居最多就將自己也當成該類別。

Input:

測試文章 : 台股遇長假前賣壓 失守10900點  

1.使用ETtoday新聞作為訓練集分類。
2.使用Jieba作為分詞,取出Top 100 Words 作為每篇文章的關鍵詞。
3.取出k=3個最近鄰居作為分類依據,此外對最近的第一個鄰居作為加權*2

Output:

image

knn's People

Contributors

larix avatar

Stargazers

 avatar Lee-Wei avatar  avatar Huff KAI avatar

Watchers

James Cloos avatar

Forkers

qi-xian

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.