<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Vincent Brandon on Medium]]></title>
        <description><![CDATA[Stories by Vincent Brandon on Medium]]></description>
        <link>https://medium.com/@vallen_92604?source=rss-e6bc2973e1c5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*5lU2O6yDCfgh93Q4.jpg</url>
            <title>Stories by Vincent Brandon on Medium</title>
            <link>https://medium.com/@vallen_92604?source=rss-e6bc2973e1c5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 13:40:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vallen_92604/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Needing More From Django]]></title>
            <link>https://medium.com/@vallen_92604/needing-more-from-django-49a440722944?source=rss-e6bc2973e1c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/49a440722944</guid>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Vincent Brandon]]></dc:creator>
            <pubDate>Fri, 27 Sep 2019 16:16:21 GMT</pubDate>
            <atom:updated>2019-09-27T16:16:21.508Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*rT7rudpAkq6UR5MJ9SXFNQ.png" /><figcaption>Hurdles in Deployment ML and Django</figcaption></figure><p>Django is powerful, extensible, but missing something for ML</p><p>Let me start with a confession. I love Django, even though I’m bad at it. As a framework, the abstraction and pluggability feel distinctly pythonic. There has been no framework I’ve worked in where searching for answers yielded similarly-framed effective answers.</p><p>Having used Flask in the past for simple deployments of Machine Learning dashobards to interact with a pickled model, I wanted to try my hand at Django. The main reason was this:</p><p><strong>Classification models normally return indices referencing their training dataset</strong></p><p>This was my first project with a react frontend team. Separation of duties and supplying a clean, effective, fast, API for querying data was a concern. It made sense to maintain the data with the model as retraining on different datasets would require updating data in multiple locations, which didn’t make much sense. Django has no problem managing and migrating PostgreSQL instances, so it was a sure bet, or so I thought.</p><p><strong>Then came the model. Heroku. And the hysterical nature of ephemeral filesystems.</strong></p><p>Unpickling large models is a slow process. On my local development server, I tried everything. Caching a class instance with the model loaded when the server started, caching on first call and using a simple cache checking function.</p><pre>def get_file(file_key):</pre><pre>    if cache_file(file_key):</pre><pre>        return cache.get(file_key)</pre><pre>    else:</pre><pre>        cache_file(file_key, load_file(file_key))</pre><pre>    return cache.get(file_key)<br></pre><pre>def load_file(file_key):</pre><pre>    with open(get_abs_path(params[file_key]), &#39;rb&#39;) as f:</pre><pre>        opened = pickle.load(f)</pre><pre>    return opened</pre><p><strong>Memcached is trash for ML</strong></p><p>Maybe I’m just sour. It should be on their home page. Need to cache more than 1Mb? Too bad. We’ll throw errors which may or may not make sense depending on the environment.</p><p><strong>django.core.cache.backends.locmem.LocMemCache</strong></p><p>Django has a local memory cache you can just use. Awesome. Wow. Amazing. On localhost I was able to shave off 0.2–0.4s from a 1.9s response time. Going from 1.9s to 1.7s made me very excited. I tested. Committed. Merged.</p><p>git push heroku master!</p><p>Testing… … … [24.9, 8.8, 9.5, 8.6, 7.8] and so on. The cache was working. But response times more than quadrupled. Performance was also all over the place, where I expected it to be more consistent.</p><p><strong>Ephemeral Filesystems = Ramdisk (What cache? Why?)</strong></p><p>The performance gains I saw on local host were from moving a file that was on a hard drive (accessed over the network no less). On Heroku — this is a guess. Could very well be wrong — their ephemeral filesystem claim is nothing more than loading small applications completely into memory when not sleeping. So after the application loads into RAM, caching a file already in RAM to another spot in RAM behind a key held in another spot in RAM just messes things up.</p><p><strong>Django needs a Large Operations Daemon</strong></p><p>This is where I’m at now. I really would rather not move the model into a completely different compute engine. I am not sure it’s wholly necessary. Django itself is snappy enough. I would like an option for Django to spawn a private view that’s always on, so I can have the model waiting for input. If it could spawn the view in advance on new connections (assuming use of the model) that’d be great. If I’m being honest, this seems like something easier to do in Flask. But, I love Django. I want Django to work. And I want better response times.</p><p>Have you worked with Django and Heroku on an ML project or something with particularly intense business logic NOT involving a database? Let me know below or bug me on my site at <a href="https://vincebrand.com/">vincebrand.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49a440722944" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[VS Code Remote Development Janked Out]]></title>
            <link>https://medium.com/@vallen_92604/vs-code-remote-development-janked-out-5fd2cba3744f?source=rss-e6bc2973e1c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/5fd2cba3744f</guid>
            <category><![CDATA[remote-development]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[vscode-extension]]></category>
            <category><![CDATA[ubuntu-server]]></category>
            <dc:creator><![CDATA[Vincent Brandon]]></dc:creator>
            <pubDate>Sun, 15 Sep 2019 05:03:38 GMT</pubDate>
            <atom:updated>2019-09-15T18:36:04.606Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*KUrxuWTDRDJgPO3SXpKv8w.png" /><figcaption>More Cores, More Memory, More Power</figcaption></figure><p>I have been fighting with an underpowered laptop for some time. I am finally getting a handle on it for cheap</p><h3>DISCLAIMER</h3><p>The setup described pertains to Windows laptops interfacing with Linux servers. Some of the caveats noted and screenshots are particular to Windows or at least SMB network shares.</p><h3>Background</h3><p>I was mid project, data cleaned, and ready to begin fitting early models in scikit-learn. Nothing fancy. A little regression. Maybe a random forest, not too big. I was sweating running the cell, task manager open. Even with less than a gigabyte of data, with pipelines and cross-validation, there was no way it would it complete.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qERbddbw__m0sm88orQR3Q.png" /><figcaption>My i3 Is Not Enough</figcaption></figure><p>My 8gb of RAM were almost at capacity running a few Chrome tabs. I was remote. My workstation, my NAS, and compute server, were all long off and not exposed for remote startup. So, I did what the internet told me to. I signed up for AWS. Gave up on that faster than it took me to get approved. I didn’t want to burn through credits or accidentally charge myself data wrangling. Didn’t want to deal with learning the setup, launch, and connect, quirks either.</p><p>Long story short, I bought a refurbished Dell Optiplex 9020 for $125 (great deal with the i7 4790) and got to work. What follows are the steps I took to enable remote SSH in VS Code (I am a spoiled newb and love it). The goal first and foremost is enabling development via my laptops IDE powered by the server for python, SQL, and my Hugo website.</p><p>I will use the following terminology interchangeably.</p><p>‘Dell Optiplex 9020’ or ‘Server’</p><p>And</p><p>‘Windows i3 Laptop’ or ‘Client’</p><p>* The same steps should work on any windows 10 or 10 Pro client with any Debian-based server. You’ll find details on steps 1–3 here and 4–5 in a follow up article.</p><p>PART 1:</p><ul><li>Build a Network</li><li>Install Ubuntu Server (18.04 LTS) on Server (Dell)</li><li>a. Ensure SSH active and firewall lets it through</li><li>Install VS Code Remote Development Kit on Client (Laptop)</li><li>a. Set up VS Code SSH configuration file</li><li>b. Connect via SSH</li></ul><p>PART 2 (Follow Up Coming):</p><ul><li>SMB shared folder on Client to share files between the Client and Server</li><li>Install Anaconda</li><li>Install Hugo</li><li>a. Verify Hugo development server available</li><li>Install SQL</li></ul><h3>Building a Network</h3><p><em>Get a good switch, even if it’s used</em>. I found a Netgear ProSafe 1Gb 5 port managed switch for $30 in box. You do not want to use your guest’s or hotel’s router to interface to the server. Security is one thing, but latency is going to kill the experience, especially if you decide to run Dask distributed or similar across both machines.</p><p><em>Get internet to both machines, which means to the switch</em>. It is nothing but headaches trying to debug network issues when connecting to multiple networks at the same time through different devices. Do not try to use wi-fi on the laptop and plug into an internet-enabled switch. Can you? Yes. Will I? No. I’m not an sys admin and have models to build and deepfakes to make. I will tell you how I did it, though Verizon might cancel my account, so keep this a secret. You can buy a wifi extender (I used a $15 TP Link 300MBPS) with an ethernet output. Set it to pick up the hotspot from your phone. With a VPN (like Private Internet Access **cough**) and a registry hack setting your TTL (time to live) to 65, I can get up to 60MBPS, which is more than 20 times faster than my host’s DSL. It will take a LONG time for the phone to assign IP addresses. They may change, which sucks. You can try putting a router in front of the internet connection, but I’ve found the latency gets horrendous at that point from hotspots. I can change two IP addresses reasonably fast and the phone generally reserves the IP well enough. Watch a Verizon dev read this and start IP hopping hotspot devices.</p><h3>Install Ubuntu Server on the Server</h3><p>There are a number of great resources on the web for this. I used the portable version of Balena Etcher to make a USB with the latest stable release of Ubuntu server and installed from that. For more details, check the web or ask in the comments below. Ubuntu server (if option selected) comes with SSH out of the box, which is what we need. I suggest keeping stock settings and just allow SSH through the firewall.</p><h3>Enable Firewall</h3><pre>sudo ufw enable</pre><pre>sudo ufw allow ssh</pre><pre>sudo ufw allow 22</pre><h3>Install VS Code Remote Development Kit</h3><p>The documentation from Microsoft only OK. Their soundless 2 minute videos are somewhat useful. I suggest taking a look at some point:</p><p><a href="https://code.visualstudio.com/docs/remote/remote-overview">https://code.visualstudio.com/docs/remote/remote-overview</a></p><p>There is a lot going on behind the scenes as you’ll see in a second. VS Code will automatically install a server-side application that will handle resource intense IDE tasks on top of running your code.</p><p>On the CLIENT the install is easy. Open VS Code on the client machine. Click extensions. Search for remote development. Install either the remote development pack or just what we need which is remote-SSH.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/1*_hNCMo-UujqLgaqrLDAXXQ.png" /><figcaption>VS Code Extension Search</figcaption></figure><p>Make sure your server is on and you REMEMBER YOUR SERVER LOGON CREDENTIALS. WRITE THAT CRAP DOWN. If there’s one thing that is somewhat annoying, it’s that the current VS Code extension does not allow for saving passwords, so you’ll be entering it a lot.</p><p>The next two steps sound worse than they are to execute. We need to create a CLIENT public/private ID and pass that along to the SERVER.</p><h3>Generating and Sharing SSH Key from CLIENT to SERVER</h3><p>I am extracting steps from the official VS Code documentation that can be found <a href="https://code.visualstudio.com/docs/remote/troubleshooting#_configuring-key-based-authentication">here</a> (they include steps for Mac OS and Linux).</p><p>On the CLIENT, press WINDOWS_KEY+X to open the admin menu and open a Windows Powershell. Navigate to your users .ssh folder. Run the ‘dir’ command to see if you have a public/private key already.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/1*5cAsgj9ytOYNha9vnMD3lw.png" /></figure><p>If you don’t (or get an error that the directory doesn’t exist) fret not. Go to your user folder and make the .ssh directory:</p><pre>cd /Users/&lt;username&gt;</pre><pre>mkdir .ssh</pre><pre>cd .ssh</pre><p>Then generate your public and private keys with the following command in Powershell (still on the CLIENT. We’ll get to the server in a sec)</p><pre>ssh-keygen -t rsa -b 4096</pre><p>Stay in Powershell! Now we’ll have the Windows CLIENT push its public key over. Strongly suggest copy/pasting this code and changing what you need.</p><h4>%USERPROFILE% is your username. The same you used above in checking/making your .ssh folder.</h4><h4>%REMOTEHOST% is a concatenation of your &lt;SERVER USERNAME&gt;@&lt;SERVER_IP_ADDRESS&gt;, like vincesudouser@192.168.1.5</h4><pre>scp %USERPROFILE%\.ssh\id_rsa.pub %REMOTEHOST%:~/tmp.pub</pre><pre>ssh %REMOTEHOST% “mkdir -p ~/.ssh &amp;&amp; chmod 700 ~/.ssh &amp;&amp; cat ~/tmp.pub &gt;&gt; ~/.ssh/authorized_keys &amp;&amp; chmod 600 ~/.ssh/authorized_keys &amp;&amp; rm -f ~/tmp.pub”</pre><p>Next up, we’ll create a SSH configuration file right from VS Code. So open VS Code. Hit F1. Search for “Remote-SSH: Open Configuration File.”. There ought to be a default option in C:\ProgramData\SSH\ssh_config, but you can also create a file in the username\.ssh directory you just created. Anyhow, open or create one and fill it out with the following (watch your indentation — keep it exact):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f2ixnH54xiV23RG7B3cv8Q.png" /><figcaption>Opening SSH Config File in VS Code</figcaption></figure><p># Read more about SSH config files: <a href="https://linux.die.net/man/5/ssh_config">https://linux.die.net/man/5/ssh_config</a></p><pre>Host dell9020</pre><pre>    HostName 192.168.1.5</pre><pre>    User vincesudouser</pre><pre>    IdentityFile ~/.ssh/id_rsa</pre><h3>Start Remote Session in VS Code</h3><p>Finally! VS Code’s dev team have done quite a job. The rest is almost automatic. Just some fingernail biting as we wait for the server-side extensions to be downloaded and installed.</p><p>You’ll notice in the bottom left of VS Code, there is now a pretty button. If you hover, a message should appear “open a remote window”. You can also hit F1 and search for Remote-SSH Connect to Host. You should be greeted by a dropdown with your pre-configured SERVER right at the top.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AdWV9aQY2fvhSm_ISre5CQ.png" /><figcaption>Viewing SSH Host Menu</figcaption></figure><p>Click and enter your SERVER password. If you didn’t set up a config file, no worries, just Add New SSH Host now with your SERVER information. You may get a popup asking you to trust the connection. Do so (as you’re initiating it to a ‘clean’ box hopefully).</p><p>Then wait…and wait. VS Code needs to download a few things. You may have to enter your password repeatedly to allow installs in both the terminal and a dropdown from the search area. Don’t worry, Linux is just a wonderbread safety cow. Eat a PB&amp;J and wait for everything to set up. I was finally greeted with this (note I had installed Conda, so you’re also seeing my Anaconda environment).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gw91rJ67mzBD8xMSmP6aqg.png" /><figcaption>Example Remote-SSH Session</figcaption></figure><p>Another thing to note is opening folders. The files on the left are on a mounted share that the Linux SERVER user has full read/write/execute power on…Yes, I can SSH into a Linux machine that can probably destroy my laptop. What’s important to note is that you may have to enter your password every time you switch folders. VS Code will initiate a new SSH connection for every root folder you visit. Sorta annoying, but it is what it is. For more on how to mount a shared folder or remote file system in Linux check the web or see how I did it in Part 2 coming soon.</p><p>Do you have any experience in VS Code Remote Development? I’m still exploring its features and would love to hear more and tune my development setup. I am undoubtedly going to bring the framework home with me when I return to my main rig and server closet.</p><p>Best coding.</p><p>-V</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5fd2cba3744f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kanban Won’t Help You]]></title>
            <link>https://medium.com/@vallen_92604/kanban-wont-help-you-7b4d125c9308?source=rss-e6bc2973e1c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b4d125c9308</guid>
            <category><![CDATA[project-management]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[history-of-technology]]></category>
            <category><![CDATA[agile]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Vincent Brandon]]></dc:creator>
            <pubDate>Thu, 08 Aug 2019 16:27:16 GMT</pubDate>
            <atom:updated>2019-08-08T21:22:28.032Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/535/1*JIqvHyntr0_RTIGdsiz7_Q.png" /><figcaption>1 Courtesty Jbarta, licensed under the Creative Commons Attribution-Share Alike 2.5 Generic license.</figcaption></figure><p><em>Not if you don’t understand your workflow first.</em></p><p>With the rise of agile project management practices, many are turning to Scrum tools in isolation, picking and choosing the storyboard methods and rigid workflows from enterprise software developers with consistent products. Project managers in large enough firms often have the benefit of huge knowledge archives, repositories of code and documentation, old contracts, and lessons learned registers to identify bottlenecks. With that much information and some intuitive clustering, a keen eye can pick out somewhat discrete phases work packets move through and design effective Kanban boards keeping engineers and functional managers focused. But, should you?</p><p>Probably not. First, where did Kanban come from?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/301/1*Tp9McTGgjQ-IfCPsbpsOJw.png" /><figcaption>Taiichi Ohno the father of Toyota TPS, and Just-In-Time Manufacturing</figcaption></figure><p>We need to go back a while. Before you ever heard of JIT (Just-In-Time) and LEAN manufacturing, this brilliant engineer and a few champion managers at Toyota had a problem. They had complicated plants of hundreds of machines, thousands of workers, and every effort at improving the number of cars made, how fast from order to construction (often called lead time), brought lack luster results. Ohno and his team wanted to restructure operations to improve the throughput of the entire plant instead of focusing on the efficiencies of any single person or workstation. This was early 1900s. Since then, Ford’s adoption and subsequent publications by Ohno and Setsuo Mito cemented just in time manufacturing and brought us six-sigma and a slew of lean manufacturing techniques.</p><p>So, when you think I want to do Agile, I want to use Kanban to organize my tasks, ask yourself — am I a manufacturer? Do I have multiple staff and stakeholders to communicate to? Do I understand where the bottlenecks are, and have the freedom to lower inventory (work in progress) to help optimize the system? If you are, say, a freelancer — there’s a good chance that the time spent maintaining a Kanban board will be counter-productive. There’s a good chance, at the single unit level, that what you need is a Kanban card, not to be lord over a Kanban system.</p><p>What is a Kanban card? Really, it’s a to-do list. You only get to work on what’s on the to-do list.</p><p>Microsoft has a wonderful little app for windows users: Microsoft To-Do</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*BM7klfwG3kRwao9_No_nlg.png" /><figcaption>Example to-do list from Microsoft ToDo</figcaption></figure><p>There are online resources like this one: <a href="https://todoist.com/?lang=en">https://todoist.com/</a></p><p>And pen and paper are ALWAYS an option. Stay away from sticky notes unless you know what you’re doing. They often cause clutter that reduces focus and productivity soon after they are helpful.</p><p>**It is my firm belief that sticky notes are a communication tool and not to yourself, meant to be thrown away or burned once read**</p><p>When you can master the to-do list, not overloading it, adding workable chunks that don’t need to be immediately broken into sub-tasks, you’re probably ready for a more substantive PM tool. Kanban is STILL probably not the way to go. For small teams, an issue ticket resolution system is still probably a better fit, especially if you’re all colocated and you don’t have multiple levels of management to deal with.</p><p>Try: <a href="https://www.zoho.com/projects/">https://www.zoho.com/projects/</a></p><p>If you want to go big league, check out <a href="https://www.atlassian.com/software/jira">Jira</a> from Atlassian. Host it yourself for $10/yr. If open-source is more your style <a href="https://www.odoo.com/">Odoo</a> has come a long way. In sales, many CRM (customer relations management) suites also have built-in task managers and scale to millions of clients. Check out <a href="https://suitecrm.com/">SuiteCRM</a> for an open-source option, or contact <a href="https://info.sugarcrm.com/">SugarCRM</a> to see an accessible enterprise solution.</p><p>Why no Kanban? Where is Scrum? Why can’t I be JIT — a six-sigma, LEAN certified pro? Because those are solutions for large teams with defined knowledge management systems. At the heart of every enterprise optimization solution is data. Are you collecting enough to understand your workflow? To-do lists with checkmarks (heck, try putting date of list-created and date of item-complete) and you’ll be well on your way. Without that information, you’re probably spinning your wheels, wasting valuable time you could be meditating or drinking coffee or watching YouTube lectures on the thing that actually has you stuck on playing with sticky notes no one wants to read.</p><p>Disagree? I bet you do! Leave a comment or visit me at <a href="https://vincebrand.com/">vincebrand.com</a> for more thoughts on data and project management.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b4d125c9308" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sick? Google It.]]></title>
            <link>https://medium.com/@vallen_92604/sick-google-it-2ae0fe690a42?source=rss-e6bc2973e1c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ae0fe690a42</guid>
            <category><![CDATA[language-learning]]></category>
            <category><![CDATA[google-api]]></category>
            <category><![CDATA[trends]]></category>
            <category><![CDATA[profession]]></category>
            <category><![CDATA[health]]></category>
            <dc:creator><![CDATA[Vincent Brandon]]></dc:creator>
            <pubDate>Mon, 05 Aug 2019 04:58:31 GMT</pubDate>
            <atom:updated>2019-08-07T17:49:52.367Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uoZm-xgThp0RrxBzv96Isg.jpeg" /><figcaption>What do people know about medical science?</figcaption></figure><p>It wasn’t too long ago I found a chasm of missing medical information for the studies providing fodder for next week’s headlines and health trends. If you want to get an idea of just how much is missing, you can check out the earlier article here on Missing Medical Data.</p><p>But just knowing that the data is unavailable doesn’t mean your diet-obsessed colleagues or internet-medic friends would actually find it. Search software is smart, but it’s also very fast. Searches are trying to give you what you’re asking for with a dose of locality and a knock toward profile favorites. Looking for “diabetes” won’t return “metabolic acidosis” in your top 5 or wiki summary unless you’ve been indexing medical dictionaries for the last year.</p><p>Health is complicated. Complicated topics have big words. So how often are people searching for ‘big’ words in health anyway?</p><p>To find out, I stripped an old medical dictionary of all its vocab and randomly sampled 1000 (of 20k for a first pass) words. Word ‘technicality’ or ‘difficulty’ is somewhat related to its length. With all this internet available, have people been using their power-packed thumbs to rip through ever more advanced terminology?</p><p>By multiplying a word’s trend score by word length, we can get a new space of information to look at.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*c2MrbS1rfX2BG_G8li5rPw.png" /></figure><p>Over time, word length x trending score seems to be increasing, albeit slowly. This is a good candidate for larger trend collection.</p><p>Interesting. What about those at the top?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/383/1*IxVrXRy0ou0lnBAMIR4bjA.png" /><figcaption>Top 5 technical medical search terms 2014 &amp; 2019</figcaption></figure><p>The 2014/2019 split has a familiar face. Ever go to the dentist? Apparently, people really want to know they won’t feel their next root canal. The Pterygomandibular space is the head and neck tissue on each side of the face. It’s studied carefully by dentists before applying anesthetic during Inferior Alveolar Nerve Block.</p><p>‘Differentiated’ may not seem like a medical term at first glance, but in 2014 the BBC reported Japanese scientists achieved a major breakthrough in stem cell technology. Differentiating is the process of an embryonic stem cell becoming hear, lung, marrow, or other organ tissue. See the article <a href="https://www.bbc.com/news/health-25917270">here</a>. Whether headlines may drive technical learning in the population is an interesting topic for future investigation.</p><p>Is there a relation between the highest-ranking technical terms and the most popular medical searches? Let’s see:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/341/1*0HQIKJ-q4xBa2YW-W331nw.png" /><figcaption>Top 5 medical search terms overall 2015 &amp; 2019</figcaption></figure><p>Cancer is one of humanities greatest enemies to long, healthy, lives. Carcinogenesis is the process of cancer formation. A reasonably complicated term that will lead home and library researchers to a wealth of information about how cancer gets hold in our bodies. Why the interest? Maybe it was the <a href="https://www.livescience.com/43624-cancer-risk-in-fukushima-area-estimated.html">report</a> out in 2014 that showed over 40 people contaminated with radiation after the Fukushima nuclear reactor meltdown in Japan. In 2019, radiation seems to have hit a high note -also closely linked to cancer, but encompasses a broad range of energy sources. Further investigation might show an evolution in search around cancer. Laurocerasus are fruit trees. Why are they in a medical dictionary? Well, papers and WebMD have recently been espousing tart cherry as a natural treatment for gout and inflammation. Prunes are a common remedy for an ailment associated with not eating enough fiber. Constipation, anyone?</p><p>This can be powerful policy data. For any amount of available information given in simple or technical terms, we can begin to ask if anyone would ever bother to find it. We also know whether we should take our bestie internet-doctor’s google fu as good advice or set an appointment to see the real thing. Probably a good idea to visit your doctor. We can also begin to ask whether a population is properly informed about a topic and how much a learning curve they’ve climbed over time.</p><p>This early data exploration is promising. The full data pull is underway. A dictionary of terms, API access code, and the visualization notebooks can all be found at on <a href="https://github.com/newnativeabq/mendeley-search/tree/master/google-trends">GitHub</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ae0fe690a42" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Missing Medical Data]]></title>
            <link>https://medium.com/@vallen_92604/missing-medical-data-7065fbc42973?source=rss-e6bc2973e1c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/7065fbc42973</guid>
            <category><![CDATA[medicine]]></category>
            <category><![CDATA[data-pipeline]]></category>
            <category><![CDATA[knowledge-sharing]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[knowledge]]></category>
            <dc:creator><![CDATA[Vincent Brandon]]></dc:creator>
            <pubDate>Thu, 18 Jul 2019 15:50:42 GMT</pubDate>
            <atom:updated>2019-07-18T15:50:42.713Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-IRNNtx7hu_oUnHJngKHiw.jpeg" /><figcaption>Ignorance</figcaption></figure><p>This post is about what can’t be found.</p><h3>It Started with A Stroke</h3><p>Someone close to me recently suffered a traumatic brain injury — a series of them. First a stroke, then a seizure cut quality of life down to a fraction of what is was only months before. I wanted to hunt down data that might inform me what to look for, what tests matter, what factors and features predict recovery or relapse. And I hit a wall.</p><h3>The Raw Data Isn’t There</h3><p>Having worked in clinical research before, I knew that I had to see the data and work with it. Frankly, no one should trust the published numbers without confirming how the analysis was run and on what sample it was run on.</p><p>The more I read, the more I realized a series of joins were going to be necessary. There simply isn’t a single dataset that covers the factors I need. It also makes sense to test any prescriptive statistic (likelihood of stroke in set A) from one set on morbidity targets (did set B have a stroke or not?). And I ran into a jam.</p><p>The data isn’t available. I wasted $70US for some crappy p-values and a carbon-copy methods sections (they weren’t using innovate procedures, just running the tests I needed to look). This is manufactured ignorance in the science community. Reproduction is vital to scientific integrity and that starts with at least being able to come up with the same graph from the same data. There is no way to really know how much finessing some grad student did to produce a graph and whether or not peer reviewers actually took the time to produce pivot tables from the right sample populations, or review any models used in assessment or bias checks. That’s crap. How bad is the problem?</p><h3>It’s Bad. Real Bad</h3><p>To find out just how much data isn’t available, I turned to the sidebar of Mendeley.com. If you haven’t checked it out, I strongly suggest you do. They are a part of Elsevier, a paywall for providing research (where I wasted all that money), but who are helping pioneer data ethics and repeatable analyses in research by guilt-tripping scientists into sharing their tidy data for brownie points.</p><p>With our developer access granted, let’s take a quick peek at where the information is rendered normally.</p><p>Mendeley offers a rather attractive search page and their database lookups are fast:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*o6QnKbnwZuY5pJDhWvPcIA.jpeg" /></figure><p>I searched for “stroke prediction adult” and received this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*adtGrI7sAJ3lKFL7dYUGKQ.jpeg" /></figure><p>Sorting on data repositories yields everything from pdfs of the article to pictures of tables. That number is useless, despite the name. Tabular datasets are nothing but the cex or similar formatted tables in the paper. Not the raw data. The raw data is key if we are to (1) repeat the analysis for validity testing and (2) combine the data with other datasets for group testing and comparison. You cannot directly compare findings in summary form from one paper to another easily as the models and analysis are often very different. The tables are effectively useless for machine learning downstream.</p><p>The only filter that regularly provides some sort of data or repository access portal is “File Set” and that’s not perfect. Even assuming 100% of file sets are in fact full data used in the presented paper, only 1112 of 57114 (~2%) of the published work pulled in this search likely have the datasets available for review on Mendeley.</p><h3>No Excuse</h3><p>Most academic research done in the United States Universities and published in Journals is in some part funded by the government. We paid for the raw data and don’t get access to it.</p><p>Can you email the authors and ask for the data? Sure, but they may not give it to you for whatever reason they come up. The data is lost, buried, crap, or holds finding they are trying to commercialize. Is there more data available in repositories? Absolutely, but that doesn’t excuse authors for not publishing their subset, pull method, and code used in analysis. I mention subset here specifically because in pulling data from an API or merging data from multiple surveys, one of the easiest ways to introduce an error in downstream computation in to mess up the join, search, and renaming. By having subsets, the community might try validate that the information was constructed correctly.</p><h3>Next Step — Collection</h3><p>In the next article, we’ll build the fetch class. To help key in on searches for the query, we can visit trends.google.com and use keywords from the top 100 causes of morbidity in the US. Trends will spit back the most common queries, I hope, which can be passed to Mendeley’s catalog lookup and downloaded. That’ll be the collection pipeline v1 for available medical knowledge. Time to get started!</p><p>Any tricks, tips, or want to help? Comment below or bug me on <a href="https://vincebrand.com/about">vincebrand.com/about</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7065fbc42973" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Secure Computation, A Journey I]]></title>
            <link>https://medium.com/@vallen_92604/secure-computation-a-journey-i-271c42f13590?source=rss-e6bc2973e1c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/271c42f13590</guid>
            <category><![CDATA[lambda-school]]></category>
            <category><![CDATA[secure-computation]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[encryption]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Vincent Brandon]]></dc:creator>
            <pubDate>Thu, 11 Jul 2019 17:23:39 GMT</pubDate>
            <atom:updated>2019-07-11T17:23:39.787Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YyODBbeuQ_s_9n_xfkpZUw.png" /></figure><p>Data science is a massive field. As I begin my career, there are a few toos I’d like to have under my belt. One is secure computing. In this article I explore python’s cryptography library and the use of memory-bound helpers to deliver data to a simple algorithm without ever writing a key to file or exposing the decrypted data anywhere in memory directly.</p><h3>An Operational Overview</h3><p>Get Data — Lock Data — Pass Data to Algorithm — Kill the Messenger</p><h3>Get Data</h3><p>The data exists in bulk form somewhere and is accessible somehow. Let’s assume I can authorize a ‘bot’ or in this case an instance of class ‘helper’ to pick up a limited piece of the data. Here, I simulate fetching an email address with DocumentGenerator from the essential_generators library.</p><pre>from essential_generators import DocumentGenerator</pre><pre>def genData():</pre><pre>    generator = DocumentGenerator()</pre><pre>    return generator.email()</pre><p>I am simulating a single data item for two reasons:</p><p>1. Just enough and just in time data will help prevent unencrypted data lakes (or ponds in memory of reasonable size). Any attacker would have to intercept many fetches instead of dumping a single, regularly accessed pool of memory. That pattern of regular intercepts or leaks should be easier to detect.</p><p>2. Scalability and tuning are interests of mine. I am looking forward a bit and I know I’ll need separate objects to send on jobs for parallel operations.</p><h3>Lock Data</h3><p>Each helper worker is instantiated with its own key. This prevents unencrypted data in memory.</p><pre>from cryptography.fernet import Fernet</pre><pre>def genKey():</pre><pre>    key = Fernet.generate_key()</pre><pre>    f = Fernet(key)</pre><pre>    return f</pre><p>There are a lot of cryptographic methods that have important features to consider like level of security and computational difficulty. I used the Fernet generator because it was the easiest to set up for this example. In the future, genKey should be context aware, tailoring the key algorithm to needs of the data and processing pipeline.</p><p>To give the helper a little encryption engine:</p><pre>def lockStore(self, token):</pre><pre>    self.data = self.key.encrypt(bytes(token, ‘utf-8’))</pre><p>If there’s one thing that tripped me up it’s that strings need to be converted to bytes.</p><h3>Pass Data to Algorithm</h3><p>Finally! Let’s do something with the data. First, the helper needs to decrypt what’s in its bag:</p><pre>def unlock(self):</pre><pre>    return self.key.decrypt(self.data)</pre><p>**See why I chose the Fernet key object. Someone did a lot of work for me 😊</p><p>I know I’m getting an email address. Something that is useful is parsing domains.</p><ul><li>*Remember that the decrypted string is still in bytes. I cast it back to a string to use the wonderful list methods built into python.</li></ul><pre>worker.lockStore(genData())</pre><pre>print(str(worker.unlock(), ‘utf-8’).split(‘@’)[1])</pre><p>The split will break an email at the @ and give me a list of two elements (before and after the @). I take the after bit list[1] which will have the domain and print it.</p><h3>Killing the Messenger</h3><p>There are ways of destroying an object, but they are a bit tedious. Here, the data held is destroyed when new data is loaded into the helper. That seems like an easy way to destroy a lot of helpers, just give them a nonsense term at the end of the run.</p><pre>worker.lockStore(“poop_data”)</pre><p>**poop because I hate foo and bar. They are meaningless to me. Data, even in examples, should not be meaningless in my opinion.</p><h3>Putting it all together</h3><pre>class helper():</pre><pre>    def __init__(self, key=None):</pre><pre>        if key == None:</pre><pre>            self.key = genKey()</pre><pre>            self.data = 0</pre><pre>    def lockStore(self, token):</pre><pre>        self.data = self.key.encrypt(bytes(token, ‘utf-8’))</pre><pre>    def unlock(self):</pre><pre>        return self.key.decrypt(self.data)<br></pre><pre>def genData():</pre><pre>    generator = DocumentGenerator()</pre><pre>    return generator.email()</pre><pre>def genKey():</pre><pre>    key = Fernet.generate_key()</pre><pre>    f = Fernet(key)</pre><pre>    return f</pre><pre>worker = helper()</pre><pre>for _ in range(5):</pre><pre>    worker.lockStore(genData())</pre><pre>    print(str(worker.unlock(), ‘utf-8’).split(‘@’)[1])</pre><pre>worker.lockStore(&quot;Poop_Data&quot;)</pre><p>Python is very nice. The medium code blocks aren’t. I’ll work on that…</p><p>This is a naïve first attempt! Any tips or tricks, please contact me on my <a href="https://vincebrand.com/about">about</a> page. Any comments, tips, tricks, or thoughts on which direction to move forward, please leave them!</p><p>Fine me on <a href="https://github.com/newnativeabq">github</a> or my pastel wonderkin of a <a href="https://vincebrand.com/">site</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=271c42f13590" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>