Skip to content

Instantly share code, notes, and snippets.

@pierrelouisbescond
Last active May 18, 2020 11:37
Show Gist options
  • Save pierrelouisbescond/68748aadb6fc25d72c27a40c54eeb33a to your computer and use it in GitHub Desktop.
Save pierrelouisbescond/68748aadb6fc25d72c27a40c54eeb33a to your computer and use it in GitHub Desktop.
import pandas as pd
import numpy as np
import time
from sklearn.datasets import make_regression
n_samples = 1000
n_features = 10
n_informative = 3
X, y = make_regression(n_samples=n_samples, n_features=n_features, n_informative=n_informative)
# We convert the X and y arrays into a DataFrame which will be useful later
col_names = []
for i in range(n_features):
col_names.append("X{}".format(i+1))
df = pd.DataFrame(X, columns=col_names)
df["Y"] = y
display(df)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment