Learner-Score-Collector

Fri 14 November 2025

!pip show beautifulsoup4 | grep "Version:"
Version: 4.12.3
import requests
from bs4 import BeautifulSoup

# URL to scrape
url = "https://stevesanjay.github.io/pynotes/archives.html"

# Send a GET request
response = requests.get(url)

# Parse the HTML content
soup = BeautifulSoup(response.text, 'html.parser')

# Find the element containing the "overall-score …

Category: basics

Read More

Letter-Match

Fri 14 November 2025

title: "Letter Match" author: "Raja CSP Raman" date: 2019-04-20 description: "-" type: technical_note draft: false


import re
contents = [
    "AB23",
    "A2B3", 
    "DE09",
    "MN90",
    "XYi9",
    "XY90"
]
for content in contents:
    regex_pattern = "(?:AB|DE|XY)\d+" 
    # starts with AB or DE; should contain one or more number

    m = re.match(regex_pattern, content)

    if(m …

Category: regex

Read More

Levenshtein-Distance

Fri 14 November 2025

title: "Levenshtein Distance" author: "Rj" date: 2019-04-21 description: "-" type: technical_note draft: false


import numpy as np
def levenshtein_distance(s, t):
    if s == "":
        return len(t)

    if t == "":
        return len(s)

    if s[-1] == t[-1]:
        cost = 0
    else:
        cost = 1

    res = min([levenshtein_distance(s[:-1], t)+1,
               levenshtein_distance(s, t …

Category: textprocessing

Read More

Lexical-Diversity

Fri 14 November 2025

title: "Lexical Diversity" author: "Rj" date: 2019-04-21 description: "-" type: technical_note draft: false


import nltk
f =open('canola.txt','r')
raw = f.read()
raw
'OTTAWA—The federal Liberals promised Wednesday to give Canada’s canola farmers much-needed financial aid to help lessen the impact of China’s decision to ban the …

Category: textprocessing

Read More

Linear-Regression-Simple

Fri 14 November 2025

title: "Linear Regression Simple" author: "Raja CSP Raman" date: 2019-04-20 description: "-" type: technical_note draft: false


import matplotlib.pyplot as plt
import numpy as np
from sklearn import datasets, linear_model
from sklearn.metrics import mean_squared_error, r2_score
import pandas as pd
# Load the diabetes dataset
diabetes_data = datasets.load_diabetes()

# Print all keys and …

Category: basics

Read More

Linear-Regression-Simple-4903

Fri 14 November 2025

title: "Linear Regression Simple" author: "Rj" date: 2019-04-20 description: "-" type: technical_note draft: false


import matplotlib.pyplot as plt
import numpy as np
from sklearn import datasets, linear_model
from sklearn.metrics import mean_squared_error, r2_score
import pandas as pd
# Load the diabetes dataset
diabetes_data = datasets.load_diabetes()
# Print all keys and number of …

Category: sklearn

Read More

Linear Search

Fri 14 November 2025

title: "Linear Search" author: "Rj" date: 2019-04-20 description: "List Test" type: technical_note draft: false


def linear_search(lys, element):  
    for i in range (len(lys)):
        if lys[i] == element:
            return i
    return -1
list = [1, 2, 5, 6]

print(linear_search(list, 5))
2


Score: 0

Category: basics

Read More

Linear Vs Binary Timeit

Fri 14 November 2025

title: "Timeit on Linear and Binary" author: "Rj" date: 2019-04-20 description: "List Test" type: technical_note draft: false


import timeit
def linear_search(lys, element):  
    for i in range (len(lys)):
        if lys[i] == element:
            return i
    return -1
def binary_search(lys, val):  
    first = 0
    last = len(lys)-1
    index = -1
    while …

Category: basics

Read More

Linkedin-Summary-Classification-Nb

Fri 14 November 2025

title: "Text Classification - Naive Bayes - LinkedIn Summary" author: "Rj" date: 2019-04-21 description: "-" type: technical_note draft: false


# Disclaimer: some code copied form this https://towardsdatascience.com/multi-class-text-classification-model-comparison-and-selection-5eb066197568
import logging
import pandas as pd
import numpy as np
from numpy import random
import gensim
import nltk
from sklearn.model_selection import train_test_split
from …

Category: textprocessing

Read More
Page 112 of 146

« Prev Next »