Coder Social home page Coder Social logo

bigshooter / regressino Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cubiwan/regressino

0.0 0.0 0.0 433 KB

Calculate potential, exponential, logarithmic, lineal and logistic regressio in Arduino.

License: GNU General Public License v3.0

C++ 100.00%

regressino's Introduction

Regressino     Buy Me a Coffee at ko-fi.com

Library to calculate potential, exponential, logarithmic, lineal and logistic regression in Arduino.

Lineal: Y = a*X + b
Exponential: Y = b * e^(a*X)
Logarithmic: Y = a*ln(X) + b
Potential: Y = b * x^a
Logistic: Y = 1 / (1 + e^-(a*x+b))
Polynomial: Y = a1x^2 + a2x + b
Linear2d: Y = a1x1 + a2x2 + b
Logistic2d:Y = 1 / (1 + e^-(1x1 + a2x2 + b))

Graphs with a = 2 and b = 3:

Logistic regression:

Polynomial regression:

Linear and Logistic 2 variables

Use

Include

1 variable

Linear

#include <LinearRegression.h>

LinearRegression lr = LinearRegression();

Exponential

#include <ExponentialRegression.h>

ExponentialRegression er = ExponentialRegression;

Logarithmic

#include <LogarithmicRegression.h>

LogarithmicRegression lr = LogarithmicRegression();

Potential

#include <PotentialRegression.h>

PotentialRegression pr = PotentialRegression();

Logistic

#include <LogisticRegression.h>

LogisticRegression pr = LogisticRegression();

Polynomial

#include < PolynomialRegression.h>

 PolynomialRegression pr =  PolynomialRegression();

2 variables

Linear2d

#include <LinearRegression2d.h>

LinearRegression lr = LinearRegression2d();

Logistic2d

#include <LogisticRegression2d.h>

LogisticRegression pr = LogisticRegression2d();

Methods 1 variable

void learn(double x, double y);  

Learns one example.

  • x: value of X
  • y: value of Y

double calculate(double x1);  

Estimates value of Y for X

  • x: value of x

double correlation();  

Return correlation value

void reset();  

Reset values. Start learning since zero.

void parameters(double values[]);

Return parameters of the regression y = mx + b

  • values[0] = m;
  • values[1] = b;

In polynomial values are y = b1x^2 + b2x + a :

  • values[0] = b1;
  • values[1] = b2;
  • values[2] = a;

double error(double x, double y);  

Return estimation error. If you need more options to calculate error you can use error module from SimpleStatisticsArduino

void samples();

Return number of examples learned

Methods 2 variables

void learn(double x1, double x2, double y);  

Learns one example.

  • x1: value of X1
  • x2: value of X2
  • y: value of Y

double calculate(double x1, double x2);  

Estimates value of Y

  • x1: value of x1
  • x2: value of x2

double correlation();  

Return correlation value

double correlationX1Y();  

Return correlation value between X1 and Y

double correlationX1Y();  

Return correlation value between X1 and Y

double correlationX2Y();  

Return correlation value between X2 and Y

double correlationX1X2();  

Return correlation value between X1 and X2

void reset();  

Reset values. Start learning since zero.

void parameters(double values[]);

Return parameters of the regression y = b1x1 + b2x2 + a

  • values[0] = b1;
  • values[1] = b2;
  • values[2] = a;

double error(double x1, double x2, double y);  

Return estimation error. If you need more options to calculate error you can use error module from SimpleStatisticsArduino

void samples();

Return number of examples learned

regressino's People

Contributors

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