This is a Next.js project bootstrapped with create-next-app.
FinScoreAI is an AI-driven financial analysis platform that combines:
- Random Forest ML Model - Bankruptcy prediction & financial health assessment
- Gemini LLM API - Contextual financial insights and AI-powered analysis
- Financial Metrics Engine - Altman Z-Score, liquidity ratios, profitability analysis
Dataset: Company Bankruptcy Prediction
Total Companies: 6,819
Features: 96 financial ratios and metrics
Time Period: Historical company financial data
Data Source: Public financial datasets
Algorithm: Random Forest Classifier
- Trees: 100 ensemble trees
- Max Depth: 20
- Min Samples Split: 2
- Min Samples Leaf: 1
- Features: 96 financial ratios (normalized)
- Target Variable: Bankruptcy Status (Binary: Healthy/At-Risk)
Model Performance:
- Accuracy: ~95% on test set
- Precision: ~93%
- Recall: ~94%
- Cross-Validation: Stratified 5-fold validation
The app calculates the Altman Z-Score for Private Companies:
Z = 0.717×X1 + 0.847×X2 + 3.107×X3 + 0.420×X4 + 0.998×X5
Where:
- X1 = Working Capital / Total Assets
- X2 = Retained Earnings / Total Assets
- X3 = EBIT / Total Assets
- X4 = Equity / Total Debt
- X5 = Sales / Total Assets
Interpretation:
- Z > 2.9: Safe Zone (Low bankruptcy risk)
- 1.23 < Z ≤ 2.9: Grey Zone (Moderate risk)
- Z ≤ 1.23: Distress Zone (High bankruptcy risk)
Dataset Characteristics:
⚠️ Single Dataset Training: Model trained on company-bankruptcy-prediction dataset⚠️ Historical Data: Reflects past market conditions and company structures⚠️ Industry Bias: May perform differently across industries⚠️ Regional Limitations: Trained on specific geographical/regulatory context⚠️ Scale Dependency: Best for SMEs; may not generalize to startups or mega-corporations
Model Generalization Issues:
- Startups & Early-Stage Companies: Limited training data; high uncertainty
- Emerging Industries: Model trained on historical data; may not capture new business models
- Economic Shocks: Market crises not adequately represented in historical data
- Accounting Standards: Different countries/regions use different standards
- Rapid Growth Companies: Traditional ratios may underestimate viability
When to Trust the Model:
✅ Established companies with 5+ years of history
✅ Companies in traditional industries
✅ Consistent financial reporting
✅ Standard balance sheet structure
When to Be Cautious
❌ High-growth tech companies
❌ Companies in emerging industries (AI, crypto, biotech)
❌ Seasonal businesses with high volatility
❌ Companies with recent restructuring
❌ During economic downturns/crises
The app computes the following ratios for analysis:
| Metric | Formula | Interpretation |
|---|---|---|
| Liquidity Ratio | Assets / Liabilities | Ability to pay short-term obligations |
| Profitability Ratio | Net Profit / Revenue | Operational efficiency |
| Leverage Ratio | Debt / Equity | Financial risk & capital structure |
| Z-Score | Weighted formula | Bankruptcy risk indicator |
| Investment Score | Composite (0-100) | Overall investment viability |
Best Practices:
- Use as a Screening Tool - Not a replacement for professional financial analysis
- Cross-Validate - Always validate AI predictions with domain experts
- Multi-Factor Analysis - Consider multiple factors, not just the score
- Update Data Regularly - Quarterly/annual financial updates for accuracy
- Combine with LLM Insights - Read the Gemini AI analysis for context
- Consider Market Context - Factor in industry trends and economic conditions
Disclaimer:
This analysis is powered by machine learning models trained on historical data. The scores and predictions are indicative only and should not be used as the sole basis for financial decisions. Always consult with qualified financial advisors, accountants, and legal professionals before making significant business decisions.
- Cross-Validation: 5-fold stratified cross-validation to prevent overfitting
- Test Set Performance: Model evaluated on unseen company data
- Edge Cases: Tested on extreme financial scenarios
- Real-World Validation: Continuously validated against actual company outcomes
- Expand training dataset with international company data
- Integrate industry-specific models (banking, retail, manufacturing)
- Add temporal analysis for trend detection
- Implement uncertainty quantification (confidence intervals)
- Fine-tune for SME-specific characteristics
- Add explainability features (SHAP values)
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.