@elaraai/east-py-datascience

中文文档
1.0.107发布于 2026/11/13SEE LICENSE IN LICENSE.mdTypeScriptES Module零依赖构建来源已验证近 30 天下载 3699

East Data Science - ML/optimization platform functions for East (TypeScript definitions)

原始使用文档
文档目录17 节
  1. Installation
  2. Python Optional Dependencies
  3. Quick Start
  4. Modules
  5. Optimization
  6. Machine Learning
  7. Bayesian Inference
  8. Causal Inference
  9. Simulation
  10. Explainability
  11. Documentation
  12. Development
  13. Claude Code plugin
  14. License
  15. Ecosystem
  16. Links
  17. About Elara

East Data Science

Data science and ML platform functions for the East language

TypeScript: AGPL-3.0 Python: BSL 1.1 Node Version

East Data Science provides machine learning and optimization platform functions for the East language.

Installation

npm install @elaraai/east-py-datascience @elaraai/east

Python Optional Dependencies

Each module has its own optional Python dependencies to avoid installing unnecessary packages. Install only the extras you need:

# Single extra
pip install "east-py-datascience[scipy]"

# Multiple extras
pip install "east-py-datascience[scipy,sklearn,xgboost]"

# All extras
pip install "east-py-datascience[all]"

When using a git dependency in pyproject.toml:

"east-py-datascience[scipy] @ git+https://github.com/elaraai/east-workspace@main#subdirectory=libs/east-py/packages/east-py-datascience"
ModuleExtraPython Packages
MADSmadsPyNomadBBO
Optunaoptunaoptuna
SimAnnealsimannealsimanneal
Scipyscipyscipy, cloudpickle
Optimization(none)(core only — numpy)
GoogleOrgoogle-orortools
Sklearnsklearnscikit-learn, skl2onnx, onnxruntime, cloudpickle
XGBoostxgboostxgboost, cloudpickle
LightGBMlightgbmlightgbm, cloudpickle
NGBoostngboostngboost, cloudpickle
Torchtorchtorch, cloudpickle
GPgpscikit-learn, cloudpickle
Lightninglightningtorch, pytorch-lightning, cloudpickle
Shapshapshap, cloudpickle
MAPIEmapiemapie, cloudpickle
ALNSalnsalns
PyMCpymcpymc, cloudpickle
Simulation(none)(core only — numpy)
Causalcausaldowhy, econml, PyALE, pandas, matplotlib, scikit-learn, cloudpickle

Quick Start

import { East, FloatType, variant } from "@elaraai/east";
import { MADS } from "@elaraai/east-py-datascience";

// Define objective function: minimize sum of squares
const objective = East.function([MADS.Types.VectorType], FloatType, ($, x) => {
    const x0 = $.let(x.get(0n));
    const x1 = $.let(x.get(1n));
    return $.return(x0.multiply(x0).add(x1.multiply(x1)));
});

// Optimize
const optimize = East.function([], MADS.Types.ResultType, $ => {
    const x0 = $.let([0.5, 0.5]);
    const bounds = $.let({
        lower: [-1.0, -1.0],
        upper: [1.0, 1.0],
    });
    const config = $.let({
        max_bb_eval: variant('some', 100n),
        display_degree: variant('some', 0n),
        direction_type: variant('none', null),
        initial_mesh_size: variant('none', null),
        min_mesh_size: variant('none', null),
        seed: variant('some', 42n),
    });

    return $.return(MADS.optimize(objective, x0, bounds, variant('none', null), config));
});

Modules

Optimization

ModuleDescriptionUse Cases
MADSDerivative-free blackbox optimization using NOMAD algorithmFunctions without derivatives, expensive evaluations, noisy/discontinuous objectives
OptunaBayesian optimization with TPE samplerHyperparameter tuning, mixed-type parameters, efficient search with few evaluations
SimAnnealSimulated annealing for discrete optimizationTSP, scheduling, subset selection, knapsack, assignment problems
ScipyScientific optimization and curve fittingGradient-based minimization, curve fitting, interpolation, statistics
OptimizationIterative coordinate descent optimizationParameter tuning, sequential optimization across parameter groups
GoogleOrGoogle OR-Tools constraint programming, routing, LP, and graph algorithmsCP-SAT, vehicle routing (TSP/VRP), linear/mixed-integer programming, min-cost flow, max flow, assignment, sparse min-cost assignment

Machine Learning

ModuleDescriptionUse Cases
SklearnCore ML utilities from scikit-learnN-way splits, preprocessing (Standard/MinMax/RobustScaler), encoding (Label/Ordinal), metrics, GMM clustering, multi-target regression
XGBoostGradient boosting with XGBoostRegression, classification, feature importance, fast training
LightGBMFast gradient boosting with leaf-wise growthLarge datasets, high cardinality features, faster than XGBoost on big data
NGBoostNatural gradient boosting with uncertaintyProbabilistic predictions, confidence intervals, uncertainty quantification
TorchNeural networks with PyTorchMLP regression/classification, deep learning, custom architectures
LightningPyTorch Lightning neural networksMLP, autoencoder, conv1d, sequential, transformer architectures
GPGaussian Process regressionSmall datasets, uncertainty quantification, Bayesian optimization surrogate
MAPIEConformal prediction intervalsPrediction intervals, prediction sets, uncertainty quantification

Bayesian Inference

ModuleDescriptionUse Cases
PyMCBayesian inference with PyMCBayesian linear regression, hierarchical models, multi-layer joint estimation, posterior analysis

Causal Inference

ModuleDescriptionUse Cases
CausalOne declarative causal experiment (Causal.experiment) over DoWhy / EconML / PyALE internals, plus Causal.designValidation (statsmodels power)Naive vs adjusted effect, confounder balance, propensity overlap, placebo/E-value robustness, and an honesty verdict (refuses when the data can't support an answer); and the real controlled-trial recipe that would confirm it — sample size, split, match-on categories, and a power curve

Simulation

ModuleDescriptionUse Cases
SimulationEconomic ontology simulation via DESSimulating economic resources, events, and processes; single deterministic runs, Monte Carlo trajectories

Explainability

ModuleDescriptionUse Cases
ShapSHAP values for model interpretationFeature importance, model explanations, debugging predictions

Documentation

See USAGE.md for detailed API reference with examples.

Development

npm run build     # Compile TypeScript
npm run test      # Run test suite
npm run lint      # Check code quality

Claude Code plugin

The East ecosystem also ships a Claude Code plugin — East language skills, example search, and preemptive diagnostics for East code — installed separately from the elaraai marketplace:

# Inside Claude Code
/plugin marketplace add elaraai/east-workspace
/plugin install east@elaraai
# From a terminal
claude plugin marketplace add elaraai/east-workspace
claude plugin install east@elaraai

License

This package has different licenses for TypeScript and Python code:

TypeScript (type definitions): Dual AGPL-3.0 / Commercial

Python (runtime implementations): BSL 1.1 (Business Source License)

  • Non-production use (evaluation, testing, development) is free
  • Production use by or on behalf of for-profit entities requires a commercial license
  • Code becomes AGPL-3.0 four years after each release

See LICENSE.md for full details.

Commercial licensing: [email protected]

Ecosystem

  • East: Statically typed, expression-based language with serializable IR. Run portable logic across TypeScript, Python, C, and other runtimes.

    • @elaraai/east: Core language SDK with type system, expressions, and reference JS compiler
  • East Node: Node.js platform functions for I/O, databases, and system operations.

  • East C: C11 native runtime for executing East IR. Distributed via npm (launcher + per-platform optional dependencies) and as tarballs on each GitHub Release.

    • @elaraai/east-c-cli: npm launcher — installs the matching native binary as an optional dependency
    • east-c: Core runtime — type system, IR interpreter, builtins, serialization (Beast2, JSON, CSV, East text)
    • east-c-std: Console, FileSystem, Fetch, Crypto, Time, Path, Random
    • east-c-cli: CLI for running East IR programs natively
  • East Python: Python runtime, standard platform, I/O, and data-science platform functions. Published to PyPI.

    • east-py: Core Python runtime — type system, IR compiler, 212+ builtins, Cython-accelerated hot paths
    • east-py-std: Console, FileSystem, Fetch, Crypto, Time, Path, Random
    • east-py-io: SQLite, PostgreSQL, MySQL, MongoDB, Redis, S3, FTP, SFTP, XLSX, XML, compression
    • east-py-cli: CLI for running East IR programs in Python
    • east-py-datascience (PyPI) + @elaraai/east-py-datascience (npm): Optimization (MADS, Optuna, ALNS, GoogleOR), ML (XGBoost, LightGBM, NGBoost, PyTorch, Lightning, GP), Bayesian inference (PyMC), explainability (SHAP), conformal prediction (MAPIE)
  • East UI: Typed UI component definitions and React renderer, plus VS Code preview.

  • e3 — East Execution Engine: Durable execution engine for running East pipelines at scale. Git-like content-addressable storage, automatic memoization, reactive dataflow, real-time monitoring.

About Elara

East is developed by Elara AI Pty Ltd, an AI-powered platform that creates economic digital twins of businesses that optimize performance. Elara combines business objectives, decisions and data to help organizations make data-driven decisions across operations, purchasing, sales and customer engagement, and project and investment planning. East powers the computational layer of Elara solutions, enabling the expression of complex business logic and data in a simple, type-safe and portable language.


Developed by Elara AI Pty Ltd.


Developed by Elara AI Pty Ltd

版本与发布记录

@elaraai/east-py-datascience 共发布 190 个版本,首次发布于 2025/12/07;过去 12 个月发布了 190 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.0.107latest2026/11/13今天
1.0.1062026/11/094 天前
1.0.1052026/11/085 天前
1.0.1042026/11/067 天前
1.0.1032026/11/049 天前
1.0.1022026/11/0310 天前

其他发布通道:beta → 0.0.2-beta.84。

关于 @elaraai/east-py-datascience 的常见问题

@elaraai/east-py-datascience 是什么?

East Data Science - ML/optimization platform functions for East (TypeScript definitions)

如何安装 @elaraai/east-py-datascience?

在项目目录运行 npm install @elaraai/east-py-datascience,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@elaraai/east(1.0.107)、@elaraai/east-node-std(1.0.107)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@elaraai/east-py-datascience 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@elaraai/east-py-datascience 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@elaraai/east-py-datascience 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@elaraai/east-py-datascience 可以商用吗?

@elaraai/east-py-datascience 使用 SEE LICENSE IN LICENSE.md 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

@elaraai/east-py-datascience 的下载量有多少?

根据 npm 官方下载统计,@elaraai/east-py-datascience 在 2026/10/13 – 2026/11/11 这 30 天内被下载 3,699 次,日均约 123 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@elaraai/east-py-datascience 还在维护吗?

最新版本 1.0.107 发布于 2026/11/13(今天);至今共发布 190 个版本,其中过去 12 个月发布了 190 个;首次发布于 2025/12/07。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。