Skip to content

Instantly share code, notes, and snippets.

View Dref360's full-sized avatar

Frédéric Branchaud-Charron Dref360

View GitHub Profile
@shaypal5
shaypal5 / confusion_matrix_pretty_print.py
Last active May 13, 2024 13:04
Pretty print a confusion matrix with seaborn
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
def print_confusion_matrix(confusion_matrix, class_names, figsize = (10,7), fontsize=14):
"""Prints a confusion matrix, as returned by sklearn.metrics.confusion_matrix, as a heatmap.
Note that due to returning the created figure object, when this funciton is called in a
notebook the figure willl be printed twice. To prevent this, either append ; to your
function call, or modify the function by commenting out the return expression.
import Keyboard
import Mouse exposing (position)
import Time exposing (Time, fps)
import Debug exposing(..)
import Signal
import Graphics.Element exposing (show)
import Graphics.Collage
import Color exposing (red, black)
import Window exposing (dimensions)
@lukovkin
lukovkin / multi-ts-lstm.py
Last active November 25, 2022 16:23
Time series prediction with multiple sequences input - LSTM - 1
# Time Series Testing
import keras.callbacks
from keras.models import Sequential
from keras.layers.core import Dense, Activation, Dense, Dropout
from keras.layers.recurrent import LSTM
# Call back to capture losses
class LossHistory(keras.callbacks.Callback):
def on_train_begin(self, logs={}):
self.losses = []
@jbonney
jbonney / spotify_keybindings
Created June 9, 2013 13:22
Spotify - Linux key bindings. From XFCE / Ubuntu keyboard shortcuts configuration, assign the control command to their key. http://shkspr.mobi/blog/2011/12/linux-spotify-keybindings/
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause" XF86AudioPlay
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop" XF86AudioStop
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next" XF86AudioNext
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous" XF86AudioPrevious