mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/reg] Display the regression layouts is RegressionController
This commit is contained in:
@@ -1,9 +1,36 @@
|
||||
#include "logistic_model.h"
|
||||
#include <math.h>
|
||||
#include <assert.h>
|
||||
#include "../../poincare/include/poincare_layouts.h"
|
||||
|
||||
using namespace Poincare;
|
||||
|
||||
namespace Regression {
|
||||
|
||||
ExpressionLayout * LogisticModel::Layout() {
|
||||
static ExpressionLayout * layout = nullptr;
|
||||
if (layout == nullptr) {
|
||||
const ExpressionLayout * layoutChildren[] = {
|
||||
new CharLayout('a', KDText::FontSize::Small),
|
||||
new CharLayout('+', KDText::FontSize::Small),
|
||||
new CharLayout('e', KDText::FontSize::Small),
|
||||
new VerticalOffsetLayout(
|
||||
new HorizontalLayout(
|
||||
new CharLayout('-', KDText::FontSize::Small),
|
||||
new CharLayout('b', KDText::FontSize::Small),
|
||||
new CharLayout('X', KDText::FontSize::Small),
|
||||
false),
|
||||
VerticalOffsetLayout::Type::Superscript,
|
||||
false)
|
||||
};
|
||||
layout = new FractionLayout(
|
||||
new CharLayout('c', KDText::FontSize::Small),
|
||||
new HorizontalLayout(layoutChildren, 4, false),
|
||||
false);
|
||||
}
|
||||
return layout;
|
||||
}
|
||||
|
||||
double LogisticModel::evaluate(double * modelCoefficients, double x) const {
|
||||
double a = modelCoefficients[0];
|
||||
double b = modelCoefficients[1];
|
||||
|
||||
Reference in New Issue
Block a user