Skip to content

Instantly share code, notes, and snippets.

View AntoineToubhans's full-sized avatar

Toubi AntoineToubhans

View GitHub Profile
import dvc.api
import pandas as pd
@st.cache
def load_predictions(rev: str) -> pd.DataFrame:
with dvc.api.open("data/evaluation/predictions.csv", rev=rev) as f:
return pd.read_csv(f)
selected_commit = ... # Use the commit selector introduced previous section
import streamlit as st
selected_commit = st.selectbox(
"Choose your commit",
[commit for commit in MODELS_COMMITS],
format_func=lambda commit: f"{commit.hexsha[:6]} - {commit.message} - {commit.committed_datetime}",
)
st.write("Selected Commit", selected_commit)
import git
REPO = git.Repo(".")
MODELS_COMMITS = list(REPO.iter_commits(paths="dvc.lock"))
stages:
download_dataset: ...
split_dataset: ...
train: ...
evaluate:
cmd: python scripts/evaluate.py
deps:
- scripts/evaluate.py
- data/dataset/test
stages:
download_dataset: ...
split_dataset: ...
train: ...
evaluate:
cmd: python scripts/evaluate.py
deps:
- scripts/evaluate.py
- data/dataset/test
stages:
download_dataset: ...
split_dataset: ...
train:
cmd: python scripts/train.py
deps:
- scripts/train.py
- data/dataset/train
- data/dataset/val
stages:
download_dataset: ...
split_dataset:
cmd: python scripts/split_dataset.py
deps:
- scripts/split_dataset.py
- data/raw
outs:
- data/dataset/train
stages:
download_dataset:
cmd: (
wget https://storage.googleapis.com/mledu-datasets/cats_and_dogs_filtered.zip
-O cats_and_dogs_filtered.zip &&
unzip cats_and_dogs_filtered.zip -d data/raw &&
rm cats_and_dogs_filtered.zip
)
outs:
- data/raw
import mongots
from datetime import datetime
from csv import DictReader
temperature_collection = mongots.MongoTSClient().ClimaticDataDb.temperatures
with open('./weather_data.csv') as file:
reader = DictReader(file, delimiter=';')
failed = 0
```
| datetime | city | temperature |
|---------------------|-------|-------------|
| 1996-07-01 02:00:00 | paris | 15.0 |
| | | |
| | | |
```