Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 1 addition & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
'prettier'
],
parserOptions: {
ecmaVersion: 2019,
ecmaVersion: 2022,
sourceType: 'module'
},
rules: {
Expand All @@ -27,7 +27,6 @@ module.exports = {
'error',
{ varsIgnorePattern: '^_', argsIgnorePattern: '^_' }
],
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-explicit-any': 'off'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 22
- name: Install, build, and verify
env:
CI: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x]
node-version: [18.x, 20.x, 22.x]

steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Run Checks
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ node_modules/
# Generated
coverage/
temp/
.husky/_

# Local benchmarks
benchmarks/local
Expand Down
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
5 changes: 4 additions & 1 deletion docs/VECTOR.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ export class SupportVectorMachineClassifier implements Classifier<SupportVectorM
predict(data: Matrix): Vector;
predictProbabilities(_data: Matrix): Vector;
train(data: Matrix, target: Vector): void;
}
}

// @public
export type SupportVectorMachineHyperparams = GradientDescentParameters & {
Expand Down Expand Up @@ -972,6 +972,9 @@ export function zeros(entries: number): Vector;
// @public
export function zeros(shape: MatrixShape): Matrix;

// Warnings were encountered during analysis:
//
// src/applications/machine-learning/models/LogisticRegressionClassifier.ts:121:3 - (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The package "@josh-brown/vector" does not have an export "GradientDescentClassifier"

// (No @packageDocumentation comment for this package)

Expand Down
24 changes: 21 additions & 3 deletions docs/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,25 @@

## Packages

| Package | Description |
| --- | --- |
| [@josh-brown/vector](./vector.md) | |
<table><thead><tr><th>

Package


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[@josh-brown/vector](./vector.md)


</td><td>


</td></tr>
</tbody></table>

6 changes: 4 additions & 2 deletions docs/api/vector.approximationfunction.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@

A function that takes a vector of inputs and produces an output. This must always be a pure function that is linear in its coefficients.

<b>Signature:</b>
**Signature:**

```typescript
export declare type ApproximationFunction<S> = (input: Vector<S>) => S;
export type ApproximationFunction<S> = (input: Vector<S>) => S;
```
**References:** [Vector](./vector.vector.md)

6 changes: 4 additions & 2 deletions docs/api/vector.approximationfunctiontemplate.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@

A higher-order function which is used to generate an `ApproximationFunction`<!-- -->. This must be linear in its coefficients, or the result of the linear regression will not be correct.

<b>Signature:</b>
**Signature:**

```typescript
export declare type ApproximationFunctionTemplate<S> = (coefficients: Vector<S>) => ApproximationFunction<S>;
export type ApproximationFunctionTemplate<S> = (coefficients: Vector<S>) => ApproximationFunction<S>;
```
**References:** [Vector](./vector.vector.md)<!-- -->, [ApproximationFunction](./vector.approximationfunction.md)

40 changes: 35 additions & 5 deletions docs/api/vector.arraymatrix.add.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,49 @@

Implements matrix addition

<b>Signature:</b>
**Signature:**

```typescript
add(other: Matrix<S>): Matrix<S>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| other | [Matrix](./vector.matrix.md)<!-- -->&lt;S&gt; | The matrix to add |
<table><thead><tr><th>

<b>Returns:</b>
Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

other


</td><td>

[Matrix](./vector.matrix.md)<!-- -->&lt;S&gt;


</td><td>

The matrix to add


</td></tr>
</tbody></table>

**Returns:**

[Matrix](./vector.matrix.md)<!-- -->&lt;S&gt;

Expand Down
4 changes: 2 additions & 2 deletions docs/api/vector.arraymatrix.adjoint.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

Returns the adjoint of the matrix

<b>Signature:</b>
**Signature:**

```typescript
adjoint(): Matrix<S>;
```
<b>Returns:</b>
**Returns:**

[Matrix](./vector.matrix.md)<!-- -->&lt;S&gt;

Expand Down
40 changes: 35 additions & 5 deletions docs/api/vector.arraymatrix.apply.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,49 @@

Applies the matrix as a linear transformation to the given vector. Implements matrix-vector multiplication.

<b>Signature:</b>
**Signature:**

```typescript
apply(vector: Vector<S>): Vector<S>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| vector | [Vector](./vector.vector.md)<!-- -->&lt;S&gt; | the vector that should be transformed by the matrix |
<table><thead><tr><th>

<b>Returns:</b>
Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

vector


</td><td>

[Vector](./vector.vector.md)<!-- -->&lt;S&gt;


</td><td>

the vector that should be transformed by the matrix


</td></tr>
</tbody></table>

**Returns:**

[Vector](./vector.vector.md)<!-- -->&lt;S&gt;

Expand Down
4 changes: 2 additions & 2 deletions docs/api/vector.arraymatrix.builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

Returns a [MatrixBuilder](./vector.matrixbuilder.md) which will build new matrices of the same type

<b>Signature:</b>
**Signature:**

```typescript
abstract builder(): MatrixBuilder<S, Vector<S>, Matrix<S>>;
```
<b>Returns:</b>
**Returns:**

[MatrixBuilder](./vector.matrixbuilder.md)<!-- -->&lt;S, [Vector](./vector.vector.md)<!-- -->&lt;S&gt;, [Matrix](./vector.matrix.md)<!-- -->&lt;S&gt;&gt;

53 changes: 47 additions & 6 deletions docs/api/vector.arraymatrix.combine.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,61 @@

Builds a matrix by combining element-wise the values of this matrix with the values of another matrix.

<b>Signature:</b>
**Signature:**

```typescript
combine(other: Matrix<S>, combineEntries: (a: S, b: S) => S): Matrix<S>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| other | [Matrix](./vector.matrix.md)<!-- -->&lt;S&gt; | |
| combineEntries | (a: S, b: S) =&gt; S | |
<table><thead><tr><th>

<b>Returns:</b>
Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

other


</td><td>

[Matrix](./vector.matrix.md)<!-- -->&lt;S&gt;


</td><td>


</td></tr>
<tr><td>

combineEntries


</td><td>

(a: S, b: S) =&gt; S


</td><td>


</td></tr>
</tbody></table>

**Returns:**

[Matrix](./vector.matrix.md)<!-- -->&lt;S&gt;

Expand Down
40 changes: 35 additions & 5 deletions docs/api/vector.arraymatrix.equals.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,49 @@

Tests if two matrices are equal

<b>Signature:</b>
**Signature:**

```typescript
equals(other: Matrix<S>): boolean;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| other | [Matrix](./vector.matrix.md)<!-- -->&lt;S&gt; | The matrix against which to compare |
<table><thead><tr><th>

<b>Returns:</b>
Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

other


</td><td>

[Matrix](./vector.matrix.md)<!-- -->&lt;S&gt;


</td><td>

The matrix against which to compare


</td></tr>
</tbody></table>

**Returns:**

boolean

Expand Down
Loading