Skip to content

Commit 4975d96

Browse files
authored
Merge pull request #230 from javascriptdata/readme-updates-3
updated docs
2 parents 0ede241 + 63a2197 commit 4975d96

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const sk = require('scikitjs')
4848
sk.setBackend(tf)
4949
```
5050

51-
Note: If you have ESM enabled (by setting type="module" in your package.json), then you can consume this libary with import / export, like in the following code block.
51+
Note: If you have ESM enabled (by setting type="module" in your package.json), then you can consume this library with import / export, like in the following code block.
5252

5353
```js
5454
import * as tf from '@tensorflow/tfjs-node'

docs/docs/python.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ Turns into
4747
#### javascript
4848

4949
```js
50-
import { LinearRegression } from 'scikitjs'
50+
import * as tf from '@tensorflow/tfjs'
51+
import { LinearRegression, setBackend } from 'scikitjs'
52+
setBackend(tf)
5153

5254
let X = [[1], [2]]
5355
let y = [10, 20]
@@ -77,7 +79,9 @@ Turns into
7779
#### javascript
7880

7981
```js
80-
import { LinearRegression } from 'scikitjs'
82+
import * as tf from '@tensorflow/tfjs'
83+
import { LinearRegression, setBackend } from 'scikitjs'
84+
setBackend(tf)
8185

8286
let X = [[1], [2]]
8387
let y = [10, 20]
@@ -112,7 +116,9 @@ Turns into
112116
#### javascript
113117

114118
```js
115-
import { LogisticRegression } from 'scikitjs'
119+
import * as tf from '@tensorflow/tfjs'
120+
import { LogisticRegression, setBackend } from 'scikitjs'
121+
setBackend(tf)
116122

117123
let X = [[1], [-1]]
118124
let y = [1, 0]

docs/docs/tutorial.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,29 @@ Let's discover **Scikit.js in less than 5 minutes**.
88

99
## Getting Started
1010

11-
Get started by **installing the library**.
11+
Get started by **installing the library as well as it's dependencies**.
1212

1313
```shell
14-
npm install scikitjs
14+
npm install scikitjs @tensorflow/tfjs
1515
```
1616

1717
or
1818

1919
```shell
20-
yarn add scikitjs
20+
yarn add scikitjs @tensorflow/tfjs
2121
```
2222

2323
## Build a model
2424

2525
Build a simple Linear Regression
2626

2727
```js
28-
import { LinearRegression } from 'scikitjs'
28+
// import tensorflow and register it as the backend
29+
import * as tf from '@tensorflow/tfjs'
30+
import { LinearRegression, setBackend } from 'scikitjs'
31+
setBackend(tf)
2932

33+
// Perform a linear regression
3034
let X = [
3135
[2, 3],
3236
[1, 4],

0 commit comments

Comments
 (0)