{
  "slug": "skfolio",
  "repo": "skfolio/skfolio",
  "checkedAt": "2026-11-12",
  "source": {
    "repo": "skfolio/skfolio",
    "revision": "7721090537634a549008a546c8968cdec0eaf69a",
    "path": "README.rst",
    "blob": "149eafce7cb7a5a88a0b07c12413512897e4447d",
    "url": "https://github.com/skfolio/skfolio/blob/7721090537634a549008a546c8968cdec0eaf69a/README.rst"
  },
  "en": {
    "title": "skfolio: portfolio constraints and a worked example",
    "description": "How skfolio handles portfolio weights, constraints and infeasible rules. Includes an executed fictional example, pinned dependencies and reproducible results.",
    "summary": "skfolio is a Python library for portfolio optimization and risk analysis using scikit-learn-style estimators. We reviewed its v1.12.9 sources and ran a small offline constraint example with invented data.",
    "questions": [
      {
        "question": "What does skfolio optimize?",
        "answer": "It fits portfolio-construction models to supplied data and produces weights. Our example minimizes variance across four fictional asset columns. That objective does not decide an investor’s goals: without our additional policy constraints, the result assigns about 99.72% to the artificial low-variance cash proxy."
      },
      {
        "question": "What do I need to reproduce this example?",
        "answer": "Python 3.12, skfolio 1.12.9 and the pinned dependencies in the evidence packet. The input is a numeric returns DataFrame with named columns. We used CLARABEL and 240 artificial observations; no API key, broker credentials or paid data are needed for this packet. A constant cash column is rejected by the tested default covariance estimator."
      },
      {
        "question": "Which investment-policy rules can be expressed?",
        "answer": "The tested MeanRisk interface accepts lower and upper weights and linear constraints. We encoded 55–65% equities, 25–35% bonds, 5–15% cash and a 45% cap per instrument. Percentages use total portfolio value. These are arbitrary teaching limits, not recommended allocations."
      },
      {
        "question": "Does the example resolve the companies inside equity funds?",
        "answer": "No. The optimizer receives one return column per instrument. A separate exact-arithmetic checker combines our invented fund constituents with a direct stock position and tests a 10% issuer limit measured against equity value. No live fund-data lookup or skfolio–Investboard connection was tested."
      },
      {
        "question": "What happens when the rules contradict one another?",
        "answer": "With only two equity funds, a 20% cap on each cannot meet a 55% combined equity floor. The tested model raises ConvexOptimizationError with an infeasible diagnosis. The reproduction script records this failure and does not silently loosen the constraints."
      }
    ],
    "limit": "Source review plus two successful offline fits and two recorded failure cases at pinned versions. All portfolio values, assets, fund contents and return observations are invented. This is not a backtest, model evaluation, execution test or recommendation. Snapshot age, issuer look-through and human approval are not enforced by the fitted weight model.",
    "compare": [
      {
        "slug": "pyportfolioopt",
        "note": "Compare another Python portfolio-optimization library and its own constraints and solver behavior."
      },
      {
        "slug": "riskfolio-lib",
        "note": "Compare a separate portfolio-construction toolkit; we did not run it in this experiment."
      }
    ]
  },
  "de": {
    "title": "skfolio: Portfoliogrenzen und ein ausgeführtes Beispiel",
    "description": "Wie skfolio Gewichte, Grenzen und widersprüchliche Regeln verarbeitet. Mit ausgeführtem fiktivem Beispiel, fixierten Abhängigkeiten und reproduzierbaren Ergebnissen.",
    "summary": "skfolio ist eine Python-Bibliothek zur Portfoliooptimierung und Risikoanalyse mit Estimatoren im Stil von scikit-learn. Wir prüften Quellen der Version 1.12.9 und führten ein kleines Offline-Beispiel mit erfundenen Daten aus.",
    "questions": [
      {
        "question": "Was optimiert skfolio?",
        "answer": "Die Bibliothek passt Modelle zur Portfoliokonstruktion an bereitgestellte Daten an und liefert Gewichte. Unser Beispiel minimiert die Varianz über vier fiktive Instrumentenspalten. Das Ziel legt keine persönlichen Anlageziele fest: Ohne zusätzliche Richtliniengrenzen entfallen rund 99,72 % auf den künstlichen Liquiditätsproxy mit geringer Varianz."
      },
      {
        "question": "Was brauche ich zur Reproduktion dieses Beispiels?",
        "answer": "Python 3.12, skfolio 1.12.9 und die fixierten Abhängigkeiten im Belegpaket. Eingabe ist ein numerischer Rendite-DataFrame mit benannten Spalten. Wir nutzten CLARABEL und 240 künstliche Beobachtungen. Das Paket benötigt weder API-Schlüssel noch Brokerzugang oder bezahlte Daten. Eine konstante Liquiditätsspalte wird vom geprüften Standard-Kovarianzschätzer abgelehnt."
      },
      {
        "question": "Welche Regeln einer Anlagerichtlinie lassen sich ausdrücken?",
        "answer": "Die geprüfte MeanRisk-Schnittstelle akzeptiert Gewichtsunter- und -obergrenzen sowie lineare Nebenbedingungen. Wir codierten 55–65 % Aktien, 25–35 % Anleihen, 5–15 % Liquidität und höchstens 45 % je Instrument. Bezugsgröße ist der gesamte Portfoliowert. Das sind willkürliche Lehrgrenzen, keine Allokationsempfehlungen."
      },
      {
        "question": "Löst das Beispiel die Unternehmen in Aktienfonds auf?",
        "answer": "Nein. Der Optimierer erhält eine Renditespalte je Instrument. Eine getrennte Prüfung mit exakter Bruchrechnung kombiniert erfundene Fondsbestandteile mit einer direkt gehaltenen Aktie und prüft eine Emittentengrenze von 10 % des Aktienwerts. Ein Abruf realer Fondsdaten oder eine Verbindung zwischen skfolio und Investboard wurde nicht getestet."
      },
      {
        "question": "Was geschieht bei widersprüchlichen Regeln?",
        "answer": "Bei nur zwei Aktienfonds können jeweils höchstens 20 % keine gemeinsame Aktienuntergrenze von 55 % erfüllen. Das geprüfte Modell meldet ConvexOptimizationError mit einer Diagnose der Unlösbarkeit. Das Reproduktionsskript dokumentiert den Fehler und lockert die Grenzen nicht stillschweigend."
      }
    ],
    "limit": "Quellenprüfung, zwei erfolgreiche Offline-Anpassungen und zwei dokumentierte Fehlerfälle mit fixierten Versionen. Portfoliowerte, Instrumente, Fondsinhalte und Renditebeobachtungen sind erfunden. Kein Backtest, Modellvergleich, Ausführungstest oder Anlagevorschlag. Datenalter, Emittentendurchschau und menschliche Freigabe werden vom angepassten Gewichtsmodell nicht durchgesetzt.",
    "compare": [
      {
        "slug": "pyportfolioopt",
        "note": "Eine weitere Python-Bibliothek zur Portfoliooptimierung mit eigenen Nebenbedingungen und Solver-Eigenschaften vergleichen."
      },
      {
        "slug": "riskfolio-lib",
        "note": "Ein separates Werkzeug zur Portfoliokonstruktion vergleichen; wir haben es in diesem Experiment nicht ausgeführt."
      }
    ]
  }
}
