├── .DS_Store ├── .gitattributes ├── .ipynb_checkpoints └── CH17_Autoencoders_And_Gans-checkpoint.ipynb ├── CH02_end_to_end_machine_learning_project.ipynb ├── CH03 Classification.ipynb ├── CH04 Training Linear Models.ipynb ├── CH05 support_vector_machines.ipynb ├── CH06_Decision_Trees.ipynb ├── CH07_Ensemble_Learning_and_Random_Forests.ipynb ├── CH08_Dimensionality_Reduction.ipynb ├── CH09_Unsupervised_Learning.ipynb ├── CH10_Neural_Nets_with_Keras.ipynb ├── CH11_Training_Deep_Neural_Networks.ipynb ├── CH12_Custom_Models_and_Training_with_TensorFlow.ipynb ├── CH13_loading_and_preprocessing_data_with_TF.ipynb ├── CH14_Deep_Computer_Vision_with_CNNs_VE.ipynb ├── CH15_Processing_Sequences_Using_RNNs_and_CNNs.ipynb ├── CH16_Natural_Language_Processing_with_RNNs_and_Attention.ipynb ├── CH17_Autoencoders_And_Gans.ipynb ├── README.md ├── helper.py └── images_used ├── .DS_Store ├── Figure16-1.png ├── Figure17-3.png ├── FigureD_3.png ├── figure 14_15.png ├── figure 14_16.png ├── figure 14_17.png ├── figure 14_18.png ├── figure10-13.png ├── figure10_14.png ├── figure10_15.png ├── figure10_6.png ├── figure11-9.png ├── figure11_4.png ├── figure11_6.png ├── figure11_7.png ├── figure11_8.png ├── figure12_1.png ├── figure12_3.jpg ├── figure12_4.png ├── figure13_1.png ├── figure13_2.png ├── figure13_3.png ├── figure13_4.png ├── figure13_5.png ├── figure14_10.png ├── figure14_11.png ├── figure14_3.png ├── figure14_4.png ├── figure14_5.png ├── figure14_7.png ├── figure14_8.png ├── figure15_11.png ├── figure15_7.png ├── figure16_10.PNG ├── figure16_2.png ├── figure16_3.png ├── figure16_4.png ├── figure16_5.png ├── figure16_6.png ├── figure16_8.PNG ├── figure16_9.PNG ├── figure17-7.png ├── figure17-8.png ├── new_table11_2.PNG ├── return_sequences.jpg ├── table11-2.png ├── table11-3.jpg ├── table11-4.jpg └── table4_1.png /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/.DS_Store -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Hands_on_ML_w_Scikit_Karas_and_TensorFlow 2 | Hands-on Machine Learning with Scikit-Learn, Keras and TensorFlow 2nd Edition by Aurélien Géron 3 | -------------------------------------------------------------------------------- /helper.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | from sklearn.preprocessing import StandardScaler 3 | from sklearn.cluster import DBSCAN 4 | from sklearn.neighbors import KNeighborsClassifier 5 | from sklearn.base import BaseEstimator, TransformerMixin 6 | from sklearn.pipeline import Pipeline 7 | 8 | class PCA_Sphering(BaseEstimator, TransformerMixin): 9 | """Feature sclaing using PCA Sphering (centering, rotating, scaling)""" 10 | def __init__(self): 11 | pass 12 | 13 | def fit(self, X, y=None): 14 | m, n = X.shape 15 | 16 | self.mean_ = np.mean(X, axis=0) # centering 17 | X_centered = X - self.mean_ 18 | self.U_, self.s_, self.Vt_ = np.linalg.svd(X_centered) # Vt for rotating 19 | self.D_ = np.zeros((n,n)) 20 | self.D_[:n, :n] = np.diag(np.power(self.s_, -0.5)) # for scaling 21 | return self 22 | 23 | def transform(self, X, y=None): 24 | return (X-self.mean_) @ self.Vt_.T @ self.D_ 25 | 26 | 27 | class DBSCAN_with_predict(DBSCAN): 28 | def __init__(self, eps=0.5, *, min_samples=5, metric='euclidean', 29 | metric_params=None, algorithm='auto', leaf_size=30, p=None, 30 | n_jobs=None, n_neighbors = 5): 31 | self.n_neighbors = n_neighbors 32 | super().__init__(eps=eps, min_samples=min_samples, metric=metric, 33 | metric_params=metric_params, algorithm=algorithm, leaf_size=leaf_size, 34 | p=p, n_jobs=n_jobs) 35 | 36 | 37 | def predict(self, X, y=None, n_neighbors = None): 38 | if n_neighbors: 39 | self.n_neighbors = n_neighbors 40 | 41 | knn = KNeighborsClassifier(n_neighbors=self.n_neighbors) 42 | knn.fit(self.components_, self.labels_[self.core_sample_indices_]) 43 | 44 | return knn.predict(X) 45 | 46 | def predict_anomaly(self, X, y=None, n_neighbors = None): 47 | if n_neighbors: 48 | self.n_neighbors = n_neighbors 49 | 50 | knn = KNeighborsClassifier(n_neighbors=self.n_neighbors) 51 | knn.fit(self.components_, self.labels_[self.core_sample_indices_]) 52 | 53 | y_pred = knn.predict(X) 54 | y_dist, y_closest_idx = knn.kneighbors(X, n_neighbors=1) 55 | y_pred[y_dist.ravel() > self.eps] = -1 56 | 57 | return y_pred.ravel() -------------------------------------------------------------------------------- /images_used/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/.DS_Store -------------------------------------------------------------------------------- /images_used/Figure16-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/Figure16-1.png -------------------------------------------------------------------------------- /images_used/Figure17-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/Figure17-3.png -------------------------------------------------------------------------------- /images_used/FigureD_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/FigureD_3.png -------------------------------------------------------------------------------- /images_used/figure 14_15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure 14_15.png -------------------------------------------------------------------------------- /images_used/figure 14_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure 14_16.png -------------------------------------------------------------------------------- /images_used/figure 14_17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure 14_17.png -------------------------------------------------------------------------------- /images_used/figure 14_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure 14_18.png -------------------------------------------------------------------------------- /images_used/figure10-13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure10-13.png -------------------------------------------------------------------------------- /images_used/figure10_14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure10_14.png -------------------------------------------------------------------------------- /images_used/figure10_15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure10_15.png -------------------------------------------------------------------------------- /images_used/figure10_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure10_6.png -------------------------------------------------------------------------------- /images_used/figure11-9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure11-9.png -------------------------------------------------------------------------------- /images_used/figure11_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure11_4.png -------------------------------------------------------------------------------- /images_used/figure11_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure11_6.png -------------------------------------------------------------------------------- /images_used/figure11_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure11_7.png -------------------------------------------------------------------------------- /images_used/figure11_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure11_8.png -------------------------------------------------------------------------------- /images_used/figure12_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure12_1.png -------------------------------------------------------------------------------- /images_used/figure12_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure12_3.jpg -------------------------------------------------------------------------------- /images_used/figure12_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure12_4.png -------------------------------------------------------------------------------- /images_used/figure13_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure13_1.png -------------------------------------------------------------------------------- /images_used/figure13_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure13_2.png -------------------------------------------------------------------------------- /images_used/figure13_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure13_3.png -------------------------------------------------------------------------------- /images_used/figure13_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure13_4.png -------------------------------------------------------------------------------- /images_used/figure13_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure13_5.png -------------------------------------------------------------------------------- /images_used/figure14_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure14_10.png -------------------------------------------------------------------------------- /images_used/figure14_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure14_11.png -------------------------------------------------------------------------------- /images_used/figure14_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure14_3.png -------------------------------------------------------------------------------- /images_used/figure14_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure14_4.png -------------------------------------------------------------------------------- /images_used/figure14_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure14_5.png -------------------------------------------------------------------------------- /images_used/figure14_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure14_7.png -------------------------------------------------------------------------------- /images_used/figure14_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure14_8.png -------------------------------------------------------------------------------- /images_used/figure15_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure15_11.png -------------------------------------------------------------------------------- /images_used/figure15_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure15_7.png -------------------------------------------------------------------------------- /images_used/figure16_10.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure16_10.PNG -------------------------------------------------------------------------------- /images_used/figure16_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure16_2.png -------------------------------------------------------------------------------- /images_used/figure16_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure16_3.png -------------------------------------------------------------------------------- /images_used/figure16_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure16_4.png -------------------------------------------------------------------------------- /images_used/figure16_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure16_5.png -------------------------------------------------------------------------------- /images_used/figure16_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure16_6.png -------------------------------------------------------------------------------- /images_used/figure16_8.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure16_8.PNG -------------------------------------------------------------------------------- /images_used/figure16_9.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure16_9.PNG -------------------------------------------------------------------------------- /images_used/figure17-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure17-7.png -------------------------------------------------------------------------------- /images_used/figure17-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/figure17-8.png -------------------------------------------------------------------------------- /images_used/new_table11_2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/new_table11_2.PNG -------------------------------------------------------------------------------- /images_used/return_sequences.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/return_sequences.jpg -------------------------------------------------------------------------------- /images_used/table11-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/table11-2.png -------------------------------------------------------------------------------- /images_used/table11-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/table11-3.jpg -------------------------------------------------------------------------------- /images_used/table11-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/table11-4.jpg -------------------------------------------------------------------------------- /images_used/table4_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soo-pecialist/Hands_on_ML_w_Scikit_Karas_and_TensorFlow/413c1d5e2f87264c66dd79fa9e5a62d9a2b1c3f7/images_used/table4_1.png --------------------------------------------------------------------------------