Giter Club home page Giter Club logo

lr's Introduction

1 linear regression and logistic regression

1, 一元二次方程求极值

梯度下降法: lr_1.cpp lr_1.py

while ( max_iterate_num or other ) {
    x = x - alpha * 导数(f(x))
}

2, 一元线性回归

g++ lr_2.cpp
After 1500 iterates, the cost Error(w0, w1) is *41.844789*
w0 = [0.018653], w1 = [2.981086]
predict(112) = 333.900241
predict(110) = 327.938070

2.1 最小二乘拟合

python least_square.py

least square error cost(-23.5512952764, 3.20708095323) is *35.1218735092*
predict(112) =  335.641771485
predict(110) =  329.227609578

2.2 一元线性回归 与 最小二乘拟合对比

3, 多元线性回归

g++ lr_3.cpp
After 1500 iterates, the cost Error(w0, w1) is 40.559510
w0=-0.053241
w1=2.973633
w2=0.364542
w3=0.196225
w4=-0.198871
predict(112) = 325.488320
predict(110) = 325.977873

4, 逻辑回归

sigmoid 函数:

lr's People

Contributors

tidalmelon avatar

Watchers

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