Giter Club home page Giter Club logo

machine-learning's Introduction

Date: 2020.04.07-17

前情提要

環境設定

  • 設定環境變數(Windows)
    • python.exe -> C:\Users\user\AppData\Local\Programs\Python\Python37
    • jupyter.exe -> C:\Users\user\AppData\Local\Programs\Python\Python37\Scripts
    • graphviz  -> C:\Program Files (x86)\Graphviz2.38\bin

Jupyter

  • 使用 Jupyter 學習 Machine Learning,較方便觀察每一步的結果
  • 在 Terminal 輸入「jupyter notebook」,就可以使用網頁開啟 Jupyter

Markdown

LaTeX Mathematics



AI 基礎概念

簡介

  • 認知 = 真理(真實不變的公式)+ 經驗(實踐得來的知識或技能)
  • 輸入 -> 公式 -> 輸出
    運用輸入(input)和輸出(output),透過演算法,做出可以擬合輸入和輸出的「公式」
  • 專家系統(Expert system)
  • 機器學習(Machine Learning)
    • 傳統統計機率
    • 擅長處理表格(結構化資料)
    • 資料量需要「千」筆以上,也考慮問題難度,問題若簡單則資料量可不用太多
  • 深度學習(Deep Learning)
    • 傳統統計無法做到「組合」
    • 神經網路/模仿人類大腦
    • 擅長處理圖片、文字、語言等抽象型資料(非結構化資料)
    • 資料量需要「萬」筆以上,也考慮問題難度,問題困越難資料量需要越多

範例



ML model 建立步驟

Step1: 準備訓練資料

  • 資料類型 Data:

    1. 監 督式學習(Supervised Learning):
      資料有正確答案,常用演算法為分類(classification)、回歸(regression)。

    2. 非監督式學習(Unsupervised Learning ):
      資料沒正確答案(因資料太多,或不知道該如何填入),常用演算法為分群(cluster)。

    3. 強化學習/半監督式(Reinforcement Learning):
      正確答案是由環境產生/反饋,如自駕車、機器人、遊戲。

  • 資料預處理 Data Preprocessing:

    1. 填補缺失值 Missing Data
    2. 對類別型特徵做 One-Hot Encoding
    3. 資料清洗 Data Cleansing
    4. 資料特徵縮放 Feature Scaling:sklearn.preprocessing.MinMaxScaler

Step2: 建立訓練模型

  • 篩選特徵 Feature?
    • 大多數的演算法會自動決定特徵重要性、自動選擇合適的特徵來建立模型;
      因此,並不需要特別去篩選特徵欄位,或刪除可能沒用的特徵欄位。

    • 決策樹會自己決定特徵的重要性,而單純貝氏會透過機率決定特徵的重要性。

Step3: 利用模型預測



範例程式

請按順序學習,每個範例中都有更深入的解釋 😊

  1. DecisionTree:iris_classification
  2. DecisionTree:boston_regression
  3. KMeans:iris_cluster
  4. Naïve-Bayes:poem_naive_bayes
  5. Naïve-Bayes:news_naive_bayes
  6. RandomForest:titanic_randomforest_classification
  7. KNN:titanic_k-nearest_neighbors
  8. RandomForest:house_price_regression
  9. Linear-model:house_price_linear

machine-learning's People

Contributors

yalonw avatar

Stargazers

Jim Chang avatar

Watchers

James Cloos avatar  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.