ml_scaler 0.1.0 copy "ml_scaler: ^0.1.0" to clipboard
ml_scaler: ^0.1.0 copied to clipboard

A Dart package for scaling and normalizing numerical features using common techniques like Min-Max and Standard Scaler.

๐Ÿ“ ml_scaler #

A lightweight and pure Dart library for feature scaling and normalization, including MinMaxScaler and StandardScaler. Ideal for machine learning preprocessing.

Pub Version License


โœจ Features #

  • ๐Ÿ”ข MinMaxScaler: Scale features to a defined range (default: 0โ€“1)
  • ๐Ÿงฎ StandardScaler: Zero mean and unit variance (Z-score)
  • ๐Ÿ” fit(), transform(), inverseTransform() APIs
  • ๐Ÿง  Serializable models with toModel() and loadFromModel()
  • โœ… Fully tested and documented

๐Ÿš€ Installation #

Add to your pubspec.yaml:

dependencies:
  ml_scaler: ^0.1.0

Then run:

dart pub get

๐Ÿ“ฆ Usage Example #

import 'package:ml_scaler/ml_scaler.dart';

void main() {
  final data = [
    [1.0, 2.0],
    [2.0, 4.0],
    [3.0, 6.0],
  ];

  // MinMaxScaler
  final minMax = MinMaxScaler();
  minMax.fit(data);
  final scaled = minMax.transform(data);
  print('MinMax scaled: $scaled');

  // StandardScaler
  final stdScaler = StandardScaler();
  stdScaler.fit(data);
  final standardized = stdScaler.transform(data);
  print('Standard scaled: $standardized');
}

โœ… Output Example #

MinMax scaled: [[0.0, 0.0], [0.5, 0.5], [1.0, 1.0]]
Standard scaled: [[-1.0, -1.0], [0.0, 0.0], [1.0, 1.0]]

๐Ÿ“‚ Directory Structure #

lib/
  โ”œโ”€โ”€ scalers/
  โ”‚   โ”œโ”€โ”€ min_max_scaler.dart
  โ”‚   โ”œโ”€โ”€ standard_scaler.dart
  โ”œโ”€โ”€ utils/
  โ”‚   โ””โ”€โ”€ data_validator.dart
  โ”œโ”€โ”€ models/
  โ”‚   โ””โ”€โ”€ scaler_model.dart
  โ””โ”€โ”€ ml_scaler.dart

๐Ÿ›ก License #

MIT ยฉ Mehmet ร‡elik

0
likes
150
points
22
downloads

Publisher

unverified uploader

Weekly Downloads

A Dart package for scaling and normalizing numerical features using common techniques like Min-Max and Standard Scaler.

Repository (GitHub)
View/report issues

Topics

#machine-learning #feature-scaling #data-preprocessing #dart-ml

Documentation

API reference

License

MIT (license)

Dependencies

collection

More

Packages that depend on ml_scaler