GithubHelp home page GithubHelp logo

javascript-machine-learning / logistic-regression-gradient-descent-javascript Goto Github PK

View Code? Open in Web Editor NEW
12.0 12.0 4.0 32 KB

⭐️ Logistic Regression with Gradient Descent in JavaScript

Home Page: https://www.robinwieruch.de/logistic-regression-gradient-descent-javascript/

JavaScript 100.00%
javascript logistic-regression machine-learning

logistic-regression-gradient-descent-javascript's People

Contributors

rwieruch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

logistic-regression-gradient-descent-javascript's Issues

4PL and 5PL curve fit?

Hi rw;eruch,
is it possible to use your method to perform 4PL and 5PL curve fit?

image

These are used in molecular biology to calculate unknown sample activity from calibration curve in ELISA assay.

I've found examples in R and Python, but was hoping to find / adjust a solution in JS, so I can put a webpage that does a quick calculation and a chart.

For example, for these data:

x y
25 1.7914
12.5 1.682833
6.25 1.500367
3.125 1.179967
1.563 0.822533
0.781 0.501933
0.391 0.301333
0.195 0.187467
0.098 0.130033

plate reader software gives these parameters for 5PL curve fit:

A B C D G
0.0831 1.16 2.44 1.87 1.13

Initial parameters (ABCDG) can be set as follows:
5PL or 4PL
where:
A: Minimum asymptote. In a bioassay where you have a standard curve, this can be thought of as the response value at 0 standard concentration. A = Min(y)

B: Hill's slope. The Hill's slope refers to the steepness of the curve. It could either be positive or negative. B = the slope of the line between highest and lowest point, for example Δy/Δx : (1.7914-0.130033)/(25-0.098)

C: Inflection point. The inflection point is defined as the point on the curve where the curvature changes direction or signs. C is the concentration of analyte where C=(D-A)/2

D: Maximum asymptote. In an bioassay where you have a standard curve, this can be thought of as the response value for infinite standard concentration. D = Max(y)

G: Asymmetry factor. When G=1 we have a symmetrical curve around inflection point and so we have a four-parameters logistic equation. G = 1

Example of 4PL fitting in Python:
https://people.duke.edu/~ccc14/pcfb/analysis.html

R code example for both functions :
https://weightinginbayesianmodels.github.io/poctcalibration/calib_tut4_curve_background.html
or here: https://rdrr.io/cran/ELISAtools/src/R/Regression.R

I'd appreciate your advice on whether these can be computed in JS, or need math/stats packages from R/Python.

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.