Code Monkey home page Code Monkey logo

machine-learning-by-python's Introduction

Machine-Learning-by-python

利用python实现经典的机器学习算法,希望能将主流的算法集成一个库(Freeman)

KNN库

基于欧氏距离的最邻近算法 优化:

  • 各个维度采取最值标准化,以使得各个特征的影响程度均匀;
  • 在K个最邻近点中,给每个点一权重,使得投票更公平,K的影响力最小

linear_model库

LinearRegression

提供了predict方法进行预测

线性回归:

  • 最小二乘法:least_square
  • 梯度下降:1.批量梯度下降gradientDescent、2.随机梯度下降stochasticGradientDescent、3.随机梯度改进stochasticGradientDescentNice(加入了random.choice,增加了随机性)

LogisticRegression

提供了predict方法进行预测

逻辑回归(对数几率):

  • 最小二乘法:least_square
  • 梯度下降:1.批量梯度下降gradientDescent、2.随机梯度下降stochasticGradientDescent、3.随机梯度改进stochasticGradientDescentNice(加入了random.choice,增加了随机性)

tree_model库

DecisionTree:包含ID3、C4.5、CART三种算法

  • ID3:根据信息熵增进行最佳分割点的选择
  • C4.5:根据信息熵增率进行最佳分割点的选择
  • CART:根据基尼指数进行最佳分割点的选择

使用方法:

  • 实例化DecisionTree,可将mode=ID3、C4.5、CART作为参数输入来选择决策树种类
  • fit() 用训练集训练决策树
  • predict() 用训练好的决策树预测测试集
  • show()     画出决策树
  • model_save()   保存模型,利用pickl库
  • model_load()   载入之前训练好的模型

machine-learning-by-python's People

Contributors

freemanzxp avatar

Watchers

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