πŸ’Έ ml_fin_scorer   Pub Version License: MIT Platform

A Dart package for calculating custom financial scores using normalized, weighted feature groups.
Perfect for credit scoring, risk assessment, investment profiling, and more.


πŸ“¦ Installation

Add this to your pubspec.yaml:

dependencies:
  ml_fin_scorer: ^0.1.0

Then run:

dart pub get

✨ Features

  • βœ… Weighted & normalized financial score calculation
  • βœ… Group-based scoring (e.g., Income, Debt, Behavior)
  • βœ… Custom scoring profiles (e.g., 0–100 or 300–850)
  • βœ… Grade classification (A–D)
  • βœ… Breakdown of group-level contributions
  • βœ… Type-safe, test-covered, production-ready

πŸš€ Quick Example

import 'package:ml_fin_scorer/ml_fin_scorer.dart';

void main() {
  final incomeGroup = FinancialFeatureGroup(
    groupName: 'Income',
    features: [
      FinancialFeature(name: 'Salary', value: 8000, min: 0, max: 20000, weight: 0.6),
      FinancialFeature(name: 'Side Income', value: 1500, min: 0, max: 5000, weight: 0.4),
    ],
  );

  final debtGroup = FinancialFeatureGroup(
    groupName: 'Debt',
    features: [
      FinancialFeature(name: 'Loan Payments', value: 1000, min: 0, max: 5000, weight: 0.5),
      FinancialFeature(name: 'Credit Usage %', value: 60, min: 0, max: 100, weight: 0.5),
    ],
  );

  final profile = CustomScoringProfile(minScore: 300, maxScore: 850);

  final result = calculateGroupedFinancialScore(
    groups: [incomeGroup, debtGroup],
    profile: profile,
  );

  print(result); // Score: 712.53 (B) | Groups: {Income: 63.0%, Debt: 45.6%}
}

πŸ“š API Overview

FinancialFeature

Defines a single variable:

FinancialFeature(
  name: 'Salary',
  value: 9000,
  min: 0,
  max: 20000,
  weight: 0.7,
);

FinancialFeatureGroup

Groups related features:

FinancialFeatureGroup(
  groupName: 'Income',
  features: [...],
);

CustomScoringProfile

Customize output range:

CustomScoringProfile(minScore: 300, maxScore: 850)

calculateGroupedFinancialScore(...)

Main function β€” returns a ScoreResult:

ScoreResult(
  finalScore: 712.3,
  grade: 'B',
  groupScores: {'Income': 0.63, 'Debt': 0.45},
)

βœ… Use Cases

  • Creditworthiness scoring
  • Financial risk analysis
  • Investment client profiling
  • Personal finance assistant engines

πŸ§ͺ Testing

dart test

100% unit-tested with edge cases handled.


βš– License

MIT Β© 2025 Mehmet Γ‡elik


Libraries

ml_fin_scorer