🌐 AI搜索 & 代理 主页
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const sk = require('scikitjs')
sk.setBackend(tf)
```

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.
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.

```js
import * as tf from '@tensorflow/tfjs-node'
Expand Down
12 changes: 9 additions & 3 deletions docs/docs/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ Turns into
#### javascript

```js
import { LinearRegression } from 'scikitjs'
import * as tf from '@tensorflow/tfjs'
import { LinearRegression, setBackend } from 'scikitjs'
setBackend(tf)

let X = [[1], [2]]
let y = [10, 20]
Expand Down Expand Up @@ -77,7 +79,9 @@ Turns into
#### javascript

```js
import { LinearRegression } from 'scikitjs'
import * as tf from '@tensorflow/tfjs'
import { LinearRegression, setBackend } from 'scikitjs'
setBackend(tf)

let X = [[1], [2]]
let y = [10, 20]
Expand Down Expand Up @@ -112,7 +116,9 @@ Turns into
#### javascript

```js
import { LogisticRegression } from 'scikitjs'
import * as tf from '@tensorflow/tfjs'
import { LogisticRegression, setBackend } from 'scikitjs'
setBackend(tf)

let X = [[1], [-1]]
let y = [1, 0]
Expand Down
12 changes: 8 additions & 4 deletions docs/docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,29 @@ Let's discover **Scikit.js in less than 5 minutes**.

## Getting Started

Get started by **installing the library**.
Get started by **installing the library as well as it's dependencies**.

```shell
npm install scikitjs
npm install scikitjs @tensorflow/tfjs
```

or

```shell
yarn add scikitjs
yarn add scikitjs @tensorflow/tfjs
```

## Build a model

Build a simple Linear Regression

```js
import { LinearRegression } from 'scikitjs'
// import tensorflow and register it as the backend
import * as tf from '@tensorflow/tfjs'
import { LinearRegression, setBackend } from 'scikitjs'
setBackend(tf)

// Perform a linear regression
let X = [
[2, 3],
[1, 4],
Expand Down