@nirs4all/methods 1.3.9 → 1.3.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1658,6 +1658,26 @@ export declare class ApproximatePress extends NativeProcedure implements Procedu
1658
1658
  constructor(params?: ApproximatePressParams);
1659
1659
  run(X: Matrix, y?: Matrix | Float64Array | ArrayLike<number>, inputs?: FitInputs): Record<string, ProcedureOutput>;
1660
1660
  }
1661
+ /** Parameters of LocalDensity; unset values take the native defaults. */
1662
+ export interface LocalDensityParams {
1663
+ /** Default []. */
1664
+ valid_mask?: number[];
1665
+ /** Default "training". */
1666
+ mode?: "training" | "novelty";
1667
+ /** Default 20. */
1668
+ n_neighbors?: number;
1669
+ }
1670
+ /** Native `diagnostics.local_density` (generic). */
1671
+ export declare class LocalDensity extends NativeProcedure implements Procedure {
1672
+ readonly methodId = "diagnostics.local_density";
1673
+ readonly paramTypes: {
1674
+ readonly valid_mask: "int_array";
1675
+ readonly mode: "enum";
1676
+ readonly n_neighbors: "int";
1677
+ };
1678
+ constructor(params?: LocalDensityParams);
1679
+ run(X: Matrix, y?: Matrix | Float64Array | ArrayLike<number>, inputs?: FitInputs): Record<string, ProcedureOutput>;
1680
+ }
1661
1681
  /** Parameters of ModelSelection; unset values take the native defaults. */
1662
1682
  export interface ModelSelectionParams {
1663
1683
  }
@@ -1668,6 +1688,23 @@ export declare class ModelSelection extends NativeProcedure implements Procedure
1668
1688
  constructor(params?: ModelSelectionParams);
1669
1689
  run(X: Matrix, y?: Matrix | Float64Array | ArrayLike<number>, inputs?: FitInputs): Record<string, ProcedureOutput>;
1670
1690
  }
1691
+ /** Parameters of PCAReferenceQc; unset values take the native defaults. */
1692
+ export interface PCAReferenceQcParams {
1693
+ /** Default []. */
1694
+ valid_mask?: number[];
1695
+ /** Default 5. */
1696
+ n_components?: number;
1697
+ }
1698
+ /** Native `diagnostics.pca_reference_qc` (generic). Required inputs: target_domain. */
1699
+ export declare class PCAReferenceQc extends NativeProcedure implements Procedure {
1700
+ readonly methodId = "diagnostics.pca_reference_qc";
1701
+ readonly paramTypes: {
1702
+ readonly valid_mask: "int_array";
1703
+ readonly n_components: "int";
1704
+ };
1705
+ constructor(params?: PCAReferenceQcParams);
1706
+ run(X: Matrix, y?: Matrix | Float64Array | ArrayLike<number>, inputs?: FitInputs): Record<string, ProcedureOutput>;
1707
+ }
1671
1708
  /** Parameters of PLSDiagnostics; unset values take the native defaults. */
1672
1709
  export interface PLSDiagnosticsParams {
1673
1710
  /** Default 2. */
@@ -1733,6 +1770,72 @@ export declare class RegressionMetrics extends NativeProcedure implements Proced
1733
1770
  constructor(params?: RegressionMetricsParams);
1734
1771
  run(X: Matrix, y?: Matrix | Float64Array | ArrayLike<number>, inputs?: FitInputs): Record<string, ProcedureOutput>;
1735
1772
  }
1773
+ /** Parameters of SpectralEventsQc; unset values take the native defaults. */
1774
+ export interface SpectralEventsQcParams {
1775
+ /** Default []. */
1776
+ valid_mask?: number[];
1777
+ /** Default "index". */
1778
+ axis_basis?: "index" | "physical";
1779
+ /** Default []. */
1780
+ axis_values?: number[];
1781
+ /** Default 8. */
1782
+ outlier_threshold?: number;
1783
+ /** Optional: unset by default. */
1784
+ clip_lower?: number;
1785
+ /** Optional: unset by default. */
1786
+ clip_upper?: number;
1787
+ /** Default 0. */
1788
+ clip_tolerance?: number;
1789
+ }
1790
+ /** Native `diagnostics.spectral_events_qc` (generic). */
1791
+ export declare class SpectralEventsQc extends NativeProcedure implements Procedure {
1792
+ readonly methodId = "diagnostics.spectral_events_qc";
1793
+ readonly paramTypes: {
1794
+ readonly valid_mask: "int_array";
1795
+ readonly axis_basis: "enum";
1796
+ readonly axis_values: "double_array";
1797
+ readonly outlier_threshold: "double";
1798
+ readonly clip_lower: "double";
1799
+ readonly clip_upper: "double";
1800
+ readonly clip_tolerance: "double";
1801
+ };
1802
+ constructor(params?: SpectralEventsQcParams);
1803
+ run(X: Matrix, y?: Matrix | Float64Array | ArrayLike<number>, inputs?: FitInputs): Record<string, ProcedureOutput>;
1804
+ }
1805
+ /** Parameters of SpectralNoiseProxy; unset values take the native defaults. */
1806
+ export interface SpectralNoiseProxyParams {
1807
+ /** Default []. */
1808
+ valid_mask?: number[];
1809
+ }
1810
+ /** Native `diagnostics.spectral_noise_proxy` (generic). */
1811
+ export declare class SpectralNoiseProxy extends NativeProcedure implements Procedure {
1812
+ readonly methodId = "diagnostics.spectral_noise_proxy";
1813
+ readonly paramTypes: {
1814
+ readonly valid_mask: "int_array";
1815
+ };
1816
+ constructor(params?: SpectralNoiseProxyParams);
1817
+ run(X: Matrix, y?: Matrix | Float64Array | ArrayLike<number>, inputs?: FitInputs): Record<string, ProcedureOutput>;
1818
+ }
1819
+ /** Parameters of SpectralReferenceQc; unset values take the native defaults. */
1820
+ export interface SpectralReferenceQcParams {
1821
+ /** Default []. */
1822
+ valid_mask?: number[];
1823
+ /** Default "dataset_mean". */
1824
+ reference_mode?: "dataset_mean" | "supplied";
1825
+ /** Default []. */
1826
+ reference_valid_mask?: number[];
1827
+ }
1828
+ /** Native `diagnostics.spectral_reference_qc` (generic). */
1829
+ export declare class SpectralReferenceQc extends NativeProcedure implements Procedure {
1830
+ readonly methodId = "diagnostics.spectral_reference_qc";
1831
+ readonly paramTypes: {
1832
+ readonly valid_mask: "int_array";
1833
+ readonly reference_mode: "enum";
1834
+ readonly reference_valid_mask: "int_array";
1835
+ };
1836
+ constructor(params?: SpectralReferenceQcParams);
1837
+ run(X: Matrix, y?: Matrix | Float64Array | ArrayLike<number>, inputs?: FitInputs): Record<string, ProcedureOutput>;
1838
+ }
1736
1839
  /** Parameters of CorrelationFilter; unset values take the native defaults. */
1737
1840
  export interface CorrelationFilterParams {
1738
1841
  /** Default 0. */
@@ -1152,6 +1152,23 @@ export class ApproximatePress extends NativeProcedure {
1152
1152
  }
1153
1153
  }
1154
1154
  NativeMethod.register("diagnostics.approximate_press", ApproximatePress);
1155
+ /** Native `diagnostics.local_density` (generic). */
1156
+ export class LocalDensity extends NativeProcedure {
1157
+ methodId = "diagnostics.local_density";
1158
+ paramTypes = {
1159
+ valid_mask: "int_array",
1160
+ mode: "enum",
1161
+ n_neighbors: "int",
1162
+ };
1163
+ constructor(params = {}) {
1164
+ super();
1165
+ this.params = { ...params };
1166
+ }
1167
+ run(X, y, inputs = {}) {
1168
+ return this.runOutputs(X, y, inputs);
1169
+ }
1170
+ }
1171
+ NativeMethod.register("diagnostics.local_density", LocalDensity);
1155
1172
  /** Native `diagnostics.model_selection` (generic). */
1156
1173
  export class ModelSelection extends NativeProcedure {
1157
1174
  methodId = "diagnostics.model_selection";
@@ -1165,6 +1182,22 @@ export class ModelSelection extends NativeProcedure {
1165
1182
  }
1166
1183
  }
1167
1184
  NativeMethod.register("diagnostics.model_selection", ModelSelection);
1185
+ /** Native `diagnostics.pca_reference_qc` (generic). Required inputs: target_domain. */
1186
+ export class PCAReferenceQc extends NativeProcedure {
1187
+ methodId = "diagnostics.pca_reference_qc";
1188
+ paramTypes = {
1189
+ valid_mask: "int_array",
1190
+ n_components: "int",
1191
+ };
1192
+ constructor(params = {}) {
1193
+ super();
1194
+ this.params = { ...params };
1195
+ }
1196
+ run(X, y, inputs = {}) {
1197
+ return this.runOutputs(X, y, inputs);
1198
+ }
1199
+ }
1200
+ NativeMethod.register("diagnostics.pca_reference_qc", PCAReferenceQc);
1168
1201
  /** Native `diagnostics.pls_diagnostics` (generic). Required inputs: y. */
1169
1202
  export class PLSDiagnostics extends NativeProcedure {
1170
1203
  methodId = "diagnostics.pls_diagnostics";
@@ -1217,6 +1250,59 @@ export class RegressionMetrics extends NativeProcedure {
1217
1250
  }
1218
1251
  }
1219
1252
  NativeMethod.register("diagnostics.regression_metrics", RegressionMetrics);
1253
+ /** Native `diagnostics.spectral_events_qc` (generic). */
1254
+ export class SpectralEventsQc extends NativeProcedure {
1255
+ methodId = "diagnostics.spectral_events_qc";
1256
+ paramTypes = {
1257
+ valid_mask: "int_array",
1258
+ axis_basis: "enum",
1259
+ axis_values: "double_array",
1260
+ outlier_threshold: "double",
1261
+ clip_lower: "double",
1262
+ clip_upper: "double",
1263
+ clip_tolerance: "double",
1264
+ };
1265
+ constructor(params = {}) {
1266
+ super();
1267
+ this.params = { ...params };
1268
+ }
1269
+ run(X, y, inputs = {}) {
1270
+ return this.runOutputs(X, y, inputs);
1271
+ }
1272
+ }
1273
+ NativeMethod.register("diagnostics.spectral_events_qc", SpectralEventsQc);
1274
+ /** Native `diagnostics.spectral_noise_proxy` (generic). */
1275
+ export class SpectralNoiseProxy extends NativeProcedure {
1276
+ methodId = "diagnostics.spectral_noise_proxy";
1277
+ paramTypes = {
1278
+ valid_mask: "int_array",
1279
+ };
1280
+ constructor(params = {}) {
1281
+ super();
1282
+ this.params = { ...params };
1283
+ }
1284
+ run(X, y, inputs = {}) {
1285
+ return this.runOutputs(X, y, inputs);
1286
+ }
1287
+ }
1288
+ NativeMethod.register("diagnostics.spectral_noise_proxy", SpectralNoiseProxy);
1289
+ /** Native `diagnostics.spectral_reference_qc` (generic). */
1290
+ export class SpectralReferenceQc extends NativeProcedure {
1291
+ methodId = "diagnostics.spectral_reference_qc";
1292
+ paramTypes = {
1293
+ valid_mask: "int_array",
1294
+ reference_mode: "enum",
1295
+ reference_valid_mask: "int_array",
1296
+ };
1297
+ constructor(params = {}) {
1298
+ super();
1299
+ this.params = { ...params };
1300
+ }
1301
+ run(X, y, inputs = {}) {
1302
+ return this.runOutputs(X, y, inputs);
1303
+ }
1304
+ }
1305
+ NativeMethod.register("diagnostics.spectral_reference_qc", SpectralReferenceQc);
1220
1306
  /** Native `filters.correlation` (selector). */
1221
1307
  export class CorrelationFilter extends NativeEstimator {
1222
1308
  methodId = "filters.correlation";
package/dist/n4m.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nirs4all/methods",
3
- "version": "1.3.9",
3
+ "version": "1.3.11",
4
4
  "description": "WebAssembly build of libn4m (nirs4all-methods) — portable PLS/NIRS engine and native method bindings.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -20,7 +20,7 @@
20
20
  "build": "npm run clean && tsc -p .",
21
21
  "stage:wasm": "node -e \"const fs=require('fs'),p='../../build/emscripten/bindings/js/';fs.mkdirSync('dist',{recursive:true});for(const f of ['n4m.js','n4m.wasm']){if(!fs.existsSync(p+f))throw new Error('missing WASM artifact '+p+f+' — run: cmake --preset emscripten && cmake --build --preset emscripten --target n4m_wasm');fs.copyFileSync(p+f,'dist/'+f)}console.log('staged n4m.js + n4m.wasm into dist/')\"",
22
22
  "prepack": "npm run build && npm run stage:wasm",
23
- "test": "node --experimental-vm-modules test/run_smoke.mjs && node --experimental-vm-modules test/run_api.mjs && node --experimental-vm-modules test/run_generic_method.mjs && node --experimental-vm-modules test/run_pop_aom.mjs && node --experimental-vm-modules test/run_new_pack.mjs && node --experimental-vm-modules test/run_serialization_inspect.mjs && node --experimental-vm-modules test/run_method_result_model.mjs && node --experimental-vm-modules test/run_native_preprocessing_pipeline.mjs && node --experimental-vm-modules test/run_native_splitter.mjs && node --experimental-vm-modules test/run_native_augmentation.mjs && node --experimental-vm-modules test/run_estimator_roles.mjs && node --experimental-vm-modules test/run_estimator_roles_negative.mjs && node --experimental-vm-modules test/run_role_pipeline.mjs && node --experimental-vm-modules test/run_spectral_encoding.mjs && node --experimental-vm-modules test/run_optimization.mjs && node --experimental-vm-modules test/run_preflight_diagnostics.mjs && node --experimental-vm-modules test/run_pls_scale_equivariance.mjs && node --experimental-vm-modules test/run_pls_small_covariance.mjs && node --experimental-vm-modules test/run_pls_null_consumers.mjs && node --experimental-vm-modules test/run_pls_scale_consumers.mjs"
23
+ "test": "node --experimental-vm-modules test/run_smoke.mjs && node --experimental-vm-modules test/run_api.mjs && node --experimental-vm-modules test/run_generic_method.mjs && node --experimental-vm-modules test/run_pop_aom.mjs && node --experimental-vm-modules test/run_new_pack.mjs && node --experimental-vm-modules test/run_serialization_inspect.mjs && node --experimental-vm-modules test/run_method_result_model.mjs && node --experimental-vm-modules test/run_native_preprocessing_pipeline.mjs && node --experimental-vm-modules test/run_native_splitter.mjs && node --experimental-vm-modules test/run_native_augmentation.mjs && node --experimental-vm-modules test/run_estimator_roles.mjs && node --experimental-vm-modules test/run_estimator_roles_negative.mjs && node --experimental-vm-modules test/run_role_pipeline.mjs && node --experimental-vm-modules test/run_spectral_encoding.mjs && node --experimental-vm-modules test/run_optimization.mjs && node --experimental-vm-modules test/run_preflight_diagnostics.mjs && node --experimental-vm-modules test/run_pls_scale_equivariance.mjs && node --experimental-vm-modules test/run_pls_small_covariance.mjs && node --experimental-vm-modules test/run_pls_null_consumers.mjs && node --experimental-vm-modules test/run_pls_scale_consumers.mjs && node test/run_intrinsic_diagnostics.mjs"
24
24
  },
25
25
  "license": "CECILL-2.1",
26
26
  "publishConfig": {