πΈ ml_fin_scorer

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
π Links
- π Pub.dev Package
- π GitHub Repository