This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* monochrome theme */ | |
/* Colors */ | |
/* Typography */ | |
/* Borders */ | |
/* Shadows */ | |
/* Layout */ | |
body { | |
user-select: none; | |
background: #000; | |
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
import xml | |
import plotly.graph_objects as go | |
def svg_to_fig(svg_bytes, title=None, plot_bgcolor='white', x_lock=False, y_lock=False): | |
svg_enc = base64.b64encode(svg_bytes) | |
svg = f'data:image/svg+xml;base64, {svg_enc.decode()}' | |
# Get the width and height | |
xml_tree = xml.etree.ElementTree.fromstring(svg_bytes.decode()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dash | |
import dash_core_components as dcc | |
import dash_html_components as html | |
from dash.dependencies import Input, Output | |
import plotly.express as px | |
import pandas as pd | |
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Speech Synthesis with Dash. This will only work with a Nvidia GPU. | |
Requirements (put them in requirements.txt): | |
apex | |
dash | |
numpy | |
scipy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tensorflow | |
numpy | |
pandas | |
matplotlib | |
scikit-learn | |
jupyter | |
jupyterlab | |
seaborn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Short link: http://bit.ly/python-ml-bundle | |
# Usage (after creating a venv or conda env): | |
# wget http://bit.ly/pip-ml-bundle | |
# pip install -r pip-ml-bundle | |
# rm pip-ml-bundle | |
# scientific | |
numpy | |
scipy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import tensorflow as tf | |
class TFRidge: | |
def __init__(self, alpha=1.0, fit_intercept=True, normalize=False, solver='cholesky'): | |
if solver != 'cholesky': | |
raise ValueError('The only accepted solver is currently "cholesky"') | |
self.alpha = alpha | |
self.fit_intercept = fit_intercept |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% md | |
# Scikit-Learn in the browser: Iris Classification | |
The goal of this notebook is to show how to use Scikit-learn directly in your browser, through pyodide. This particular example, we will train a simple classifier using the Iris data. Then, we will build an HTML GUI using Iodide, which will be used to interact with the classifier and perform predictions. | |
## Update your inputs | |
<div> | |
Change Sepal length: | |
<input id="sepalLengthInput" type="range" step=0.1 min=4 max=8><br> | |
Change Sepal width: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open Printf;; | |
type attribute = | |
| Class of string | |
| Href of string | |
| Src of string | |
| Style of string | |
| Alt of string | |
| Width of int | |
| Height of int |