Beginner’s Guide to Python

Afghanistan Population Growth Rate Prediction 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 Afghanistan Population Growth Rate Prediction using ARIMA model in Python.

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

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 corners: x, …

Machine Learning for Beginners in Python: How to Save Images

Save 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 Data Analytics …

Machine Learning for Beginners in Python: How to Load Images

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 Data Analytics …

Machine Learning for Beginners in Python: How to Binarize Images

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 Special 95% …

Machine Learning for Beginners in Python: How to Rescale A Feature

Rescale A Feature Preliminaries from sklearn import preprocessing import numpy as np Create Feature x = np.array([[-500.5], [-100.1], [0], [100.1], [900.9]]) Rescale Feature Using Min-Max minmax_scale = preprocessing.MinMaxScaler(feature_range=(0, 1)) x_scale = minmax_scale.fit_transform(x) x_scale array([[ 0. ], [ 0.28571429], [ 0.35714286], [ 0.42857143], [ 1. ]])   Python Example for Beginners Special 95% discount 2000+ Applied …

Machine Learning for Beginners in Python: How to Get The Diagonal Of A Matrix

Getting The Diagonal Of A Matrix Preliminaries import numpy as np Create Matrix matrix = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) Get The Diagonal matrix.diagonal() array([1, 5, 9]) Calculate The Trace matrix.diagonal().sum() 15   Python Example for Beginners Special 95% discount 2000+ Applied Machine Learning & Data Science Recipes Portfolio Projects for …

Machine Learning for Beginners in Python: How to Reshape An Array

Reshape An Array Preliminaries import numpy as np Create Array matrix = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]) Reshape Array matrix.reshape(2, 6) array([[ 1, 2, 3, 4, 5, 6], [ 7, 8, 9, 10, 11, 12]])   Python Example for Beginners Special 95% discount 2000+ Applied Machine Learning & …

Machine Learning for Beginners in Python: How to Select Elements in An Array

Selecting Elements In An Array Preliminaries # Load library import numpy as np Create Vector # Create row vector vector = np.array([1, 2, 3, 4, 5, 6]) Select Element # Select second element vector[1] 2 Create Matrix # Create matrix matrix = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) Select Element # Select …