SQL The ORDER BY Keyword

SELECT column_name(s) FROM table_name ORDER BY column_name(s) ASC|DESC ORDER BY Example The “Persons” table: Now we want to select all the persons from the table above, however, we want to sort the persons by their last name.We use the following SELECT statement: The result-set will look like this: ORDER BY DESC Example Now we want … Read more

SQL WHERE Clause

SQL Webp

The “Persons” table: Now we want to select only the persons living in the city “Sandnes” from the table above. We use the following SELECT statement using Where clause: The result-set will look like this: Quotes Around Text Fields in SQL WHERE CLAUSE SQL uses single quotes around text values (most database systems will also … Read more

SQL Introduction

SQL Webp

SQL is a standard language for accessing databases. How to use SQL to access and manipulate data in: MySQL, SQL Server, Access, Oracle, Sybase, DB2, and other database systems. SQL Syntax: SELECT Company, Country FROM Customers WHERE Country <> ‘USA’ SQL Result: SQL is a “standard language for accessing and manipulating databases”. What Can SQL … Read more

Gaussian Mixtures Models in Machine Learning

A Gaussian mixture model (GMM) is a probabilistic model that assumes that the instances were generated from a mixture of several Gaussian distributions whose parameters are unknown. All the instances generated from a single Gaussian distribution form a cluster that typically looks like an ellipsoid. Each cluster can have a different ellipsoidal shape, size, density … Read more

Pyspark Questions and Answers

Q1: Write pyspark code to create dataframe and print with ‘color’ and ‘weight’ as separate columns. inventoryData = [ (‘Laptop’, 20, {‘color’: ‘silver’, ‘weight’: 2.5}), (‘Phone’, 50, {‘color’: ‘black’, ‘weight’: 0.5}), (‘Tablet’, 30, {‘color’: ‘white’, ‘weight’: 0.8}), (‘Chair’, 10, {‘color’: ‘brown’, ‘weight’: 3.0}), (‘Printer’, 15, {‘color’: ‘gray’, ‘weight’: 7.5}), ] schema =[“Product”, “Quantity”, “Properties”] Product … Read more

Kernel PCA in Machine Learning

The post discusses Kernel Principal Component Analysis (kPCA), highlighting its application in nonlinear dimensionality reduction and suggesting methods for selecting kernels and tuning hyperparameters through grid search and reconstruction pre-image error minimization.

Hierarchical Clustering in Machine Learning

Hierarchical-Clustering-Analysis.

The content discusses K-Means and Hierarchical Clustering algorithms. K-Means requires predefined clusters and is sensitive to initial centroids and outliers. Hierarchical Clustering offers an agglomerative and divisive approach without preset clusters. The document also explores various linkage methods, dendrograms for visualization, and the validity of clusters over time.

Choosing the Right Number of Dimensions in Dimensionality Reduction

The content discusses dimensionality reduction using PCA, emphasizing the importance of preserving a significant portion of variance, typically 95%. It explains how to compute PCA, options for variance preservation, and the benefits of compression on datasets like MNIST. Additionally, it introduces Randomized PCA and Incremental PCA for efficiency in handling large datasets.

Dimensionality Reduction in Machine Learning: PCA, Projection & Manifold Learning

This content discusses dimensionality reduction approaches, focusing on projection and Manifold Learning. It explains how projection simplifies high-dimensional data, exemplified by datasets like the Swiss roll. Principal Component Analysis (PCA) is highlighted as a key algorithm for preserving variance while reducing dimensions, with SVD as a method for determining principal components.

Managing Data from Relational Databases using Python

Databases vary widely, with relational databases being predominant due to their efficient data structuring and retrieval. SQL simplifies data manipulation across different DBMSs. Python’s sqlalchemy facilitates database connections, allowing data reading and writing through various methods, compatible with multiple SQL databases.

Introduction to Dimensionality Reduction

The text discusses the curse of dimensionality in machine learning, highlighting challenges in high-dimensional spaces. It suggests reducing features to improve training efficiency and visualization, while addressing potential information loss and risks of overfitting with increased dimensions. Dimensionality reduction techniques will be explored further.

Gradient Boosting in Machine Learning

Another very popular Boosting algorithm is Gradient Boosting. Just like AdaBoost,Gradient Boosting works by sequentially adding predictors to an ensemble, each one correcting its predecessor. However, instead of tweaking the instance weights at every iteration like AdaBoost does, this method tries to fit the new predictor to the residual errors made by the previous predictor. … Read more

Boosting( Ensemble) Trees | Machine Learning from Scratch

Introduction Boosting (originally called hypothesis boosting) refers to any Ensemble method that can combine several weak learners into a strong learner. The general idea of most boosting methods is to train predictors sequentially, each trying to correct its predecessor. There are many boosting methods available, but by far the most popular are AdaBoost13 (short for … Read more

Charlie has a Magic Mirror Program in Java

Charlie possesses an extraordinary tool in his possession: a magic mirror capable of displaying right-rotated versions of any given word. This mirror offers a unique perspective, revealing fascinating transformations of words. In this blog post, we’ll delve into the Java code that produces these right-rotations, exploring how Charlie’s mirror brings about these linguistic metamorphoses. Also … Read more

Angry Professor | Hackerrank Solution

A Discrete Mathematics professor has a class of students. Frustrated with their lack of discipline, the professor decides to cancel class if fewer than some number of students are present when class starts. Arrival times go from on time (arrivalTime<=0) to arrived late (arrivalTime>0). Given the arrival time of each student and a threshhold number … Read more

Sending Data in Unstructured File Form

Unstructured data files consist of a series of bits. The file doesn’t separate the bits from each other in any way. You can’t simply look into the file and see any structure because there isn’t any to see. Unstructured file formats rely on the file user to know how to interpret the data. For example, … Read more

Random Forests | Machine Learning from Scratch

As we have discussed, a Random Forest is an ensemble of Decision Trees, generally trained via the bagging method (or sometimes pasting), typically with max_samples set to the size of the training set. Instead of building a BaggingClassifier and passing it a DecisionTreeClassifier, you can instead use the RandomForestClassifier class, which is more convenient and … Read more

Accessing Data in Structured Flat-File Form

In many cases, the data you need to work with won’t appear within a library, such as the toy datasets in the Scikit-learn library. Real-world data usually appears in a file of some type, and a flat file presents the easiest kind of file to work with. In a flat file, the data appears as … Read more