als-statistics
Version:
Modular JS statistics toolkit for Node.js and the browser: descriptive stats, correlations (Pearson/Spearman/Kendall), t-tests & ANOVA (Student/Welch), reliability (Cronbach’s alpha), regression (linear/logistic), clustering (DBSCAN/HDBSCAN), and table/co
29 lines (20 loc) • 960 B
Markdown
<title>Logistic Regression (Core)</title>
<description>## Class: `Regression.LogisticRegression`</description>
<keywords>logistic, regression, core, class, regression.logisticregression, public, fields, getters, methods, js, new, table</keywords>
# Logistic Regression (Core)
## Class: `Regression.LogisticRegression`
**Constructor**
```js
new Regression.LogisticRegression(table: Record<string, number[]>, yName: string, xNames: string[], stepIndex: number, learningRate=0.01, epochs=1000)
```
### Public fields / getters
- `coefficients: number[]` – `[Intercept, β1, …]`
- `y: number[]`, `X: number[][]`, `yHat: number[]` (predicted classes)
- `accuracy: number`
- `n: number`, `k: number`
- `result: { step, n, Variable, Coefficient, Accuracy }`
- `htmlTable: string`
### Methods
- `calculate(): this`
- `predictProba(X: number[][]): number[]` – probabilities via sigmoid.
- `predict(X: number[][], threshold=0.5): number[]` – hard labels.