Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: davidzeng21/Machine_Learning_Code_Implementation
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: luwill/Machine_Learning_Code_Implementation
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 6 commits
  • 6 files changed
  • 2 contributors

Commits on Oct 23, 2022

  1. Update gbdt.ipynb

    luwill authored Oct 23, 2022
    Configuration menu
    Copy the full SHA
    4bc7530 View commit details
    Browse the repository at this point in the history

Commits on Oct 16, 2023

  1. Update knn.ipynb

    luwill authored Oct 16, 2023
    Configuration menu
    Copy the full SHA
    e305ce2 View commit details
    Browse the repository at this point in the history

Commits on Sep 6, 2024

  1. 修复回归决策树CART实现的bug:

    1. 书中提到,基于numpy的回归树的MSE比sklearn的DecisionTreeRegressor差很多,实际测试也确实差了4、5倍左右。
    修改之后,差距会很小。
    2. scikit-learn从1.2版本开始移除了load_boston函数,这个函数原本用于加载波士顿房价数据集。移除的原因是该数据集存在伦理问题。scikit-learn提示可以使用pandas加载原数据。
    3. 左子树和右子树弄反了,左子树应该是<= threshold。当然这并不会导致严重问题,仅仅是与书中的公式和习惯不符。
    4. 在utils.py文件中,feature_split函数的返回值类型有误,原代码运行会报错。
    home-MSI committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    f7b9b7e View commit details
    Browse the repository at this point in the history
  2. Merge pull request luwill#15 from WhizZest/master

    修复回归决策树CART实现的bug by WhizZest
    luwill authored Sep 6, 2024
    Configuration menu
    Copy the full SHA
    2c457c2 View commit details
    Browse the repository at this point in the history

Commits on Sep 15, 2024

  1. 解决第11章GBDT误差太大的问题:

    1. 修复决策树的bug:在上一次commit已经修复,只需要把第七章的代码完全复制过来;具体看上一次的提交信息:f7b9b7efd3b6ca9ace7a58df1eeb8d7338d7d5a9
    2. 修复决策树几乎不会训练的bug:GBDTRegressor类的初始化参数min_var_reduction=1e-6,由于这个值太小,会导致决策树几乎不会生成分支,所以我这里把默认值改为无穷大float("inf")。改动到这一步,误差已经大幅减小;
    3. 修复GBDT训练收敛太慢的bug(几乎不收敛):把预测值y_pred初始化为均值,可以明显加快收敛,学习率不变的情况下,训练15次就差不多够了,误差还能稍微再降低。
    4. 删除第7章决策树冗余,这是上一次commit增加的一行冗余代码。
    home-MSI committed Sep 15, 2024
    Configuration menu
    Copy the full SHA
    cfc903e View commit details
    Browse the repository at this point in the history

Commits on Sep 18, 2024

  1. Merge pull request luwill#16 from WhizZest/master

    解决第11章GBDT误差太大的问题
    luwill authored Sep 18, 2024
    Configuration menu
    Copy the full SHA
    f557538 View commit details
    Browse the repository at this point in the history
Loading