Skip to content

Commit 6bd4669

Browse files
committed
chore: do not use default exports
BREAKING CHANGE: replace the default export by a named export
1 parent c9ad7aa commit 6bd4669

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ Confusion matrix for supervised classification. Compute metrics on your classifi
1616

1717
```js
1818
// CommonJS
19-
const ConfusionMatrix = require('ml-confusion-matrix');
19+
const { ConfusionMatrix } = require('ml-confusion-matrix');
2020

2121
// ES6 module syntax
22-
import ConfusionMatrix from 'ml-confusion-matrix';
22+
import { ConfusionMatrix } from 'ml-confusion-matrix';
2323
```
2424

2525
### Instanciate from the list of true and predicted labels

src/__tests__/fromLabels.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import ConfusionMatrix from '..';
1+
import { ConfusionMatrix } from '..';
22

33
describe('fromLabels', () => {
44
it('identity', () => {

src/__tests__/metrics.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import ConfusionMatrix from '..';
1+
import { ConfusionMatrix } from '..';
22

33
// Tests are based on wikipedia page
44
// https://en.wikipedia.org/wiki/Confusion_matrix

src/__tests__/test.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import ConfusionMatrix from '..';
1+
import { ConfusionMatrix } from '..';
22

33
let diagonal = {
44
matrix: [

src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @param matrix - The confusion matrix, a 2D Array. Rows represent the actual label and columns the predicted label.
77
* @param labels - Labels of the confusion matrix, a 1D Array
88
*/
9-
export default class ConfusionMatrix {
9+
export class ConfusionMatrix {
1010
private labels: Label[];
1111
private matrix: number[][];
1212
constructor(matrix: number[][], labels: Label[]) {

0 commit comments

Comments
 (0)