Thursday, September 16, 2021

Python Bytes: #250 skorch your scikit-learn together with PyTorch

<p><strong>Watch the live stream:</strong></p> <a href='https://www.youtube.com/watch?v=SKsbojB6zrc' style='font-weight: bold;'>Watch on YouTube</a><br> <br> <p><strong>About the show</strong></p> <p>Sponsored by <strong>us:</strong></p> <ul> <li>Check out the <a href="https://training.talkpython.fm/courses/all"><strong>courses over at Talk Python</strong></a></li> <li>And <a href="https://pythontest.com/pytest-book/"><strong>Brian’s book too</strong></a>!</li> </ul> <p>Special guest: <strong><a href="https://twitter.com/Proteusiq">Prayson Daniel</a></strong></p> <p><strong>Brain #1:</strong> <a href="https://nickdrozd.github.io/2021/09/02/new-pylint-checks.html"><strong>Exciting New Ways To Be Told That Your Python Code is Bad</strong></a></p> <ul> <li>Two new pylint errors <ul> <li>consider-ternary-expression</li> </ul></li> </ul> <pre><code> if condition(): x = 4 else: x = 5 </code></pre> <pre><code> x = 4 if condition() else 5 </code></pre> <ul> <li>while-used <ul> <li>it unconditionally flags every use of while expressions.</li> <li>generally, while should be avoided.</li> </ul></li> </ul> <p><strong>Michael #2:</strong> <a href="https://github.com/anuraghazra/github-readme-stats"><strong>GitHub Readme Stats</strong></a></p> <ul> <li>via Роман Великий</li> <li>Dynamically generated stats for your github readmes</li> <li>This are for your repo or your stats (others too I suppose) posted somewhere outside of github</li> <li>Card for a project: <a href="https://ift.tt/3nDrMF5> <li>Card for a user: <a href="https://ift.tt/3zkfXFX> <li>Card for your languages: <a href="https://ift.tt/3Clqa72> </ul> <p><strong>Prayson #3:</strong> <a href="https://nox.thea.codes/en/stable/"><strong>Nox</strong></a></p> <ul> <li>Nox appeared as “footnotes” in Episodes 182 and 248 (Hypermodern Python …)</li> <li>It does <a href="https://tox.readthedocs.io/en/latest/">tox</a> what <a href="http://www.pyinvoke.org/">invoke</a> did (substituting GNU Make) </li> </ul> <p><strong>Brian #4:</strong> <strong>Two tools for dealing with text</strong></p> <ul> <li><a href="https://github.com/eyeseast/python-frontmatter">python-easyfrontmatter</a> - a small package to load and parse files (or just text) with YAML (or JSON, TOML or other) front matter.</li> </ul> <pre><code> &gt;&gt;&gt; post = frontmatter.load('tests/yaml/hello-world.txt') &gt;&gt;&gt; print(post['title']) Hello, world! </code></pre> <ul> <li>Tried it with a helper script I’m using with Hugo, and it parses Hugo metadata in blog posts like a dream.</li> <li><a href="https://ftfy.readthedocs.io/en/v6.0/">ftfy</a> - fixes text for you</li> <li>“Take in bad Unicode and output good Unicode”</li> </ul> <pre><code> &gt;&gt;&gt; import ftfy &gt;&gt;&gt; ftfy.fix_text('✔ No problems') '✔ No problems' </code></pre> <p><strong>Michael #5:</strong> <a href="https://github.com/Slimmer-AI/mpire"><strong>MPIRE (MultiProcessing Is Really Easy)</strong></a></p> <ul> <li>A Python package for easy multiprocessing, but faster than multiprocessing</li> <li>It combines the </li> <li>convenience of map like functions of <code>multiprocessing.Pool</code> </li> <li>with the benefits of using copy-on-write shared objects of <code>multiprocessing.Process</code>, </li> <li>together with easy-to-use worker state, worker insights, and progress bar functionality.</li> <li><a href="https://github.com/Slimmer-AI/mpire#features">Many features</a></li> <li>Requisite shoutout to <a href="https://asherman.io/projects/unsync.html"><strong>unsync</strong></a> too.</li> </ul> <p><strong>Prayson #6:</strong> <a href="https://github.com/skorch-dev/skorch"><strong>skorch</strong></a></p> <ul> <li>Going deep learning with scikit-learn pipelines (Breaking limits of <a href="https://scikit-learn.org/stable/modules/neural_networks_supervised.html">multi-layer perceptron (MLP)</a>)</li> <li>Using PyTorch, skorch provides an API to extend neural networks models in scikit-learn.</li> <li>Example: <a href="https://gist.github.com/Proteusiq/9fb0f07a2887e124d99a219047f76e88">Penguins Classification shameless Gist</a></li> </ul> <p><strong>Extras</strong></p> <p>Michael</p> <ul> <li><a href="https://github.com/jupyterlab-contrib/jupyterlab-vim"><strong>vim + jupyter</strong></a>, via Marco Gorelli</li> <li><a href="https://twitter.com/mkennedy/status/1437988254213570560"><strong>PyBay talk</strong></a></li> </ul> <p>Prayson</p> <ul> <li><a href="https://github.com/henriquebastos/python-decouple/">python-decouple</a></li> </ul> <p><strong>Joke:</strong> <a href="https://www.monkeyuser.com/assets/images/2021/205-adoption.png"><strong>Adoption</strong></a></p>

from Planet Python
via read more

No comments:

Post a Comment

TestDriven.io: Working with Static and Media Files in Django

This article looks at how to work with static and media files in a Django project, locally and in production. from Planet Python via read...