Machine Learning From Scratch

  • SQL | The BETWEEN Operator

    SQL | The BETWEEN Operator

    BETWEEN Operator Example The “Persons” table: Now we want to select the persons with a last name alphabetically between “Hansen” and “Pettersen” from the table above. We use the following SELECT statement: The result-set will look like this: P_Id LastName FirstName Address City1 Hansen Ola Timoteivn 10 Sandnes The BETWEEN operator is treated differently in… Read more

  • SQL | The IN Operator

    SQL | The IN Operator

    The IN operator allows you to specify multiple values in a WHERE clause. SQL IN Syntax: IN Operator Example The “Persons” table: Now we want to select the persons with a last name equal to “Hansen” or “Pettersen” from the table above. We use the following SELECT statement: The result-set will look like this: Read more

  • Getting Started With Pandas | Part 1

    Getting Started With Pandas | Part 1

    Installation or Setup Detailed instructions on getting pandas set up or installed can be found here in the official documentation. Installing pandas with Anaconda Installing pandas and the rest of the NumPy and SciPy stack can be a little difficult for inexperienced users. The simplest way to install not only pandas, but Python and the… Read more

  • Selecting the Number of Clusters

    With K-Means, you could use the inertia or the silhouette score to select the appropriate number of clusters, but with Gaussian mixtures, it is not possible to use these metrics because they are not reliable when the clusters are not spherical or have different sizes. Instead, you can try to find the model that minimizes… Read more

  • SQL | The INSERT INTO AND UPDATE Statement

    The second form specifies both the column names and the values to be inserted: SQL INSERT INTO Example We have the following “Persons” table: Now we want to insert a new row in the “Persons” table.We use the following SQL statement: The “Persons” table will now look like this: Insert Data Only in Specified Columns… Read more

  • Tokenization in NLP

    Tokenization in NLP

    Word Level Tokenzation Splitting text into individual words “the quick brown fox” -> [“the”,”quick”,”brown”,”fox”] BUT Character Level Tokenization Splitting text into individual characters “the quick brown fox” -> [“t”,”h”,”e”,” “,”q”,”u”,”i”,”c”,”k”, …] But N-GRAM MODELS Splitting text into groups of consecutive words. N is the no. of words in a token. For a trigram model, “the… Read more