This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from sklearn.linear_model import LinearRegression | |
import matplotlib.pyplot as plt | |
from random import randrange | |
xs = np.array([[1], [3.1], [2.9], [1.3], [2], [4], | |
[4.7], [5], [6], [7], [7.1], [7.2]]) | |
ys = np.array([[2], [5.8], [4.2], [2.4], [4], [8], | |
[9.2], [9], [10], [10], [11], [12]]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!pip install seaborn | |
data = { | |
"a" : [1,2,34,4000, 4000, 4000, 40000] | |
,"b" : [2,1300,3400,3400,3400,3400,340000] | |
,"c" : [1,10,13,3000,3000,3570,5570,8570,300000] | |
,"d" : [1,110,260, 300, 350, 35077] | |
} | |
import seaborn as sns |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# !pip install torch torchvision torchaudio | |
# !pip install pytorch_tabular[all] | |
## Prepare utility functions | |
from sklearn.datasets import make_classification | |
def make_mixed_classification(n_samples, n_features, n_categories): | |
X,y = make_classification(n_samples=n_samples, n_features=n_features, random_state=42, n_informative=5) | |
cat_cols = random.choices(list(range(X.shape[-1])),k=n_categories) | |
num_cols = [i for i in range(X.shape[-1]) if i not in cat_cols] | |
for col in cat_cols: |