Artificial Intelligence

An end-to-end Data Science Tutorials on Clustering using German Credit Dataset

Hits: 4    An end-to-end Data Science Tutorials on Clustering using German Credit Dataset in Python In this Learn by Coding tutorial, you will learn how to perform clustering (customer segmentation) using KMeans algorithm in Python for German Credit Dataset. This dataset is freely available. We learn how to plot / visualize different feature of …

Population Forecasting of India using ARIMA model 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 Population Forecasting of India using ARIMA and FBProphet in Python.

Machine Learning Mastery: Machine Learning and Artificial Intelligence

Hits: 4 Machine Learning and Artificial Intelligence   Machine Learning and Artificial Intelligence are creating a huge buzz worldwide. The plethora of applications in Artificial Intelligence have changed the face of technology. These terms Machine Learning and Artificial Intelligence are often used interchangeably. However, there is a stark difference between the two that is still unknown to the …

Machine Learning for Beginners in Python: How to Use Shi-Tomasi Corner Detector

Hits: 12 Shi-Tomasi Corner Detector Preliminaries import cv2 import numpy as np from matplotlib import pyplot as plt Load image image_bgr = cv2.imread(‘images/plane_256x256.jpg’) image_gray = cv2.cvtColor(image_bgr, cv2.COLOR_BGR2GRAY) Define Corner Parameters corners_to_detect = 10 minimum_quality_score = 0.05 minimum_distance = 25 Detect Corners corners = cv2.goodFeaturesToTrack(image_gray, corners_to_detect, minimum_quality_score, minimum_distance) corners = np.float32(corners) Mark Corners for corner in …

Machine Learning for Beginners in Python: How to Load Images

Hits: 12 Load Images Preliminaries import cv2 import numpy as np from matplotlib import pyplot as plt Load Image As Greyscale image = cv2.imread(‘images/plane.jpg’, cv2.IMREAD_GRAYSCALE) plt.imshow(image, cmap=’gray’), plt.axis(“off”) plt.show()   Python Example for Beginners Special 95% discount 2000+ Applied Machine Learning & Data Science Recipes Portfolio Projects for Aspiring Data Scientists: Tabular Text & Image …

Machine Learning for Beginners in Python: How to Enhance Contrast Of Color Image

Hits: 8 Enhance Contrast Of Greyscale Image Preliminaries import cv2 import numpy as np from matplotlib import pyplot as plt Load Image As Greyscale image = cv2.imread(‘images/plane_256x256.jpg’, cv2.IMREAD_GRAYSCALE) Enhance Image image_enhanced = cv2.equalizeHist(image) View Image plt.imshow(image_enhanced, cmap=’gray’), plt.axis(“off”) plt.show()   Python Example for Beginners Special 95% discount 2000+ Applied Machine Learning & Data Science Recipes …

Machine Learning for Beginners in Python: How to Detect Edges

Hits: 4 Detect Edges Preliminaries import cv2 import numpy as np from matplotlib import pyplot as plt Load image image_gray = cv2.imread(‘images/plane_256x256.jpg’, cv2.IMREAD_GRAYSCALE) Detect Edges median_intensity = np.median(image_gray) lower_threshold = int(max(0, (1.0 – 0.33) * median_intensity)) upper_threshold = int(min(255, (1.0 + 0.33) * median_intensity)) image_canny = cv2.Canny(image_gray, lower_threshold, upper_threshold) View Edges plt.imshow(image_canny, cmap=’gray’), plt.axis(“off”) plt.show() …

Machine Learning for Beginners in Python: How to Blurring Images

Hits: 2 Blurring Images Preliminaries import cv2 import numpy as np from matplotlib import pyplot as plt Load Image As Greyscale image = cv2.imread(‘images/plane_256x256.jpg’, cv2.IMREAD_GRAYSCALE) Blur Image image_blurry = cv2.blur(image, (5,5)) View Image plt.imshow(image_blurry, cmap=’gray’), plt.xticks([]), plt.yticks([]) plt.show()   Python Example for Beginners Special 95% discount 2000+ Applied Machine Learning & Data Science Recipes Portfolio …

Machine Learning for Beginners in Python: How to Binarize Images

Hits: 2 Binarize Images Preliminaries import cv2 import numpy as np from matplotlib import pyplot as plt Load Image As Greyscale image_grey = cv2.imread(‘images/plane_256x256.jpg’, cv2.IMREAD_GRAYSCALE) Apply Adaptive Thresholding max_output_value = 255 neighorhood_size = 99 subtract_from_mean = 10 image_binarized = cv2.adaptiveThreshold(image_grey, max_output_value, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY, neighorhood_size, subtract_from_mean) View Image plt.imshow(image_binarized, cmap=’gray’), plt.axis(“off”) plt.show() Python Example for Beginners …

Machine Learning for Beginners in Python: How to Preprocess Iris Data

Hits: 7 Preprocessing Iris Data Preliminaries from sklearn import datasets import numpy as np from sklearn.cross_validation import train_test_split from sklearn.preprocessing import StandardScaler Load Data iris = datasets.load_iris() X = iris.data y = iris.target Split Data For Cross Validation X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=42) Standardize Feature Data sc = StandardScaler() sc.fit(X_train) X_train_std …

Machine Learning for Beginners in Python: How to Preprocess Categorical Features

Hits: 2 Preprocessing Categorical Features Often, machine learning methods (e.g. logistic regression, SVM with a linear kernel, etc) will require that categorical variables be converted into dummy variables (also called OneHot encoding). For example, a single feature Fruit would be converted into three features, Apples, Oranges, and Bananas, one for each category in the categorical feature. There are common ways …

Machine Learning for Beginners in Python: How to One-Hot Encode Features With Multiple Labels

Hits: 4 One-Hot Encode Features With Multiple Labels Preliminaries from sklearn.preprocessing import MultiLabelBinarizer import numpy as np Create Data y = [(‘Texas’, ‘Florida’), (‘California’, ‘Alabama’), (‘Texas’, ‘Florida’), (‘Delware’, ‘Florida’), (‘Texas’, ‘Alabama’)] One-hot Encode Data one_hot = MultiLabelBinarizer() one_hot.fit_transform(y) array([[0, 0, 0, 1, 1], [1, 1, 0, 0, 0], [0, 0, 0, 1, 1], [0, 0, …

Machine Learning for Beginners in Python: Imputing Missing Class Labels Using k-Nearest Neighbors

Hits: 0 Imputing Missing Class Labels Using k-Nearest Neighbors Preliminaries import numpy as np from sklearn.neighbors import KNeighborsClassifier Create Feature Matrix X = np.array([[0, 2.10, 1.45], [1, 1.18, 1.33], [0, 1.22, 1.27], [1, -0.21, -1.19]]) Create Feature Matrix With Missing Values X_with_nan = np.array([[np.nan, 0.87, 1.31], [np.nan, -0.67, -0.22]]) Train k-Nearest Neighbor Classifier clf = …

Machine Learning for Beginners in Python: How to Impute Missing Values With Means

Hits: 5 Impute Missing Values With Means Mean imputation replaces missing values with the mean value of that feature/variable. Mean imputation is one of the most ‘naive’ imputation methods because unlike more complex methods like k-nearest neighbors imputation, it does not use the information we have about an observation to estimate a value for it. …

Machine Learning for Beginners in Python: How to Handle Imbalanced Classes With Upsampling

Hits: 3 Handling Imbalanced Classes With Upsampling   In upsampling, for every observation in the majority class, we randomly select an observation from the minority class with replacement. The end result is the same number of observations from the minority and majority classes. Preliminaries import numpy as np from sklearn.datasets import load_iris Load Iris Dataset …