Skip to content

Instantly share code, notes, and snippets.

Martin Thoma MartinThoma

Block or report user

Report or block MartinThoma

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View hello-world.html
<html>
<head>
<title>This is the title</title>
</head>
<body>
<p>Hello World!</p>
</body>
</html>
@MartinThoma
MartinThoma / covid-19-de-predictions.txt
Last active Mar 31, 2020
Infection predictions for Germany from 2020-03-23
View covid-19-de-predictions.txt
LogitRegressor(beta=0.1980, c=13.4600, max_population=64000000.0)
Day 2020-02-24: 91 (+91) predicted vs 16 in reality
Day 2020-02-25: 111 (+20) predicted vs 18 in reality
Day 2020-02-26: 136 (+24) predicted vs 21 in reality
Day 2020-02-27: 165 (+30) predicted vs 26 in reality
Day 2020-02-28: 202 (+36) predicted vs 53 in reality
Day 2020-02-29: 246 (+44) predicted vs 66 in reality
Day 2020-03-01: 300 (+54) predicted vs 117 in reality
Day 2020-03-02: 365 (+66) predicted vs 150 in reality
Day 2020-03-03: 445 (+80) predicted vs 188 in reality
View gist:19704f1a499b27fc9afc192f86798098
Collecting scipy
Using cached scipy-1.4.1.tar.gz (24.6 MB)
Installing build dependencies ... error
ERROR: Command errored out with exit status 1:
command: /home/moose/.pyenv/versions/pypy3.6-7.3.0/bin/python /home/moose/.pyenv/versions/pypy3.6-7.3.0/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-1x4wi_xk/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- wheel setuptools 'Cython>=0.29.13' 'numpy==1.13.3; python_version=='"'"'3.5'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.13.3; python_version=='"'"'3.6'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.14.5; python_version=='"'"'3.7'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.17.3; python_version>='"'"'3.8'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'3.5'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'3.6'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'3.7'"
View 2d-plot.tex
\documentclass[border=2pt]{standalone}
\usepackage{pgfplots}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
legend pos=south east,
legend cell align={left},
View pytest execution for set equality
foo.py:
```
def test_a():
assert set([1, 2, 3]) == set([2, 3])
```
$ pytest foo.py
============================= test session starts ==============================
@MartinThoma
MartinThoma / xception_summary.txt
Created Feb 11, 2019
Keras model summary of Xception (Image classification deep learning model)
View xception_summary.txt
__________________________________________________________________________________________________
Layer (type) Output Shape Param # Connected to
==================================================================================================
input_1 (InputLayer) (None, None, None, 3 0
__________________________________________________________________________________________________
block1_conv1 (Conv2D) (None, None, None, 3 864 input_1[0][0]
__________________________________________________________________________________________________
block1_conv1_bn (BatchNormaliza (None, None, None, 3 128 block1_conv1[0][0]
__________________________________________________________________________________________________
block1_conv1_act (Activation) (None, None, None, 3 0 block1_conv1_bn[0][0]
View amentment.md

Code

UTC time with offset:

>>> import pytz
>>> tz = pytz.timezone('Pacific/Apia')
>>> import datetime
>>> datetime.datetime(2011, 12, 30, 9, 59, tzinfo=datetime.timezone.utc).astimezone(tz).isoformat()
'2011-12-29T23:59:00-10:00'
>>> datetime.datetime(2011, 12, 30, 10, 00, tzinfo=datetime.timezone.utc).astimezone(tz).isoformat()
View gist:85080a53f73661f971a7ef4dba48364b
Decision trees might even be in $\mathcal{O}(1)$. I have to give impurity measures a closer thought.
# Time Complexity of Training and Testing
## By training samples ($n$) and samples features ($m$) and number of classes ($c$).
The following classifiers potentially have computational complexities less than or equal with $\mathcal{O}(mnc)$ complexity) in both of the training and testing phases.
* k-nearest neighbors is linear (https://stats.stackexchange.com/questions/219655/k-nn-computational-complexity),
* Naive Bayes is linear for those PDFs that can be estimated in linear time (e.g. Poisson and Multinomial PDFs).
* Approximate SVM is linear (https://stats.stackexchange.com/questions/96995/machine-learning-classifiers-big-o-or-complexity)
View data-science-wordcloud.txt
11 Python #509e2f
10 Computer~Science
10 Mathematics
9 R #509e2f
8 machine~learning #651d32
7 Big~Data #41b6e6
6 Java #509e2f
5 Databases
5 Hadoop #41b6e6
4 Tensorflow/Keras/Theano #651d32
@MartinThoma
MartinThoma / diff.txt
Created May 28, 2018
Difference between mtrand.cpython-36m-x86_64-linux-gnu.so of numpy 1.14.0 vs numpy 1.14.1
View diff.txt
_rand_bool(low, high, size, rngstate)
Return random np.bool_ integers between ``low`` and ``high``, inclusive.
Return random integers from the "discrete uniform" distribution in the
closed interval [``low``, ``high``). On entry the arguments are presumed
to have been validated for size and order for the np.bool_ type.
Parameters
----------
low : int
Lowest (signed) integer to be drawn from the distribution.
high : int
You can’t perform that action at this time.