This file contains hidden or 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 | |
| import matplotlib.pyplot as plt | |
| import seaborn as sns | |
| sns.set_style('whitegrid') | |
| % matplotlib inline | |
| from sklearn.linear_model import LinearRegression | |
| n_samples = 100 | |
| X = np.linspace(0, 10, 100) | |
| y = X ** 3 + np.random.randn(n_samples) * 100 + 100 |
This file contains hidden or 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 | |
| import matplotlib.pyplot as plt | |
| import seaborn as sns | |
| sns.set_style('whitegrid') | |
| % matplotlib inline | |
| from sklearn.preprocessing import PolynomialFeatures | |
| n_samples = 100 | |
| X = np.linspace(0, 10, 100) | |
| y = X ** 3 + np.random.randn(n_samples) * 100 + 100 |
This file contains hidden or 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 matplotlib.pyplot as plt | |
| from mpl_toolkits.mplot3d import Axes3D | |
| from matplotlib import cm | |
| import numpy as np | |
| fig = plt.figure() | |
| ax = fig.gca(projection='3d') # Create the axes | |
| # Data | |
| X = np.linspace(-8, 8, 100) |
This file contains hidden or 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 seaborn as sns | |
| sns.set(rc={'figure.figsize':(12,8)}) | |
| df = sns.load_dataset('iris') | |
| sns.regplot(x = "sepal_length", | |
| y = "petal_length", | |
| data = df, | |
| color="r") |
This file contains hidden or 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
| class Vector(): | |
| def __new__(cls, x, y): | |
| print("__new__ was invoked") | |
| instance = object.__new__(cls) | |
| return instance | |
| def __init__(self, x, y): | |
| print("__init__ was invoked") | |
| self.x = x | |
| self.y = y |
NewerOlder