Skip to content

[Autoloop: build-tsikit-learn-scikit-learn-typescript-migration]Β #7

Description

@github-actions

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

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:

network:
  allowed:
    - defaults
    - "releaseassets.githubusercontent.com"

See Network Configuration for more information.

Generated by Autoloop Β· ● 42.7M Β· β—·

To install this agentic workflow, 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

The bundle file is available in the agent artifact in the workflow run linked above.

To create a pull request with the changes:

# 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions