<?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 Lana Dominković on Medium]]></title>
        <description><![CDATA[Stories by Lana Dominković on Medium]]></description>
        <link>https://medium.com/@lanadominkovic?source=rss-6c49a16d6f71------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*gP7uuHXO3agSXvAdlRJFDQ.jpeg</url>
            <title>Stories by Lana Dominković on Medium</title>
            <link>https://medium.com/@lanadominkovic?source=rss-6c49a16d6f71------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 02:56:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lanadominkovic/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[Stop Paying for Deep Learning Courses: Opt for This Instead]]></title>
            <link>https://lanadominkovic.medium.com/stop-paying-for-deep-learning-courses-opt-for-this-instead-d7c641639f7f?source=rss-6c49a16d6f71------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7c641639f7f</guid>
            <category><![CDATA[training-courses]]></category>
            <category><![CDATA[andrej-karpathy]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[cs231n]]></category>
            <category><![CDATA[neural-networks]]></category>
            <dc:creator><![CDATA[Lana Dominković]]></dc:creator>
            <pubDate>Mon, 18 Mar 2024 17:42:49 GMT</pubDate>
            <atom:updated>2024-03-18T17:42:49.239Z</atom:updated>
            <content:encoded><![CDATA[<h4>From Zero to Hero Without Spending a Dime</h4><p>Have you ever noticed how some courses promise to turn you into a deep learning expert, but end up only teaching how to use specific tools? While knowing these tools is useful, it’s not enough to make anyone an expert in deep learning.</p><p>A prime example of this is defining an architecture in PyTorch for MNIST data. While it’s straightforward to mimic solutions that have been replicated numerous times, the challenge arises when faced with custom data for which no pre-existing solution is available, necessitating a ground-up approach. What then?</p><blockquote><strong>CS231n to the rescue!</strong></blockquote><p><a href="http://cs231n.stanford.edu/">CS231n: Deep Learning for Computer Vision</a></p><p>There’s no need to spend money on courses that don’t deliver a deep understanding of the fundamental concepts. It’s better to seek out resources that focus on the core principles of deep learning. Here, I will highlight one such resource that prioritizes these essential concepts and that is <strong>CS231n</strong>, Stanfords’ <strong>Convolutional Neural Networks for Visual Recognition </strong>course. This course offers a deep dive into the mechanics of neural networks, prioritizing fundamental principles over framework-specific instructions.</p><p><em>For your information, my discussion will focus on the 2016 edition of the course, conducted by Andrej Karpathy. I chose this edition because I particularly enjoy Karpathy’s presentation style and found it very engaging.</em></p><p>Here’s why this course is relevant:</p><ul><li><strong>Practical Insights</strong>: Karpathy shares invaluable “recipes” for training neural networks, offering practical advice on avoiding common pitfalls and achieving optimal performance.</li><li><strong>Framework Agnosticism</strong>: The lectures focus on universal principles applicable across all deep learning frameworks, ensuring that the knowledge remains relevant even as tools evolve.</li></ul><h3>TL;DR:</h3><ol><li><strong>Start Small:</strong> Karpathy advises beginning with a tiny fraction of your data and a simple model. This approach helps in quickly identifying any initial bugs or issues without the computational expense of using the full dataset.</li><li><strong>Overfit a Single Batch</strong>: Before scaling up, make sure your model can perfectly learn a single batch of data. This step tests the model’s capacity to learn and is a good check for implementation errors.</li><li><strong>Find the Right Learning Rate</strong>: The learning rate is crucial. Too high, and the model fails to converge; too low, and training becomes painfully slow. Karpathy suggests using learning rate schedules or finders to pinpoint an optimal rate.</li><li><strong>Analyze the Model’s Predictions</strong>: By visually inspecting the model’s predictions on the training and validation sets, you can gain insights into what the model is learning and where it might be going wrong.</li><li><strong>Utilize Regularization Techniques Sparingly</strong>: Karpathy recommends starting without any form of regularization and only adding it if necessary. This ensures that the complexity of the model is increased gradually and only as needed.</li><li><strong>Hyperparameter Tuning:</strong> Once you have a model that learns, it’s time to fine-tune the hyperparameters. This includes adjusting the learning rate, batch size, and other model-specific parameters to improve performance.</li><li><strong>Keep Experimenting:</strong> The field of neural networks is still evolving, and there are no one-size-fits-all solutions. Continuously experimenting with different architectures, data augmentations, and training techniques is key to finding what works best for your specific problem.</li></ol><h3>How This Recipe Helps:</h3><p>Karpathy’s recipe demystifies the process of training neural networks. By breaking down the process into manageable, logical steps, it provides a clear pathway for anyone, regardless of their experience level. This approach not only saves time and computational resources but also offers a deeper understanding of how neural networks learn and how to troubleshoot common problems. It encourages a methodical approach to experimentation, guiding you through the complexities of neural network training with practical, actionable advice.</p><p>Iterating over above recipe will help you become the deep learning expert you always wanted to be, you will also learn framework specific and all the necessary details along the way.</p><p>This is just one of the resources I found really helpful. In the future I will try to make a detailed list of all the resources that helped me in my deep learning journey.</p><p>And remember; <em>focus on learning through action</em>. Instead of delving deep into the specifics of any single framework, choose a unique project that hasn’t been explored much. Just ensure you have the right data before starting. By actively working on your project, you’ll naturally pick up the finer points of the frameworks you’re using. CS231n offers a direct approach to beginning with neural network training, outlining what to look for and identifying potential issues.</p><h4>References</h4><ul><li>CS231n: Convolutional Neural Networks for Visual Recognition. Stanford University. [CS231n Stanford course website](<a href="http://cs231n.stanford.edu/">http://cs231n.stanford.edu/</a>)</li><li>Andrej Karpathy’s 2016 Lectures on YouTube. [CS231n 2016 lectures playlist](<a href="https://www.youtube.com/playlist?list=PLkt2uSq6rBVctENoVBg1TpCC7OQi31AlC">https://www.youtube.com/playlist?list=PLkt2uSq6rBVctENoVBg1TpCC7OQi31AlC</a>)</li><li>Recipe for training neural networks: <a href="https://karpathy.github.io/2019/04/25/recipe/">https://karpathy.github.io/2019/04/25/recipe/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7c641639f7f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Ultimate Compilation of Engineering Blogs to Enhance Your Machine Learning System Design Skills]]></title>
            <link>https://lanadominkovic.medium.com/the-ultimate-compilation-of-engineering-blogs-to-enhance-your-machine-learning-system-design-skills-d787ea13cee3?source=rss-6c49a16d6f71------2</link>
            <guid isPermaLink="false">https://medium.com/p/d787ea13cee3</guid>
            <category><![CDATA[system-design-interview]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Lana Dominković]]></dc:creator>
            <pubDate>Wed, 06 Sep 2023 07:43:27 GMT</pubDate>
            <atom:updated>2023-09-06T07:44:46.371Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*UHaJYVMQTEjUJc1grY96vQ.jpeg" /></figure><p>In the ever-evolving world of technology, continuous learning is the key. Whether you’re an aspiring software engineer, machine learning engineer, AI engineer, a seasoned system architect, or simply someone with a penchant for tech, keeping up with the latest in the world of machine learning system design is crucial.</p><p>For this very purpose, here is an exhaustive list of engineering blogs from the leading tech giants and startups. These blogs provide a wealth of knowledge, insights, and best practices that can significantly elevate your understanding of system design and more.</p><p>🔍 <strong>Dive In!</strong></p><p>Engineering at Meta — <a href="https://lnkd.in/e8tiSkEv">https://lnkd.in/e8tiSkEv</a></p><p>Google Research — <a href="https://ai.googleblog.com/">https://ai.googleblog.com/</a></p><p>Google Cloud Blog — <a href="https://lnkd.in/enNviCF8">https://lnkd.in/enNviCF8</a></p><p>AWS Architecture Blog — <a href="https://lnkd.in/eEchKJif">https://lnkd.in/eEchKJif</a></p><p>All Things Distributed — <a href="https://lnkd.in/emXaQDaS">https://lnkd.in/emXaQDaS</a></p><p>The Nextflix Tech Blog — <a href="https://lnkd.in/efPuR39b">https://lnkd.in/efPuR39b</a></p><p>LinkedIn Engineering Blog — <a href="https://lnkd.in/ehaePQth">https://lnkd.in/ehaePQth</a></p><p>Uber Engineering Blog — <a href="https://eng.uber.com/">https://eng.uber.com/</a></p><p>Engineering at Quora — <a href="https://lnkd.in/em-WkhJd">https://lnkd.in/em-WkhJd</a></p><p>Pinterest Engineering — <a href="https://lnkd.in/esBTntjq">https://lnkd.in/esBTntjq</a></p><p>Lyft Engineering Blog — <a href="https://eng.lyft.com/">https://eng.lyft.com/</a></p><p>Twitter Engineering Blog — <a href="https://lnkd.in/evMFNhEs">https://lnkd.in/evMFNhEs</a></p><p>Dropbox Engineering Blog — <a href="https://dropbox.tech/">https://dropbox.tech/</a></p><p>Spotify Engineering — <a href="https://lnkd.in/eJerVRQM">https://lnkd.in/eJerVRQM</a></p><p>Github Engineering — <a href="https://lnkd.in/eCADWt8x">https://lnkd.in/eCADWt8x</a></p><p>Instagram Engineering — <a href="https://lnkd.in/e7Gag8m5">https://lnkd.in/e7Gag8m5</a></p><p>Databricks — <a href="https://lnkd.in/eXcBj37a">https://lnkd.in/eXcBj37a</a></p><p>Canva Engineering Blog — <a href="https://canvatechblog.com/">https://canvatechblog.com/</a></p><p>Etsy Engineering — <a href="https://lnkd.in/eddzzKRt">https://lnkd.in/eddzzKRt</a></p><p>Booking.com Tech Blog — <a href="https://blog.booking.com/">https://blog.booking.com/</a></p><p>Expedia Technology — <a href="https://lnkd.in/ehjuBE5J">https://lnkd.in/ehjuBE5J</a></p><p>The Airbnb Tech Blog — <a href="https://lnkd.in/emGrJbGM">https://lnkd.in/emGrJbGM</a></p><p>Stripe Engineering Blog — <a href="https://lnkd.in/em6Svgyx">https://lnkd.in/em6Svgyx</a></p><p>Ebay Tech Blog — <a href="https://tech.ebayinc.com/">https://tech.ebayinc.com/</a></p><p>Flickr’s Tech Blog — <a href="https://code.flickr.net/">https://code.flickr.net/</a></p><p>Hubspot Product and Engineering Blog — <a href="https://lnkd.in/eRGZkBd4">https://lnkd.in/eRGZkBd4</a></p><p>Zynga Engineering — <a href="https://lnkd.in/eex5Ddry">https://lnkd.in/eex5Ddry</a></p><p>Yelp Engineering Blog — <a href="https://lnkd.in/epgBW_4J">https://lnkd.in/epgBW_4J</a></p><p>Heroku Engineering Blog — <a href="https://lnkd.in/evgctQjh">https://lnkd.in/evgctQjh</a></p><p>Discord Engineering and Design — <a href="https://lnkd.in/evY4gpUA">https://lnkd.in/evY4gpUA</a></p><p>Zomato — <a href="https://lnkd.in/e9gf3APD">https://lnkd.in/e9gf3APD</a></p><p>Hotstar — <a href="https://blog.hotstar.com/">https://blog.hotstar.com/</a></p><p>Swiggy — <a href="https://bytes.swiggy.com/">https://bytes.swiggy.com/</a></p><p>Acast Tech — <a href="https://lnkd.in/esuCEYZb">https://lnkd.in/esuCEYZb</a></p><p>ASOS Tech Blog — <a href="https://lnkd.in/esXfdv3G">https://lnkd.in/esXfdv3G</a></p><p>Shopify Engineering — <a href="https://lnkd.in/evvnqQTj">https://lnkd.in/evvnqQTj</a></p><p>Microsoft Tech Blogs — <a href="https://lnkd.in/etw_7_bN">https://lnkd.in/etw_7_bN</a></p><p>Engineering at Microsoft — <a href="https://lnkd.in/eEKz4ECi">https://lnkd.in/eEKz4ECi</a></p><p>MongoDB Engineering Blog — <a href="https://lnkd.in/e9iaqcmZ">https://lnkd.in/e9iaqcmZ</a></p><p>Slack Engineering — <a href="https://slack.engineering/">https://slack.engineering/</a></p><p>Engineering at Depop — <a href="https://lnkd.in/eGjRYcFd">https://lnkd.in/eGjRYcFd</a></p><p>SourceDiving (Cookpad’s Engineering Blog — <a href="https://sourcediving.com/">https://sourcediving.com/</a> Auto Trader Engineering Blog — <a href="https://lnkd.in/eGDKA_g3">https://lnkd.in/eGDKA_g3</a></p><p>Indeed Engineering Blog — <a href="https://lnkd.in/ecFS87Dt">https://lnkd.in/ecFS87Dt</a></p><p>Gusto Engineering Blog — <a href="https://lnkd.in/e7yVxDKs">https://lnkd.in/e7yVxDKs</a></p><p>Engineering at Birdie — <a href="https://lnkd.in/eUqJTpje">https://lnkd.in/eUqJTpje</a></p><p>Forethough Engineering — <a href="https://lnkd.in/esCKvedJ">https://lnkd.in/esCKvedJ</a></p><p>Capital One — <a href="https://lnkd.in/ezsKUf_H">https://lnkd.in/ezsKUf_H</a></p><p>Disney Streaming — <a href="https://medium.com/disney-streaming">https://lnkd.in/e4nmMdWd</a></p><h3><strong>In Conclusion</strong></h3><p>This list is a treasure trove for anyone looking to expand their knowledge in machine learning system design and engineering best practices. While it’s impossible to keep up with every single post from all these blogs, <em>pick a few</em> that resonate with your interests and keep them bookmarked. A little reading every day can go a long way!</p><p>Happy learning! 🚀</p><p>Source: <a href="https://www.linkedin.com/embed/feed/update/urn:li:share:7084922342186864640">https://www.linkedin.com/embed/feed/update/urn:li:share:7084922342186864640</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d787ea13cee3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Processing of Fantasia database with Python. Extracting ECG and respiratory rate.]]></title>
            <link>https://lanadominkovic.medium.com/processing-of-fantasia-database-with-python-extracting-ecg-and-respiratory-rate-9bd77682e3f2?source=rss-6c49a16d6f71------2</link>
            <guid isPermaLink="false">https://medium.com/p/9bd77682e3f2</guid>
            <category><![CDATA[respiration]]></category>
            <category><![CDATA[ecg]]></category>
            <category><![CDATA[fantasia]]></category>
            <category><![CDATA[ecg-derived-respiration]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Lana Dominković]]></dc:creator>
            <pubDate>Sun, 05 Mar 2023 11:05:37 GMT</pubDate>
            <atom:updated>2023-03-05T11:05:37.701Z</atom:updated>
            <content:encoded><![CDATA[<p>Fantasia database consists of twenty young and twenty elderly healthy subjects. All subjects remained in a resting state in sinus rhythm while watching the movie Fantasia (Disney, 1940) to help maintain wakefulness.</p><p>The continuous ECG signals were digitized at 250 Hz. Each heartbeat was annotated using an automated arrhythmia detection algorithm, and each beat annotation was verified by visual inspection.</p><p>Dataset can be found at: <a href="https://physionet.org/content/fantasia/1.0.0/">https://physionet.org/content/fantasia/1.0.0/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kG5FvdWj66XghadmIYIvfA.png" /><figcaption>Visualisation of ECG and respiratory signal.</figcaption></figure><p>Dataset consists or raw .ecg, .dat, .hea files which needs to be further formatted if they want to be used in any kind of analysis. For purposes of my research, which is ECG derived respiration with Deep Learning methods, I need to extract both ECG and respiratory signals. I am currently not interested in annotations as my focus is not classification task.</p><p>I am using Python so for this extraction I am going to use wfdb package (<a href="https://wfdb.readthedocs.io/en/latest/index.html">https://wfdb.readthedocs.io/en/latest/index.html</a>), a waveform-database package of tools for reading, writing, and processing WFDB signals and annotations.</p><pre>import wfdb</pre><p>To read signals from file, we are going to use <em>rdsamp (</em><a href="https://wfdb.readthedocs.io/en/latest/wfdb.html?highlight=rdsamp#wfdb.rdsamp">https://wfdb.readthedocs.io/en/latest/wfdb.html?highlight=rdsamp#wfdb.rdsamp</a><em>) </em>function from wfdb package. It reads a WFDB record, and return the physical signals and a few important descriptor fields.</p><p>To read signal coming from f1o06 participant we use following snippet which reads signal from .hea (header) file:</p><pre>data, info = wfdb.rdsamp(&quot;fantasia-database-1.0.0/f1o06&quot;) </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/374/1*jBaKTiefoRrVCt1mFmSofg.png" /><figcaption>data — extracted array of signals which we can use for further analysis, first column is ECG, second is respiratory rate</figcaption></figure><p>We can convert data to Pandas dataframe to get signals in tabular format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/374/1*XhPlBLjEAd_HImYg9B12qA.png" /><figcaption>Data showed as pandas dataframe</figcaption></figure><pre>import pandas as pd<br>df = pd.DataFrame(data, columns=info[&quot;sig_name&quot;])<br>df = df[[&quot;ECG&quot;, &quot;RESP&quot;]]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*E4rU_xVup_6bPPU4mlngHA.png" /><figcaption>info — additional information about participant</figcaption></figure><p>We can also use rdrecord to plot the signals, we use sampto parameter to cut of signal at some point to get meaningful visualisation.</p><pre>import wfdb<br>record = wfdb.rdrecord(&#39;/kaggle/input/fantasia/f1o06&#39;, sampto=2000)<br>wfdb.plot_wfdb(record=record, title=&#39;ECG and respiratory signals from f1o06 participant&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1bjqEDrMYDIDCVYdqAi3EQ.png" /><figcaption>Visualised ECG and respiratory signals</figcaption></figure><p>Final dataset in CSV format can be found here: <a href="https://www.kaggle.com/datasets/lana0038/fantasia-dataset-with-ecg-and-respiration-signals">https://www.kaggle.com/datasets/lana0038/fantasia-dataset-with-ecg-and-respiration-signals</a></p><p>Original code can be found here: <a href="https://github.com/neuropsychology/NeuroKit/blob/master/data/fantasia/download_fantasia.py">https://github.com/neuropsychology/NeuroKit/blob/master/data/fantasia/download_fantasia.py</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9bd77682e3f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Finding a most likely ancestor — Bioinformatics problem]]></title>
            <link>https://lanadominkovic.medium.com/finding-a-most-likely-ancestor-bioinformatics-problem-8be888cfae08?source=rss-6c49a16d6f71------2</link>
            <guid isPermaLink="false">https://medium.com/p/8be888cfae08</guid>
            <category><![CDATA[common-ancestor]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[bioinformatics]]></category>
            <category><![CDATA[consensus]]></category>
            <category><![CDATA[matrix-profile]]></category>
            <dc:creator><![CDATA[Lana Dominković]]></dc:creator>
            <pubDate>Sat, 20 Nov 2021 15:28:51 GMT</pubDate>
            <atom:updated>2021-11-30T17:37:43.067Z</atom:updated>
            <content:encoded><![CDATA[<h3>Finding the most likely ancestor — Bioinformatics problem</h3><p>Before we start with the topic, a little self-promotion. I started educational Youtube channel where I will be covering topics from Bioinformatics, so if you are interested, check it out and make sure to subscribe. Thanks!</p><p><a href="https://www.youtube.com/channel/UCW-DzgC7mJGPoVFz8F0W6Sw">Lantech</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FlZGCj1ovRwc%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DlZGCj1ovRwc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FlZGCj1ovRwc%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/3588a68ba7837abdbec7ebe66ce090f7/href">https://medium.com/media/3588a68ba7837abdbec7ebe66ce090f7/href</a></iframe><p><strong>Common ancestor</strong> of a set of organisms is the most recent individual from which all the organisms of the set have descended.</p><p>If we have several homologous strands of DNA, then we can find an average-case DNA strand which represent the most likely common ancestor of the given strands. This strand is called a <strong>Consensus sequence.</strong></p><p>To get the consensus sequence, first we need to form the <strong>profile matrix</strong>. <strong>Profile matrix</strong> of a collection of DNA strings is a 4×n matrix P in which Pi,j, i={A,C,G,T} represents the number of times that nucleotide <strong>i</strong> occurs in the j-th position of all the strings.</p><p>We use profile matrix to extract <strong>consensus</strong> sequence.</p><p>If we have following collection of DNA strands:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*uKIIpJC3eanYCRJKrPLCeg.png" /></figure><p>then our profile matrix looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8o9v-B3pRHYgBdY-p3rbXA.png" /><figcaption>Profile matrix of given DNA strings</figcaption></figure><p>We can calculate profile matrix using Python:</p><pre>sequences <strong>=</strong> [&quot;ATCCAGCT&quot;,<br>             &quot;GGGCAACT&quot;,<br>             &quot;ATGGATCT&quot;,<br>             &quot;AAGCAACC&quot;,<br>             &quot;TTGGAACT&quot;,<br>             &quot;ATGCCATT&quot;,<br>             &quot;ATGGCACT&quot;]<br><br>n <strong>=</strong> 8 <em># length of each sequence</em><br><br>profile_matrix <strong>=</strong> {<br>    &#39;A&#39;: [0]<strong>*</strong>n,<br>    &#39;C&#39;: [0]<strong>*</strong>n,<br>    &#39;G&#39;: [0]<strong>*</strong>n,<br>    &#39;T&#39;: [0]<strong>*</strong>n<br>    }<br><br><strong>for</strong> dna <strong>in</strong> sequences:<br>    <strong>for</strong> position, nucleotide <strong>in</strong> enumerate(dna):<br>        profile_matrix[nucleotide][position] <strong>+=</strong> 1<br>profile_matrix</pre><p>When we calculated profile matrix, we can extract consensus sequence out of it. A <strong>consensus sequence</strong> is a sequence of length n formed from profile matrix by taking the most common symbol at each position; the j-th symbol of therefore corresponds to the symbol having the maximum value in the j-th column of the profile matrix.</p><p>Of course, there may be more than one most common symbol, leading to multiple possible consensus strings.</p><p>Consensus sequence formed from previously calculated profile matrix and implementation of it using Python:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Ui9xXxlkJ0yDxWT0E_xBw.png" /><figcaption>Consensus sequence formed from previously calculated profile matrix</figcaption></figure><pre>result <strong>=</strong> [] <em># list to save nucleotide with max count from each &quot;row&quot;</em><br><br><strong>for</strong> position <strong>in</strong> range(n):<br>    max_count <strong>=</strong> 0<br>    max_nucleotide <strong>=</strong> <strong>None</strong><br>    <strong>for</strong> nucleotide <strong>in</strong> [&#39;A&#39;, &#39;C&#39;, &#39;G&#39;, &#39;T&#39;]:<br>        count <strong>=</strong> profile_matrix[nucleotide][position]<br>        <strong>if</strong> count <strong>&gt;</strong> max_count:<br>            max_count <strong>=</strong> count<br>            max_nucleotide <strong>=</strong> nucleotide<br>    result<strong>.</strong>append(max_nucleotide)<br><br>consensus <strong>=</strong> &#39;&#39;<strong>.</strong>join(result)<br>consensus</pre><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8be888cfae08" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bioinformatics 101: Reading FASTA files using Biopython]]></title>
            <link>https://lanadominkovic.medium.com/bioinformatics-101-reading-fasta-files-using-biopython-501c390c6820?source=rss-6c49a16d6f71------2</link>
            <guid isPermaLink="false">https://medium.com/p/501c390c6820</guid>
            <category><![CDATA[fasta]]></category>
            <category><![CDATA[biopython]]></category>
            <category><![CDATA[bioinformatics]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[parsing-sequence-files]]></category>
            <dc:creator><![CDATA[Lana Dominković]]></dc:creator>
            <pubDate>Sun, 17 Oct 2021 16:00:23 GMT</pubDate>
            <atom:updated>2021-10-17T16:00:23.475Z</atom:updated>
            <content:encoded><![CDATA[<p>Before we start with the topic, a little self-promotion. I started educational Youtube channel where I will be covering topics from Bioinformatics, so if you are interested, check it out and make sure to subscribe. Thanks!</p><p><a href="https://www.youtube.com/channel/UCW-DzgC7mJGPoVFz8F0W6Sw/">Lantech</a></p><h3>Introduction</h3><p>A large part of much bioinformatics work involves dealing with the many types of file formats designed to hold biological data. These files are loaded with interesting biological data, and a special challenge is parsing these files into a format so that you can manipulate them with some kind of programming language. However the task of parsing these files can be frustrated by the fact that the formats can change quite regularly, and that formats may contain small subtleties which can break even the most well designed parsers.</p><p>Here we’ll discuss in more detail the Bio.SeqIO module that aims to provide a simple interface for working with assorted sequence file formats in a uniform way. In this tutorial we are gonna work specifically with FASTA file formats, but this module can be used with any of these: <a href="https://biopython.org/docs/1.76/api/Bio.SeqIO.html#file-formats">https://biopython.org/docs/1.76/api/Bio.SeqIO.html#file-formats</a></p><h3><strong>What is FASTA file format?</strong></h3><p><strong>FASTA format</strong> is a text-based format for representing either nucleotide sequences or amino acid (protein) sequences, in which nucleotides or amino acids are represented using single-letter codes.</p><p>A sequence in FASTA format begins with a single-line description, followed by lines of sequence data. The description line is distinguished from the sequence data by a greater-than (“&gt;”) symbol in the first column. It is recommended that all lines of text be shorter than 80 characters in length.</p><p>An example sequence in FASTA format is:</p><pre><strong>&gt;Rosalind_1<br>GATTACA<br>&gt;Rosalind_2<br>TAGACCA<br>&gt;Rosalind_3<br>ATACA</strong></pre><p>The simplicity of FASTA format makes it easy to manipulate and parse sequences using text-processing tools and scripting languages like the R programming language, Python, Ruby, and Perl.</p><h3>What is Biopython?</h3><p>The Biopython Project is an international association of developers of freely available Python tools for computational molecular biology. The goal of Biopython is to make it as easy as possible to use Python for bioinformatics by creating high-quality, reusable modules and classes. Biopython features include parsers for various Bioinformatics file formats (BLAST, Clustalw, FASTA, Genbank,…), access to online services (NCBI, Expasy,…), interfaces to common and not-so-common programs (Clustalw, DSSP, MSMS…), a standard sequence class, various clustering modules, a KD tree data structure etc. and even documentation.</p><p>The main Biopython releases have lots of functionality, including:</p><ul><li>The ability to parse bioinformatics files into Python utilizable data structures, including support for the following formats:</li></ul><ol><li>Blast output — both from standalone and WWW Blast</li><li>Clustalw</li><li>FASTA</li><li>GenBank</li><li>PubMed and Medline</li><li>ExPASy files, like Enzyme and Prosite</li><li>SCOP, including ‘dom’ and ‘lin’ files</li><li>UniGene</li><li>SwissProt</li></ol><ul><li>Files in the supported formats can be iterated over record by record or indexed and accessed via a Dictionary interface.</li><li>Code to deal with popular on-line bioinformatics destinations such as:</li></ul><ol><li>NCBI — Blast, Entrez and PubMed services</li><li>ExPASy — Swiss-Prot and Prosite entries, as well as Prosite searches</li></ol><ul><li>Interfaces to common bioinformatics programs such as:</li></ul><ol><li>Standalone Blast from NCBI</li><li>Clustalw alignment program</li><li>EMBOSS command line tools</li></ol><ul><li>A standard sequence class that deals with sequences, ids on sequences, and sequence features.</li><li>Tools for performing common operations on sequences, such as translation, transcription and weight calculations.</li><li>Code to perform classification of data using k Nearest Neighbors, Naive Bayes or Support Vector Machines.</li><li>Code for dealing with alignments, including a standard way to create and deal with substitution matrices.</li><li>Code making it easy to split up parallelizable tasks into separate processes.</li><li>GUI-based programs to do basic sequence manipulations, translations, BLASTing, etc.</li><li>Extensive documentation and help with using the modules, including this file, on-line wiki documen- tation, the web site, and the mailing list.</li><li>Integration with BioSQL, a sequence database schema also supported by the BioPerl and BioJava projects.</li></ul><h3>Parsing sequence file formats with Biopython</h3><p>We’ll discuss in more detail the Bio.SeqIO module, the standard Sequence Input/Output interface for BioPython.</p><p>Bio.SeqIO provides a simple uniform interface to input and output assorted sequence file formats (including multiple sequence alignments), but will only deal with sequences as <strong>SeqRecord</strong> objects, which contain a <strong>Seq</strong> object plus annotation like an identifier and description. Note that when dealing with very large FASTA or FASTQ files, the overhead of working with all these objects can make scripts too slow. In this case consider the low-level <strong>SimpleFastaParser</strong> and <strong>FastqGeneralIterator</strong> parsers which return just a tuple of strings for each record.</p><p>The workhorse function Bio.SeqIO.parse() is used to read in sequence data as SeqRecord objects. This function expects two arguments:</p><ol><li>The first argument is a handle to read the data from, or a filename. A handle is typically a file opened for reading, but could be the output from a command line program, or data downloaded from the internet.</li><li>The second argument is a lower case string specifying sequence format — see <a href="http://biopython.org/wiki/SeqIO">http://biopython.org/wiki/SeqIO</a> for a full listing of supported formats.</li></ol><p>The Bio.SeqIO.parse() function returns an iterator which gives SeqRecord objects. Iterators are typically used in a for loop.</p><p>Sometimes you’ll find yourself dealing with files which contain only a single record. For this situation use the function Bio.SeqIO.read() which takes the same arguments. Provided there is one and only one record in the file, this is returned as a SeqRecord object. Otherwise an exception is raised.</p><p>In general Bio.SeqIO.parse() is used to read in sequence files as SeqRecord objects, and is typically used with a for loop like this:</p><pre>from Bio import SeqIO</pre><pre>for seq_record in SeqIO.parse(&quot;ls_orchid.fasta&quot;, &quot;fasta&quot;):<br>    print(seq_record.id)<br>    print(repr(seq_record.seq))<br>    print(len(seq_record))</pre><p>FASTA file: <a href="https://raw.githubusercontent.com/biopython/biopython/master/Doc/examples/ls_orchid.fasta">https://raw.githubusercontent.com/biopython/biopython/master/Doc/examples/ls_orchid.fasta</a></p><p>Another way to do this:</p><pre>from Bio import SeqIO<br><br>with open(&quot;ls_orchid.fasta&quot;) as handle:<br>    for record in SeqIO.parse(handle, &quot;fasta&quot;):<br>        print(record.id)</pre><p>In the above example, we opened the file using the built-in python function open. The with- statement makes sure that the file is properly closed after reading it. That should all happen automatically if you just use the filename instead.</p><p>The <strong>SeqRecord</strong> class itself is quite simple, and offers the following information as attributes:</p><p>.seq — The sequence itself, typically a Seq object.</p><p>.id — The primary ID used to identify the sequence — a string. In most cases this is something like an accession number.</p><h3>Reading Example with filtering by sequence length</h3><pre>from Bio import SeqIO<br><br>short_sequences = []  # Setup an empty list<br>for record in SeqIO.parse(&quot;ls_orchid.fasta&quot;, &quot;fasta&quot;):<br>    if len(record.seq) &lt; 300:<br>        # Add this record to our list<br>        short_sequences.append(record)<br><br>print(&quot;Found %i short sequences&quot; % len(short_sequences))</pre><p>However,if you are dealing with very large files with thousands of records, you could benefit from using a <strong>generator expression</strong> instead. This avoids creating the entire list of desired records in memory:</p><pre>from Bio import SeqIO<br><br>input_seq_iterator = SeqIO.parse(&quot;ls_orchid.fasta&quot;, &quot;fasta&quot;)<br>short_seq_iterator = (record for record in input_seq_iterator if len(record.seq) &lt; 300)<br><br>print(&quot;Found %i short sequences&quot; % len(short_sequences))</pre><p>That’s it. By reading FASTA file using Biopython SeqIO module and parse() function we get back SeqRecord objects which allows higher level features such as identifiers and features to be associated with a sequence, and is the basic data type for the Bio.SeqIO sequence input/output interface.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=501c390c6820" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bioinformatics 101: Finding a Motif in DNA]]></title>
            <link>https://lanadominkovic.medium.com/finding-a-motif-in-dna-a05423d81a84?source=rss-6c49a16d6f71------2</link>
            <guid isPermaLink="false">https://medium.com/p/a05423d81a84</guid>
            <category><![CDATA[motif]]></category>
            <category><![CDATA[dna]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[bioinformatics]]></category>
            <category><![CDATA[python-for-bioinformatics]]></category>
            <dc:creator><![CDATA[Lana Dominković]]></dc:creator>
            <pubDate>Sun, 03 Oct 2021 13:14:41 GMT</pubDate>
            <atom:updated>2021-10-15T21:36:14.261Z</atom:updated>
            <content:encoded><![CDATA[<p>What is a motif and how to find one in genome? Implementation in Python</p><p>Corresponding Youtube video:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FLDVg1_ExKjs%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DLDVg1_ExKjs&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FLDVg1_ExKjs%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/c716e998ef5014dc4b6bfb196b16f881/href">https://medium.com/media/c716e998ef5014dc4b6bfb196b16f881/href</a></iframe><p>Finding the same interval of DNA in the <a href="http://rosalind.info/glossary/genome/">genomes</a> of two different organisms (often taken from different species) is highly suggestive that the interval has the same function in both organisms.</p><p>We define a <a href="http://rosalind.info/glossary/motif/"><strong>motif</strong></a> as such a commonly shared interval of DNA, an interval of nucleotides (in nucleic acids) or of amino acids (in proteins) that has biological importance. The context of this importance can vary; a motif could represents an important functional unit of a protein shared by many members of the same species, or it could represent a rare gene encoding a disorder.</p><p>A common task in molecular biology is to search an organism’s <a href="http://rosalind.info/glossary/genome/">genome</a> for a known motif. In all cases, a motif will be represented by a substring of a genetic string that we wish to locate.</p><p>The situation is complicated by the fact that genomes are riddled with intervals of DNA that occur multiple times (possibly with slight modifications), called <a href="http://rosalind.info/glossary/repeat/"><strong>repeats</strong></a>. These repeats occur far more often than would be dictated by random chance, indicating that genomes are anything but random and in fact illustrate that the language of DNA must be very powerful (compare with the frequent reuse of common words in any human language).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A0gaFyAus45UwCwc0IgqpA.png" /><figcaption><strong>The human chromosomes stained with a probe for Alu elements, shown in green.</strong></figcaption></figure><p>The most common repeat in humans is the <a href="http://rosalind.info/glossary/alu-repeat/"><strong>Alu repeat</strong></a>, which is approximately 300 <a href="http://rosalind.info/glossary/base-pair/">bp</a> long and recurs around a million times throughout every human genome (see <a href="http://rosalind.info/media/problems/subs/alu.jpg"><strong>Figure 1</strong></a>). However, Alu has not been found to serve a positive purpose, and appears in fact to be parasitic: when a new Alu repeat is inserted into a genome, it frequently causes genetic disorders.</p><h3>Problem</h3><p>Given two strings s and t, t is a <strong>substring</strong> of s if t is contained as a contiguous collection of symbols in s (as a result, t must be no longer than s).</p><p>The position of a symbol in a string is the total number of symbols found to its left, including itself (e.g., the positions of all occurrences of ‘U’ in “AUGCUUCAGAAAGGUCUUACG” are 2, 5, 6, 15, 17, and 18). The symbol at position i of s is denoted by s[i].</p><p>A substring of s can be represented as s[j:k], where j and k represent the starting and ending positions of the substring in s; for example, if s = “AUGCUUCAGAAAGGUCUUACG”, then s[2:5] = “UGCU”.</p><p>The <a href="http://rosalind.info/glossary/location/"><strong>location</strong></a> of a substring s[j:k] is its beginning position j; note that t will have multiple locations in s if it occurs more than once as a substring of s</p><p><strong>Given:</strong> Two DNA strings s and t (each of length at most 1 <a href="http://rosalind.info/glossary/kbp/">kbp</a>).</p><p><strong>Return:</strong> All locations of t as a substring of s.</p><h3>Note:</h3><p>Python uses 0-based numbering, meaning, an ordered data structure is indexed (e.g., string or array) by starting with 0 instead of 1. Also, s[j:k] returns only fragment from index j up to but <em>not</em> including index k, so if s = “AUGCUUCAGAAAGGUCUUACG”, then s[2:5] = “GCU”, and not “UGCU” as example above.</p><p>If you would like to check some string basics explanations, you can find Python strings cheat sheet here: <a href="https://clana.medium.com/python-strings-cheat-sheet-afcd42376a06">https://clana.medium.com/python-strings-cheat-sheet-afcd42376a06</a> -&gt; Cheat sheet covering Python string basics. Make sure to download it and always keep it next to you while coding. It gives an overview of Strings in Python and makes coding easier.</p><p>Jupyter notebook with string basics: <a href="https://github.com/0038lana/rosalind/blob/main/motif_dna/string_basics.ipynb">https://github.com/0038lana/rosalind/blob/main/motif_dna/string_basics.ipynb</a></p><h3>Solution</h3><p>Github code: <a href="https://github.com/0038lana/rosalind/blob/main/motif_dna/find_motif.ipynb">https://github.com/0038lana/rosalind/blob/main/motif_dna/find_motif.ipynb</a></p><p>Python implementation:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2333e26dc8bc5f54407685309363be8c/href">https://medium.com/media/2333e26dc8bc5f54407685309363be8c/href</a></iframe><p>Let me know which problem you would like to be solved next.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a05423d81a84" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Strings Cheat Sheet]]></title>
            <link>https://lanadominkovic.medium.com/python-strings-cheat-sheet-afcd42376a06?source=rss-6c49a16d6f71------2</link>
            <guid isPermaLink="false">https://medium.com/p/afcd42376a06</guid>
            <category><![CDATA[python-cheat-sheet]]></category>
            <category><![CDATA[bioinformatics]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[python-strings]]></category>
            <category><![CDATA[python-for-bioinformatics]]></category>
            <dc:creator><![CDATA[Lana Dominković]]></dc:creator>
            <pubDate>Sun, 03 Oct 2021 09:28:53 GMT</pubDate>
            <atom:updated>2021-10-03T13:24:37.204Z</atom:updated>
            <content:encoded><![CDATA[<p>Python for Bioinformatics Strings Cheat Sheet</p><p>A cheat sheet covering Python string basics. Make sure to download it and always keep it next to you while coding. It gives an overview of Strings in Python and makes coding easier.</p><p>Make sure to download the PDF here for free: <a href="https://dl.orangedox.com/6zwqCuaCYrigHBRGHt">https://dl.orangedox.com/6zwqCuaCYrigHBRGHt</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZDXRAf_Ff4UoGa1fICzpjQ.png" /></figure><p>Let me know what kind of cheat sheet would be helpful to you and I will make sure that I create it for you. Hope you like it, tnx!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=afcd42376a06" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bioinformatics 101: Counting Point Mutations in DNA]]></title>
            <link>https://lanadominkovic.medium.com/rosalind-problem-counting-point-mutations-in-dna-805c2010226a?source=rss-6c49a16d6f71------2</link>
            <guid isPermaLink="false">https://medium.com/p/805c2010226a</guid>
            <category><![CDATA[computational-biology]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[rosalind]]></category>
            <category><![CDATA[bioinformatics]]></category>
            <dc:creator><![CDATA[Lana Dominković]]></dc:creator>
            <pubDate>Mon, 27 Sep 2021 11:51:21 GMT</pubDate>
            <atom:updated>2021-10-03T15:57:51.561Z</atom:updated>
            <content:encoded><![CDATA[<p>One of the problems that occurs during the replication of DNA, are mutations, and most common types are point mutations. We are going to solve Rosalind problem: Counting Point Mutations in DNA with Python.</p><p>A <strong>mutation</strong> is a mistake that occurs during the creation or copying of DNA. The simplest and most common type of nucleic acid mutation is a <strong>point mutation</strong>, which replaces one base with another at a single nucleotide. Point mutations have a variety of effects on the downstream protein product — consequences that are moderately predictable based upon the specifics of the mutation. These consequences can range from no effect (e.g. synonymous mutations) to deleterious effects (e.g. frameshift mutations), with regard to protein production, composition, and function. The rate of mutation may be increased by mutagens. Mutagens can be physical, such as radiation from UV rays, X-rays or extreme heat, or chemical (molecules that misplace base pairs or disrupt the helical shape of DNA). Mutagens associated with cancers are often studied to learn about cancer and its prevention.</p><h3>Three types of point mutation to a codon</h3><p><strong>Codon</strong> - sequence of three DNA or RNA nucleotides</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hwg4xFq8dSbYB_VL3XNO5w.png" /><figcaption>Three types of point mutation to a codon</figcaption></figure><p><strong>Silent mutations</strong> code for the same amino acid (a “synonymous substitution”). A silent mutation does not affect the functioning of the protein. A single nucleotide can change, but the new codon specifies the same amino acid, resulting in an unmutated protein. This type of change is called synonymous change since the old and new codon code for the same amino acid. This is possible because 64 codons specify only 20 amino acids. Different codons can lead to differential protein expression levels, however.</p><p><strong>Nonsense mutations</strong> include stop-gain and start-loss. Stop-gain is a mutation that results in a premature termination codon (a stop was gained), which signals the end of translation. This interruption causes the protein to be abnormally shortened. The number of amino acids lost mediates the impact on the protein’s functionality and whether it will function whatsoever. Stop-loss is a mutation in the original termination codon (a stop was lost), resulting in abnormal extension of a protein’s carboxyl terminus. Start-gain creates an AUG start codon upstream of the original start site. If the new AUG is near the original start site, in-frame within the processed transcript and downstream to a ribosomal binding site, it can be used to initiate translation. The likely effect is additional amino acids added to the amino terminus of the original protein. Frame-shift mutations are also possible in start-gain mutations, but typically do not affect translation of the original protein. Start-loss is a point mutation in a transcript’s AUG start codon, resulting in the reduction or elimination of protein production.</p><p><strong>Missense mutations</strong> code for a different amino acid. A missense mutation changes a codon so that a different protein is created, a non-synonymous change. <strong>Conservative mutations</strong> result in an amino acid change. However, the properties of the amino acid remain the same (e.g., hydrophobic, hydrophilic, etc.). At times, a change to one amino acid in the protein is not detrimental to the organism as a whole. Most proteins can withstand one or two point mutations before their function changes. <strong>Non-conservative</strong> mutations result in an amino acid change that has different properties than the wild type. The protein may lose its function, which can result in a disease in the organism. For example, sickle-cell disease is caused by a single point mutation (a missense mutation) in the beta-hemoglobin gene that converts a GAG codon into GUG, which encodes the amino acid valine rather than glutamic acid. The protein may also exhibit a “gain of function” or become activated, such is the case with the mutation changing a valine to glutamic acid in the BRAF gene; this leads to an activation of the RAF protein which causes unlimited proliferative signalling in cancer cells. These are both examples of a non-conservative (missense) mutation.</p><h3>Problem</h3><p>Given two strings <em>s</em> and <em>t</em> representing DNA sequence, calculate the number of point mutations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XyU-MKtwlD5YVcm-lJmCmA.png" /><figcaption>We can see 7 point mutations in this example</figcaption></figure><h3>Solution</h3><p>Github code: <a href="https://github.com/0038lana/rosalind/blob/main/point_mutations/point_mutations.py">https://github.com/0038lana/rosalind/blob/main/point_mutations/point_mutations.py</a></p><p>Python implementation:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/869478cc9b87b14a37fa2fa0eede80ef/href">https://medium.com/media/869478cc9b87b14a37fa2fa0eede80ef/href</a></iframe><p>Let me know if you have any questions regarding counting point mutations in DNA sequence. I am more than happy to help!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=805c2010226a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Everything you wanted to know about Udacity mentorship and how to become one?]]></title>
            <link>https://lanadominkovic.medium.com/everything-you-wanted-to-know-about-udacity-mentorship-and-how-to-become-one-12b162e095c7?source=rss-6c49a16d6f71------2</link>
            <guid isPermaLink="false">https://medium.com/p/12b162e095c7</guid>
            <category><![CDATA[jobs]]></category>
            <category><![CDATA[udacity]]></category>
            <category><![CDATA[udacity-nanodegree]]></category>
            <category><![CDATA[mentorship]]></category>
            <category><![CDATA[job-hunting]]></category>
            <dc:creator><![CDATA[Lana Dominković]]></dc:creator>
            <pubDate>Mon, 08 Feb 2021 11:42:43 GMT</pubDate>
            <atom:updated>2021-02-08T11:42:43.127Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k1t4hZhNYM6JQ08iLuAF0Q.png" /></figure><p><em>As most of you already know, Udacity is the educational organisation offering massive open online courses. Probably you also know that they provide unique experience by having a mentorship program which additionally helps students in all obstacles during their journey into graduating from Nanodegree. But did you know that you can become one of the mentors for Nanodegree which suits your background? Location doesn’t matter, it’s completely remote :)</em></p><p>Recently I decided to try to find a side job and this is how my journey as a Udacity mentor started. In this article I will go through all the details you need to do in order to become one too.</p><h3>Finding a suitable mentor position</h3><p>First things first, you should check if there is an open position for Nanodegree suitable to your background. Start by checking out open mentor positions at following link: <a href="https://www.udacity.com/jobs#mentors?location=all">https://www.udacity.com/jobs#mentors?location=all</a> Usually they hire for new, upcoming Nanodegrees as previous are already filled up with enough mentors!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-GzlYRNwMT0ydare63_VeQ.png" /><figcaption>Currently there are two open positions for mentors. Each of Nanodegree needs 15 mentors!</figcaption></figure><p>To check if there is a need for your skillset, check under <strong>required skills/qualifications.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qpdyjto3YTbNgBfD9X3J4A.png" /><figcaption>Example: Required skillset for one of the Nanodegrees</figcaption></figure><p>Apply with your up-to-date CV and wait for the response, usually it takes few days, they are really quick.</p><p><strong>NOTE:</strong><em> You can apply as a mentor for up to 3 Nanodegree at the same time. For each Nanodegree you need to follow the same steps, apply on their website first and wait for an answer, then go through Tecnical and Situational test and review the Nanodegree.</em></p><h3>Technical assessment</h3><p>If your skills match the job description you will get first assignment which is of technical nature. The objective of the Technical Test is to evaluate your technical expertise in the Nanodegree program that you have applied to mentor. This is a multiple choice quiz that contains 5 questions and you have 20 minutes to solve it. You can also expect an answer within few days.</p><h3>Situational Test</h3><p>If answer is positive, you will get a second assignment, situational test. The objective is to evaluate your conversational proficiency and your thoughtfulness while interacting with the student queries. There is a 20 minutes time restriction and contains multiple choice questions and free form questions. You can check a similar test here: <a href="https://www.assessmentday.co.uk/situational-judgement-test.htm">https://www.assessmentday.co.uk/situational-judgement-test.htm</a></p><p>Both technical and situational tests are really easy so no worries :)</p><h3>Getting certified for a project</h3><p>If you pass you can expect an access to the Nanodegree you will be mentor for. At this point you are still not accepted as a mentor. What you need to do first is to get certified, meaning you need to solve project within the Nanodegree. So first, you will get an email informing you about opportunities to be certified for. Nanodegree contains of few projects and you will get an opportunity to answer question and review project submissions for few of the them within Nanodegree. Start by solving the project you have opportunity to be certified for. This will look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z5P9ENfcZWlf25lABD__Cw.png" /><figcaption>Certification opportunities (this Nanodegree contains of 3 projects overall, but there are only opportunities to be certified for 2 of them)</figcaption></figure><p>You should submit the project and be within the first 15 ones to solve it correctly, otherwise you will be put on the waiting list.</p><p>At the same time you will also get the access to the content. It is possible that when you are assigned a certification opportunity the content of Nanodegree is not uploaded yet, so you only have access to project task. When content is uploaded you will also get an email saying that you will need to review the content of Nanodegree as well.</p><p>Keep in mind that this last step takes some time. For me, the first Nanodegree I applied for took 3 months before I was certified. There is a lot of reviews and providing feedback of the content. It’s time consuming a bit, but in the end worth it.</p><p>Additionaly, if you are applying to be a mentor for the first time, you are also expected to pass additional Nanodegree: <strong>Udacity Mentorship</strong> where you will tackle everything related to being mentor on Udacity platform.</p><p>When everything above is solved, project reviewed and passed, Nanodegree reviewed and feeback provided, and Udacity Mentorship Nanodegree passed you will officialy become a mentor. Congrats! :)</p><h3>Payment</h3><p>As related to the payment, you are paid per question you are assigned to answer, and per project review you are assigned to review. Answering a questions is usually <em>5</em>$, and reviewing a project submission is <em>11.25</em>$. You will need to open a Payoneer account: <a href="https://www.payoneer.com/german/">https://www.payoneer.com/</a>.</p><p>This is everything you need to know regarding the application process for Udacity mentor. Let me know if there are still some things you are interested in and I will update the content of this article. Thank you.</p><p>Please also leave claps and follow me if this helped you! :)</p><p><em>This is not an advertisement for Udacity jobs, it’s my personal experience and guide for those who are interested in becoming a mentor as I had hard time understanding the process and steps that need to be done in order to become one. Hope this helps! Let me know if comments if you are planning to apply and wether this guide helped you in the whole process.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=12b162e095c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Model evaluation metrics in Machine Learning]]></title>
            <link>https://lanadominkovic.medium.com/model-evaluation-metrics-in-machine-learning-711c50df20de?source=rss-6c49a16d6f71------2</link>
            <guid isPermaLink="false">https://medium.com/p/711c50df20de</guid>
            <category><![CDATA[regression]]></category>
            <category><![CDATA[confusion-matrix]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[classification]]></category>
            <category><![CDATA[model-evaluation]]></category>
            <dc:creator><![CDATA[Lana Dominković]]></dc:creator>
            <pubDate>Mon, 11 Jan 2021 18:35:06 GMT</pubDate>
            <atom:updated>2021-01-11T18:46:01.865Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article we are going to focus on two questions:</p><ol><li>How well our model is doing? (We are going to learn metrics which will tell us if the model is good or not.)</li><li>How do we improve the model based on these metrics?</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4pkuuiCRgkGCkOXH.png" /></figure><p>Let’s look at one real-world scenario and compare it to a problem in Machine Learning. Let’s say that our car is broken (problem), and in order to fix it we need some tool (algorithms). But how do we know which tool is best to use in order to fix the car? For that we have a bunch of measurement tools and we use them to evaluate which tool (algorithm) will fix the car in the best possible way (i.e. which algorithm will perform best). So, once we evaluate algorithms and parameters and decide which ones are the best for our problem, then we go ahead and solve our problem.</p><p>In this article we are going to focus on measurement tools, we are going to go through some of the measurement tools and techniques which will tell us when an algorithm is working well with the data and how to tweak them to work best for our problem.</p><p>If we are fitting our model to predict categorical data (spam not spam), there are different measures to understand how well our model is performing than if we are predicting numeric values (the price of a home).</p><p>Before we start with metrics used in classification and regression problems, let’s see what <strong><em>confusion matrix</em></strong> is.</p><h3>Confusion matrix</h3><p>Confusion matrix describes the performance of the classification model, and it is represented as following table (it stores the following values: <strong>True Positives</strong>, <strong>False Negatives</strong>, <strong>False Positives</strong> and <strong>True Negatives</strong>):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/0*W4Snstm6SuN0GtHh.png" /></figure><ul><li>True Positive: an outcome where the model <strong><em>correctly</em></strong> predicts the <strong><em>positive</em></strong> class as <strong><em>positive</em></strong>.</li><li>False Negative: an outcome where the model <strong><em>incorrectly</em></strong> predicts the <strong><em>positive</em></strong> class as <strong><em>negative</em></strong>.</li><li>False Positive: an outcome where the model <strong><em>incorrectly</em></strong> predicts the <strong><em>negative</em></strong> class as <strong>positive</strong>.</li><li>True Negative: an outcome where the model <strong><em>correctly</em></strong> predicts the <strong><em>negative</em></strong> class as <strong><em>negative</em></strong>.</li></ul><p><strong>Classification Metrics</strong></p><h3>- Accuracy</h3><p>Accuracy is often used to compare models, as it tells us the proportion of observations we correctly labeled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/0*N-IZs--jKbLAnDYY.png" /></figure><p>Accuracy is not always the best metrics to us and often is not the only metric we should be optimising on. This is especially the case when you have class imbalance in your data. Optimising on only accuracy can be misleading in how well your model is truly performing.</p><h3>- Precision</h3><p>Precision focuses on the <strong>predicted</strong> “positive” values in our dataset. It is an answer to the following question: Out of all points predicted to be positive, how many of them are actually positive? By optimising based on precision values, we are determining if we are doing a good job of predicting the positive values, as compared to predicting negative values as positive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/0*yAtP4lE2OXF2tvnc.png" /></figure><h3>- Recall (Sensitivity)</h3><p>Recall focuses on the <strong>actual</strong> “positive” values in our dataset. It is an answer to the following question: Out of the points that are labeled positive, how many of them are correctly predicted as positive? By optimising based on recall values, we are determining if we are doing a good job of predicting the positive values <strong>without</strong> regard of how we are doing on the <strong>actual</strong>negative values. If we want to perform something similar to recall on the <strong>actual</strong> ‘negative’ values, this is called specificity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/0*H59QjD9FsLpHetyj.png" /></figure><p>In order to look at a combination of metrics at the same time, there are some common techniques like the F-Beta Score (where the F1 score is frequently used), as well as the ROC.</p><h3>- F-Beta Score</h3><p>F-Beta Score is the weighted score of Precision and Recall. It is defined as the following equation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/297/0*xMhqrDT9dgjfIRhG.png" /></figure><p>As we can see in the formula, this score takes both false positives and false negatives into account. The <strong>β</strong> parameter controls the degree to which precision is weighed into the F score, which allows Precision and Recall to be considered at the same time. The most common value for β is 1, as this is where we can find the <strong><em>harmonic average</em></strong> between precision and recall, and is closer to the smallest between Precision and Recall. So, if one of them is particularly low, F-1 Score kind of “<em>raises the flag”</em>, while <strong><em>average</em></strong> says if one of them is good, but other one is bad the average will be “<em>okay”</em>.</p><p>Intuitively, F-Beta Score is not as easy to understand as accuracy, but it is usually more useful than accuracy, especially if you have an uneven class distribution. Accuracy works best if false positives and false negatives have similar cost. If the cost of false positives and false negatives are very different, it’s better to look at both Precision and Recall.</p><h3>- ROC Curve (Receiver Operating Characteristics Curve)</h3><p>ROC Curve is one of the most important evaluation metrics for checking any classification model’s performance. I am not going to go through it as it is explained very well in the following article: <a href="https://towardsdatascience.com/understanding-auc-roc-curve-68b2303cc9c5">Explanation of the ROC Curve</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4uPFRSniEOlAb2sw.png" /></figure><h3>Regression Metrics</h3><p>If we want to measure how well ouralgorithms are performing on predicting numeric values, then there are three main metrics that are frequently used. <strong>M<em>ean Absolute Error</em></strong>, <strong><em>Mean Squared Error</em></strong>, and <strong><em>R2</em>Score</strong>.</p><h3>- Mean Absolute Error (MAE)</h3><p>Mean Absolute Error is an average value of the absolute errors. It is a useful metric to optimise on when the value you are trying to predict follows a skewed distribution. Optimising on an absolute value is particularly helpful in these cases because outliers will not influence models attempting to optimise on this metric as much as if you use the mean squared error.</p><p>But the MAE has a problem, which is that the absolute value function is not differentiable so we can’t use this metrics in algorithms which use Gradient Descend methods. To solve this problem, we use the more common metrics, mean squared error.</p><h3>- Mean Squared Error (MSE)</h3><p>Mean Squared Error measures the average value of the squares of the errors and is by far the most used metric for optimisation in regression problems. Similar to with MAE, we want to find a model that minimises this value. This metric can be greatly impacted by skewed distributions and outliers. When a model is considered optimal via MAE, but not for MSE, it is useful to keep this in mind. In many cases, it is easier to actually optimize on MSE, as the a quadratic term is differentiable.</p><h3>- R2 Score</h3><p>Finally, the R2 Score is another common metric when looking at regression values. Optimising a model to have the lowest MSE will also optimise a model to have the the highest R2 score. This is a convenient feature of this metric. The R2 score is frequently interpreted as the “amount of variability” captured by a model. Therefore, you can think of MSE, as the average amount you miss by across all the points, and the R2 value as the amount of the variability in the points that you capture with a model.</p><p>R2 Score is based on comparing our model to the simplest possible model. Let’s assume we got our model with linear regression. The simplest possible model that fits a bunch of data is if we take the average of all the values and draw a horizontal line through them. If we calculate the MSE for simpler model, we would hope that it’s larger than the MSE of the linear regression model. The question is how much larger? To answer this question let’s look at the following picture:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*w5sTsoT7BZo_HcE6.png" /></figure><p>We divide the error of linear regression model by the error for simpler model, and subtract the result from 1. This gives us our R2 value. If our model is <strong>bad</strong>, the errors from both model should be similar and the quantity marked in the image should be close to 1, therefore, R2 value should be close to 0. If our model is <strong>good</strong> the error for linear regression model should be a lot smaller than the error for the simpler model, which means that the quantity marker in the picture should be close to 0, and our R2 value should be close to 1.</p><p><em>To conclude, if the R2 score is close to 1 then our model is good and if it is close to 0, our model is bad.</em></p><p>As an additional note, optimizing on the MAE may lead to a different “best model” than if we optimise on the MSE. However, optimizing on the MSE will <strong>always</strong> lead to the same “best” model as if you were to optimise on the <strong>R2</strong> score.</p><p>This article was based on the lectures from Udacity’s course which helped me understand these metrics better. I hope it will be helpful to you as it was to me.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=711c50df20de" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>