Giter Club home page Giter Club logo

2022_ml_hw01's Introduction

ML_HW01

PLA with pocket_algorithm

I. Execution description

rand_samples用一條線上的x範圍1到30對照的y圍一個範圍,從這範圍裡隨機挑點,再依照點的位置給標籤。

sign計算兩個向量的內積,等於a * x1 + b * x2 + c * 1,判斷在線的哪一邊。

PLA對每個錯誤的點都做調整。

pocket_algorithm先把每個點隨機排序,遇到錯誤的點去做調整,挑整完之後看準確度有沒有提升,如果有就保留這個挑整,沒有就找下一個錯誤的點。

第四題的地方把正負的各後50個變成另一邊的錯誤標籤。

II. Experimental results

1.m = -1, b = 5

image

1.m = 1, b = 3

image image image image

2.w0=[0,0,0],平均迭代次數是35次。

3.多了挑選的步驟時間大概多了10~30倍。

4.迭代800多次之後大概可以分開來。

III. Conclusion

原本以為多那一個步驟只會多一點時間,但實做出來比想像的久。雖然比較久但比較實用,如果沒有用pocket algorithm對第四題的資料做的話會完全分不出來,實際那麼多筆資料一定會有一些是標記錯誤的,所以這個演算法是很重要的。

IV. Discussion

對Python不太熟悉所以寫的時候一直查資料,其中一個找最久的bug是array的等號比較像是指標指過去,所以在改動的時候會連上一個都改,要用copy()才能複製一份。

2022_ml_hw01's People

Contributors

baiyuchen1228 avatar

Stargazers

 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.