githubnext / githubnext/tsikit-learn

[Autoloop: build-tsikit-learn-scikit-learn-typescript-migration]

Open
#7 0 comments 0 reactions 0 assignees View on GitHub
agentic-workflows autoloop automation
Dominant language
TypeScript
Stars
1
Forks
1
PR merge metrics
No merged PRs in 30d

Description

## tsikit-learn: scikit-learn → TypeScript Migration

🤖 *This PR is maintained by Autoloop. Each accepted iteration adds a commit to this branch.*

**Program Goal**: Build `tsikit-learn`, a complete TypeScript port of scikit-learn, one feature at a time.

**Issue**: #5

**Current Best Metric**: `sklearn_features_ported = 11` (up from 2)

---

### Iteration 2 Summary

This iteration establishes the complete project foundation and ports **Phase 1 (Foundation)** and **Phase 2 (Preprocessing & Metrics)** of the migration plan:

**Project infrastructure:**
- `package.json`, `tsconfig.json` (strictest settings), `biome.json`, `bunfig.toml`
- `.github/workflows/ci.yml` — CI with Bun test, typecheck, GitHub Pages deploy
- `AGENTS.md` — agent instructions and project conventions
- `playground/index.html` — interactive feature roadmap showing ported vs pending modules

**Phase 1 — Foundation (6 modules):**
- `src/exceptions.ts` — NotFittedError, ConvergenceWarning, DataConversionWarning, etc.
- `src/base.ts` — BaseEstimator, ClassifierMixin, RegressorMixin, TransformerMixin, ClusterMixin, Matrix2D interface, checkIsFitted, clone
- `src/utils/extmath.ts` — rowNorms, softmax, logLogistic, safeSparseDot, matVecDot, colMean, colVar, logSumExp
- `src/utils/validation.ts` — checkArray, checkXy, checkNFeatures, isMatrix2D, validateSampleWeight, columnMinMax
- `src/utils/multiclass.ts` — typeOfTarget, uniqueLabels, labelBinarize, nClasses
- `src/utils/class_weight.ts` — computeClassWeight, computeSampleWeight

**Phase 2 — Preprocessing & Metrics (5 modules):**
- `src/preprocessing/standard_scaler.ts` — StandardScaler (fit, transform, inverseTransform, fitTransform)
- `src/preprocessing/minmax_scaler.ts` — MinMaxScaler (configurable feature range)
- `src/preprocessing/label_encoder.ts` — LabelEncoder, Normalizer (L1/L2/max)
- `src/metrics/regression.ts` — MSE, RMSE, MAE, R2, MAPE, explainedVariance, medianAbsoluteError
- `src/metrics/classification.ts` — accuracy, confusionMatrix, precision, recall, F1, logLoss, zeroOneLoss
- `src/model_selection/index.ts` — trainTestSplit (seeded shuffle), KFold

**Tests**: 25+ test cases covering all ported modules with property-based assertions.

---

**Metric**: `sklearn_features_ported`: 2 → **11** (+9)
**Actions run**: [§25721028611](https://github.com/githubnext/tsikit-learn/actions/runs/25721028611)

> [!WARNING]
>
> Firewall blocked 1 domain
>
> The following domain was blocked by the firewall during workflow execution:
>
> - `releaseassets.githubusercontent.com`
>> To allow these domains, add them to the `network.allowed` list in your workflow frontmatter:
>
> ```yaml
> network:
> allowed:
> - defaults
> - "releaseassets.githubusercontent.com"
> ```
>
> See [Network Configuration](https://github.github.com/gh-aw/reference/network/) for more information.
>
>

> Generated by [Autoloop](https://github.com/githubnext/tsikit-learn/actions/runs/25721028611/agentic_workflow) · ● 42.7M · [◷](https://github.com/search?q=repo%3Agithubnext%2Ftsikit-learn+%22gh-aw-workflow-id%3A+autoloop%22&type=pullrequests)
>
> To install this [agentic workflow](https://github.com/.github/workflows/blob/main/autoloop.md), run
> ```
> gh aw add .github/workflows/autoloop.md
> ```

---

> [!NOTE]
> This was originally intended as a pull request, but the git push operation failed.
>
> **Workflow Run:** [View run details and download bundle artifact](https://github.com/githubnext/tsikit-learn/actions/runs/25721028611)
>
> The bundle file is available in the `agent` artifact in the workflow run linked above.

To create a pull request with the changes:

```sh
# Download the artifact from the workflow run
gh run download 25721028611 -n agent -D /tmp/agent-25721028611

# Fetch the bundle into a local branch
git fetch /tmp/agent-25721028611/aw-autoloop-build-tsikit-learn-scikit-learn-typescript-migration.bundle refs/heads/autoloop/build-tsikit-learn-scikit-learn-typescript-migration:refs/heads/autoloop/build-tsikit-learn-scikit-learn-typescript-migration
git checkout autoloop/build-tsikit-learn-scikit-learn-typescript-migration

# Push the branch to origin
git push origin autoloop/build-tsikit-learn-scikit-learn-typescript-migration

# Create the pull request
gh pr create --title '[Autoloop: build-tsikit-learn-scikit-learn-typescript-migration]' --base main --head autoloop/build-tsikit-learn-scikit-learn-typescript-migration --repo githubnext/tsikit-learn
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.