Skip to content

Instantly share code, notes, and snippets.

View aricooperdavis's full-sized avatar
🗿
Living

Ari Cooper Davis aricooperdavis

🗿
Living
View GitHub Profile
@aricooperdavis
aricooperdavis / parse_chordify.py
Created December 16, 2022 11:05
Parse Chordify.net loadUrl to text
import requests
loadUrl = 'https://chordify.net/api/v2/songs/youtube:JZtIF0wpi5g/chords?vocabulary=extended_inversions'
r = requests.get(loadUrl)
json = r.json()
chords = [chord.split(';') for chord in json['chords'].split('\n')]
i = 0
@aricooperdavis
aricooperdavis / 3d_regression_example.py
Last active February 2, 2024 13:13
Example of 3D plots illustrating Linear Regression with 2 features and 1 target
import matplotlib.pyplot as plt
import numpy as np
import sklearn.linear_model
from mpl_toolkits.mplot3d import Axes3D
X_train = np.random.rand(2000).reshape(1000,2)*60
y_train = (X_train[:, 0]**2)+(X_train[:, 1]**2)
X_test = np.random.rand(200).reshape(100,2)*60
y_test = (X_test[:, 0]**2)+(X_test[:, 1]**2)