• CHANGELOG.md
• Example
• Installing
• Versions
• 26

# grizzly_regress

Regression models for Dart

# TODO

• [ ] Linear regression
• [ ] OLS
• [ ] Closed form
• [ ] WLS
• [ ] GLS
• [ ] Others
• [ ] Linear regression result
• [ ] R^2
• [ ] F-value
• [ ] MSE
• [ ] Logistic regression

## Extra

• [ ] Ensemble
• [ ] Model selection
• [ ] Plots

# Changelog

## 0.0.2-dev

• Separated linear algebra into its own package

## 0.0.1-dev

• `OLS` implementation
• `RegressionResult` implementation

example/grizzly_regress_example.dart

``````// Copyright (c) 2017, SERAGUD. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

import 'package:grizzly_series/grizzly_series.dart';
import 'package:grizzly_regress/grizzly_regress.dart';
import 'package:grizzly_linalg/grizzly_linalg.dart';

main() {
final a = array2D([
[1, 0, 1],
[-1, -2, 0],
[0, 1, -1]
]);

/*
final a = array2D([
[1, 2],
[3, 4],
[5, 6],
[7, 8]
]);
*/

final svd = new SVD(a);
print(svd.u);
print(svd.s);
print(svd.v);
print(svd.u *
new Double2D.diagonal(svd.s) *
svd.v.transpose);

/* TODO
final u = array2D([
[-0.1525, -0.8226],
[-0.3499, -0.4214],
[-0.5474, -0.0201],
[-0.7448, 0.3812]
]);
final s = array2D([[14.2691, 0], [0, 0.6268]]);
final v = array2D([[-0.6414, 0.7672], [-0.7672, -0.6414]]);
print(u * s * v.transpose);
*/

/*
final x = new Int2D.columns([
new List<int>.generate(100, (i) => i + 1),
]).toDouble;
print(x);
final y = (x * [5]).row.sum;
print(y);
*/

/*
final res1 = new OLSGD().fitMultipleX(x, y);
print(res1.coeff);
print(res1.predict(x[0].toInt()));
*/

/*
final lst =
lst.learn();
print(lst.params);
*/

/*
final x = array2D([
[1, 2],
[2, 3],
[3, 4],
[4, 5],
[5, 6],
]);
final y = (x * [5, 2]).row.sum + 7;
print(y);
final RegressionResult res = ols.fitMultipleX(x, y, fitIntercept: true);
print(res.coeff);
print(res.predict(x[0].toInt()));
*/

/* TODO
final xQR = qr(x);
print(xQR.q);
print(xQR.r);

final LU xLU = lu(x);

print(xLU.pivotMatrix);

print(xLU.lowerFactor);

print(xLU.upperFactor);

print(xLU.pivotMatrix * xLU.lowerFactor * xLU.upperFactor);

final b = solve(xQR.r, xQR.q.transpose * y.transpose);

print(b);

print(x * b);
*/

/*
final x = array2D([
[1, 2],
[2, 3],
[3, 4],
[4, 5],
[5, 6],
]);

final y = (x * [5, 2]).sumCol;
print(y);

final xQR = qr(x);
print(xQR.q);
print(xQR.r);
print(xQR.rDiag);

print(xQR.q.dot(xQR.r));

print((xQR.q.transpose * y).transpose);

final b = xQR.solve(y.transpose);
print(b);
print(x * b);
*/

/*
final x = new Double2DArray.fromNum([
[1],
[2],
[3],
[4],
[5],
]);

final y = x.col[0] * 5;
print(y);

final xQR = qr(x);
print(xQR.q);
print(xQR.r);

print(xQR.q.dot(xQR.r));

print(xQR.solve(y.transpose()));
*/

/*
print(array2D([
[3.0, 1.0],
[1.0, 2.0]
]) *
array2D([
[2.0],
[3.0]
]));
*/
}
``````

### 1. Depend on it

``````
dependencies:
grizzly_regress: "^0.0.2-dev"

``````

### 2. Install it

You can install packages from the command line:

with pub:

``````
\$ pub get

``````

with Flutter:

``````
\$ flutter packages get

``````

Alternatively, your editor might support `pub get` or `packages get`. Check the docs for your editor to learn more.

### 3. Import it

Now in your Dart code, you can use:

``````
import 'package:grizzly_regress/grizzly_regress.dart';
``````
0.0.2-dev Oct 21, 2017
0.0.1-dev Oct 19, 2017

## Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

• tool failures on Feb 16, 2018
• Dart: 2.0.0-dev.20.0
• pana: 0.10.1

#### Scores

 Popularity: Describes how popular the package is relative to other packages. [more] 0 / 100 Health: Code health derived from static analysis. [more] 31 / 100 Maintenance: Reflects how tidy and up-to-date the package is. [more] 83 / 100 Overall score: Weighted score of the above. [more] 26

#### Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library `package:grizzly_regress/grizzly_regress.dart`.

#### Suggestions

• Fix `lib/src/core/model.dart`.

Strong-mode analysis of `lib/src/core/model.dart` failed with the following error:

line: 62 col: 2
Undefined class 'Numeric2DView'.

• Fix `lib/src/core/result.dart`.

Strong-mode analysis of `lib/src/core/result.dart` failed with the following error:

line: 16 col: 8
Undefined class 'Numeric2DView'.

• Fix further 4 Dart files.

Similar analysis of the following files failed:

• lib/src/linear/multivariate_ols.dart
• lib/src/linear/ols.dart
• lib/src/linear/ols_gd.dart
• lib/src/grizzly_regress_base.dart
• Fix issues reported by `dartanalyzer`.

`dartanalyzer` reported 3 error(s) and 0 warning(s).

• Package is pre-release.

Pre-release versions should be used with caution, their API may change in breaking ways.

• The description is too short.

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

• Package is pre-v1 release.

While there is nothing inherently wrong with versions of `0.*.*`, it usually means that the author is still experimenting with the general direction API.

#### Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <2.0.0
grizzly_linalg ^0.0.1-dev 0.0.2-dev
grizzly_series ^0.0.10-dev 0.0.23-dev
Transitive dependencies
grizzly_primitives 0.0.9 0.1.0
grizzly_scales 0.0.3-dev
meta 1.1.2