Tag Archives: Data Science for beginners

Zimbabwe Population Growth Rate Prediction using World Bank data in Python

Applied Machine Learning and Data Science is made easy at SETScholars. SETScholars aims to guide you to become a Predictive Analytics & Data Science specialist by exploring machine learning & deep learning tools in Python, R & SQL. In this end-to-end learn by coding article, you will learn how to do an end-to-end predictive analytics project on Zimbabwe Population Growth Rate Prediction using World Bank data in Python.

Data Analytics – GGPLOT AXIS LIMITS AND SCALES

Hits: 14 GGPLOT AXIS LIMITS AND SCALES   This article describes R functions for changing ggplot axis limits (or scales). We’ll describe how to specify the minimum and the maximum values of axes. Among the different functions available in ggplot2 for setting the axis range, the coord_cartesian() function is the most preferred, because it zoom the plot without clipping the …

Learn Keras by Example – k-Fold Cross-Validating Neural Networks

Hits: 74 k-Fold Cross-Validating Neural Networks If we have smaller data it can be useful to benefit from k-fold cross-validation to maximize our ability to evaluate the neural network’s performance. This is possible in Keras because we can “wrap” any neural network such that it can use the evaluation features available in scikit-learn, including k-fold …

Learn Keras by Example – How to Visualize Loss History

Hits: 16 Visualize Loss History Preliminaries /* Load libraries */ import numpy as np from keras.datasets import imdb from keras.preprocessing.text import Tokenizer from keras import models from keras import layers import matplotlib.pyplot as plt /* Set random seed */ np.random.seed(0) Using TensorFlow backend. Load Movie Review Data /* Set the number of features we want …

Learn Keras by Example – Tuning Neural Network Hyperparameters

Hits: 22 Tuning Neural Network Hyperparameters Preliminaries /* Load libraries */ import numpy as np from keras import models from keras import layers from keras.wrappers.scikit_learn import KerasClassifier from sklearn.model_selection import GridSearchCV from sklearn.datasets import make_classification /* Set random seed */ np.random.seed(0) Using TensorFlow backend. Generate Target And Feature Data /* Number of features */ number_of_features …

Learn Keras by Example – How to do Neural Network Weight Regularization

Hits: 17 Neural Network Weight Regularization Preliminaries /* Load libraries */ import numpy as np from keras.datasets import imdb from keras.preprocessing.text import Tokenizer from keras import models from keras import layers from keras import regularizers /* Set random seed */ np.random.seed(0) Using TensorFlow backend. Load Movie Review Text Data /* Set the number of features …

Learn Keras by Example – How to do Neural Network Early Stopping

Hits: 31 Neural Network Early Stopping Preliminaries /* Load libraries */ import numpy as np from keras.datasets import imdb from keras.preprocessing.text import Tokenizer from keras import models from keras import layers from keras.callbacks import EarlyStopping, ModelCheckpoint /* Set random seed */ np.random.seed(0) Using TensorFlow backend. Load Movie Review Text Data /* Set the number of …

Learn Keras by Example – How to Build LSTM Recurrent Neural Network

Hits: 39 LSTM Recurrent Neural Network Oftentimes we have text data that we want to classify. While it is possible to use a type of convolutional network, we are going to focus on a more popular option: the recurrent neural network. The key feature of recurrent neural networks is that information loops back in the …

Machine Learning for Beginners in Python: How to Build Feedforward Neural Networks For Regression

Hits: 65 Feed forward Neural Networks For Regression Preliminaries /* Load libraries */ import numpy as np from keras.preprocessing.text import Tokenizer from keras import models from keras import layers from sklearn.datasets import make_regression from sklearn.model_selection import train_test_split from sklearn import preprocessing /* Set random seed */ np.random.seed(0) Using TensorFlow backend. Generate Training Data /* Generate …

Machine Learning for Beginners in Python: How to Build Feedforward Neural Network For Multiclass Classification

Hits: 14 Feedforward Neural Network For Multiclass Classification Preliminaries /* Load libraries */ import numpy as np from keras.datasets import reuters from keras.utils.np_utils import to_categorical from keras.preprocessing.text import Tokenizer from keras import models from keras import layers /* Set random seed */ np.random.seed(0) Using TensorFlow backend. Load Movie Review Data /* Set the number of …

Machine Learning for Beginners in Python: How to Build Feedforward Neural Network For Binary Classification

Hits: 14 Feedforward Neural Network For Binary Classification Preliminaries /* Load libraries */ import numpy as np from keras.datasets import imdb from keras.preprocessing.text import Tokenizer from keras import models from keras import layers /* Set random seed */ np.random.seed(0) Using TensorFlow backend. Load Movie Review Data /* Set the number of features we want */ …

Learn Keras by Example – How to Add Dropout Layers

Hits: 51 Adding Dropout Preliminaries /* Load libraries */ import numpy as np from keras.datasets import imdb from keras.preprocessing.text import Tokenizer from keras import models from keras import layers /* Set random seed */ np.random.seed(0) Using TensorFlow backend. Load IMDB Movie Review Data /* Set the number of features we want */ number_of_features = 1000 …

Machine Learning for Beginners in Python: k-Means Clustering

Hits: 4 k-Means Clustering Preliminaries /* Load libraries */ from sklearn import datasets from sklearn.preprocessing import StandardScaler from sklearn.cluster import KMeans Load Iris Flower Dataset /* Load data */ iris = datasets.load_iris() X = iris.data Standardize Features /* Standarize features */ scaler = StandardScaler() X_std = scaler.fit_transform(X) Conduct k-Means Clustering /* Create k-mean object */ …

Machine Learning for Beginners in Python: Agglomerative Clustering

Hits: 15 Agglomerative Clustering Preliminaries /* Load libraries */ from sklearn import datasets from sklearn.preprocessing import StandardScaler from sklearn.cluster import AgglomerativeClustering Load Iris Flower Data /* Load data */ iris = datasets.load_iris() X = iris.data Standardize Features /* Standarize features */ scaler = StandardScaler() X_std = scaler.fit_transform(X) Conduct Agglomerative Clustering In scikit-learn, AgglomerativeClustering uses the linkage parameter to determine …