import os
from pathlib import Path

import numpy as np
import pandas as pd
from sklearn.datasets import make_regression

# If there's no dataset in the project directory, create a reasonably large one.
# If it exists, append some new observations.
curr_dir = Path(__file__).parent
data_out_path = f"{curr_dir}/data.csv"
if os.path.isfile(data_out_path):
    n = 1
else:
    n = 50

for i in range(0, n):
    X, y = make_regression(10000, n_features=10)
    df = pd.DataFrame(X)
    df.to_csv(f"{curr_dir}/data.csv", mode="a")
