Adding poetry.lock, pyproject.toml

This commit is contained in:
hpayer committed 2026-10-07 17:13:10 -04:00
1 parent fc3dcf19ba
commit 82a1bdb0a5
3 files changed
+3912 -3

No files matched your search

+8 -3
View File
@@ -26,13 +26,10 @@ from fastapi import FastAPI, HTTPException, Query
from pydantic import BaseModel, Field from pydantic import BaseModel, Field
from sklearn.linear_model import LinearRegression from sklearn.linear_model import LinearRegression
from sklearn.model_selection import KFold, cross_val_score from sklearn.model_selection import KFold, cross_val_score
from dotenv import load_dotenv from dotenv import load_dotenv
load_dotenv() load_dotenv()
REQUIRED_COLUMNS = ["Name", "Visitors", "City", "Country", "Population"] REQUIRED_COLUMNS = ["Name", "Visitors", "City", "Country", "Population"]
@@ -245,6 +242,14 @@ def create_app(
return [Prediction(population=p, predicted_visitors=float(v)) return [Prediction(population=p, predicted_visitors=float(v))
for p, v in zip(req.populations, preds)] for p, v in zip(req.populations, preds)]
@app.get("/data")
def data():
"""Every row the model was fitted on, with its prediction."""
m = get_model()
d = m.data.copy()
d["Predicted"] = m.predictions
return d.to_dict(orient="records")
@app.get("/residuals") @app.get("/residuals")
def residuals( def residuals(
top: int = Query(10, ge=1, le=500), top: int = Query(10, ge=1, le=500),
Generated
+3875
View File
File diff suppressed because it is too large. Load diff
+29
View File
@@ -0,0 +1,29 @@
[project]
name = "museum-analytics"
version = "0.1.0"
description = ""
authors = [
{name = "hansp",email = "hanspayer@gmail.com"}
]
readme = "README.md"
requires-python = "^3.12"
dependencies = [
"requests (>=2.34.2,<3.0.0)",
"pandas (>=3.0.6,<4.0.0)",
"python-dotenv (>=1.2.4,<2.0.0)",
"wikipedia-api (>=0.16.0,<0.17.0)",
"lxml (>=6.1.3,<7.0.0)",
"html5lib (>=1.1,<2.0)",
"beautifulsoup4 (>=4.15.0,<5.0.0)",
"numpy (>=2.5.3,<3.0.0)",
"fastapi (>=0.142.3,<0.143.0)",
"scikit-learn (>=1.9.1,<2.0.0)",
"uvicorn (>=0.54.0,<0.55.0)",
"jupyterlab (>=4.6.4,<5.0.0)",
"matplotlib (>=3.11.2,<4.0.0)",
]
[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"