<?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 Muna Abdelrazeq on Medium]]></title>
        <description><![CDATA[Stories by Muna Abdelrazeq on Medium]]></description>
        <link>https://medium.com/@mma207?source=rss-16f3177d2c78------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*iuXNd6aVuM-nt35gf1MZEw.png</url>
            <title>Stories by Muna Abdelrazeq on Medium</title>
            <link>https://medium.com/@mma207?source=rss-16f3177d2c78------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 05:29:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mma207/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[TensorFlow: Train a Classifier ]]></title>
            <link>https://medium.com/analytics-vidhya/tensorflow-train-a-classifier-4b4608988671?source=rss-16f3177d2c78------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b4608988671</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[tensorflow]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Muna Abdelrazeq]]></dc:creator>
            <pubDate>Wed, 11 Dec 2019 19:38:19 GMT</pubDate>
            <atom:updated>2019-12-16T13:18:32.156Z</atom:updated>
            <content:encoded><![CDATA[<p>If you have been following my blogs, you know that my last blog covered the basics and types of machine learning. This blog will take a deeper dive into machine learning and go over a specific example of how to make your own classifier in TensorFlow.</p><h4>Recap:</h4><p>Supervised learning depends on the construction and use of classifiers, a function that takes in data as input and assigns a label as output.</p><ul><li>Step One: Collect Training Data, set of known inputs and outputs used to construct a classifier. At the same time, some data should be set aside as examples to later test the classifier’s accuracy.</li><li>Step Two: Train the Classifier and measure its accuracy.</li><li>Step Three: Use classifier to predict other data.</li></ul><p>We will be following along TensorFlow For Poets in order to develop a classifier that can classify flowers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oXrK3UBOymj5YFkUSXZz4A.png" /><figcaption>End Goal</figcaption></figure><h4>Step One:</h4><p>When I initially began coding along, I ran into an error when trying to load my training data</p><p>AttributeError: module ‘tensorflow’ has no attribute ‘app’.</p><p>In order to avoid this error, I changed the version of tensorflow from 1.7 to 1.13 and that did the trick.</p><pre>pip install --upgrade &quot;tensorflow==1.13.*&quot;</pre><h4>Step Two:</h4><p>The code for the lab can be accessed through github using the command below.</p><pre>git clone https://github.com/googlecodelabs/tensorflow-for-poets-2</pre><h4>Step Three:</h4><p>cd into the file and then download the training data associated with the lab using the following command.</p><pre>curl http://download.tensorflow.org/example_images/flower_photos.tgz \<br>    | tar xz -C tf_files</pre><p>This is a collection of followers (daisy, dandelion, roses, sunflowers, tulip) that will be used to train and test the classifier.</p><h4>Step Four:</h4><pre>IMAGE_SIZE=224<br>ARCHITECTURE=&quot;mobilenet_0.50_${IMAGE_SIZE}&quot;</pre><p>Run these two lines of code in order to set image resolution and size, respectively. Having a higher resolution ensures a more accurate classifier.</p><h4>Step Five:</h4><p>You can monitor the training progress using the command</p><pre>tensorboard --logdir tf_files/training_summaries &amp;</pre><p>To view, go to localhost:6008.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fHGPxbjbCPNSc9dHMexTxA.png" /><figcaption>Before Training</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dfoxxQisKoypK094YuznaQ.png" /><figcaption>After Training</figcaption></figure><p>Begin training by running</p><pre>python -m scripts.retrain \<br>  --bottleneck_dir=tf_files/bottlenecks \<br>  --model_dir=tf_files/models/&quot;${ARCHITECTURE}&quot; \<br>  --summaries_dir=tf_files/training_summaries/&quot;${ARCHITECTURE}&quot; \<br>  --output_graph=tf_files/retrained_graph.pb \<br>  --output_labels=tf_files/retrained_labels.txt \<br>  --architecture=&quot;${ARCHITECTURE}&quot; \<br>  --image_dir=tf_files/flower_photos</pre><p>This will run through all 4,000 iterations. If you would like to run through less, which can and will impact accuracy, you can limit the number of iterations by adding</p><pre>--how_many_training_steps=numberOfSteps \</pre><p>to the line immediately — bottleneck_dir=tf_files/bottlenecks \ in the above code.</p><h4>Step Six:</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FmyPdoRAlad0J2%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FmyPdoRAlad0J2%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FmyPdoRAlad0J2%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="293" frameborder="0" scrolling="no"><a href="https://medium.com/media/b159c4b44684fb97b24f99ca41bc4733/href">https://medium.com/media/b159c4b44684fb97b24f99ca41bc4733/href</a></iframe><p>Wait…</p><h4>Step Seven:</h4><p>Test your classifier!!</p><p>My classifier info for reference:</p><pre>INFO:tensorflow:Final test accuracy = 90.3% (N=362)</pre><p>Result of testing end goal image:</p><pre>Evaluation time (1-image): 0.318s</pre><pre>daisy (score=0.99227)</pre><pre>dandelion (score=0.00635)</pre><pre>sunflowers (score=0.00135)</pre><pre>roses (score=0.00003)</pre><pre>tulips (score=0.00000)</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3oz8xRF0v9WMAUVLNK%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F3oz8xRF0v9WMAUVLNK%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F3oz8xRF0v9WMAUVLNK%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="290" frameborder="0" scrolling="no"><a href="https://medium.com/media/0f8cfbdcc780d0a77b2c4365ff3d0ff4/href">https://medium.com/media/0f8cfbdcc780d0a77b2c4365ff3d0ff4/href</a></iframe><h3>Resources</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FcSKfRcEDGUs%3Ffeature%3Doembed&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DcSKfRcEDGUs&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FcSKfRcEDGUs%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/80c50b7089299fa9c8168970931c8e39/href">https://medium.com/media/80c50b7089299fa9c8168970931c8e39/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b4608988671" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/tensorflow-train-a-classifier-4b4608988671">TensorFlow: Train a Classifier 🌺</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Machine Learning ]]></title>
            <link>https://medium.datadriveninvestor.com/introduction-to-machine-learning-3be6134ac407?source=rss-16f3177d2c78------2</link>
            <guid isPermaLink="false">https://medium.com/p/3be6134ac407</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[introduction]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Muna Abdelrazeq]]></dc:creator>
            <pubDate>Fri, 29 Nov 2019 06:47:58 GMT</pubDate>
            <atom:updated>2019-12-16T05:58:11.773Z</atom:updated>
            <content:encoded><![CDATA[<p>What is machine learning? Let’s ask Google…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_dEI1bSYqLqToqg7is_wsg.png" /></figure><p>Machine learning is a subfield of artificial intelligence who’s goal is to solve many different problems using the same solution. More precisely, it is the study of algorithms that learn from examples and experiences. The three main types of machine learning are supervised, unsupervised, and reinforced learning.</p><ul><li>Supervised Learning: the algorithm consists of an outcome (dependent) variable that is to be predicted from a given set of predictors (independent variables).</li><li>Unsupervised Learning: the algorithm is used for structuring data.</li><li>Reinforced Learning: the algorithm is used to make specific decisions using trial and error.</li></ul><p>Now that we understand the general idea of machine learning, let’s take a closer look at the different types of learning and get a better understanding of what it takes to come up with algorithms.</p><h4>Supervised Learning</h4><p>This branch of machine learning depends on the construction and use of classifiers, a function that takes in data as input and assigns a label as output. Imagine you want to build a machine that could predict whether a person was inherently good or evil depending on their appearance.</p><p><strong><em>Step One: Collect Training Data</em></strong></p><p>Training data is a set of known inputs and outputs used to construct a classifier. It is important to use informative, independent, and simple features in order to ensure a more accurate classifier. At the same time, some data should be set aside as examples to later test the classifier’s accuracy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*eRaivKmsjrMHS4xMXSPB8Q.png" /></figure><p><strong><em>Step Two: Train the Classifier</em></strong></p><p>There are many different types of classifiers, one of which is the decision tree. We feed the classifier our training data and measure its accuracy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*wXWIPSEJHOx3UcGoMktwDw.png" /></figure><p>If we feel the classifier is not an accurate representation of our data, we can go back and adjust the parameters.</p><p><a href="https://www.datadriveninvestor.com/2019/02/21/best-coding-languages-to-learn-in-2019/">Best Coding Languages to Learn in 2019 | Data Driven Investor</a></p><p><strong><em>Step Three: Predict Other Data</em></strong></p><p>According to our classifier, both Batgirl and Riddler are good. If we feel good about our classifier, we can go ahead and feed our machine its algorithm.</p><h4>Unsupervised Learning</h4><p>This branch of machine learning can be further divided into two categories, clustering and auto encoding.</p><p><strong><em>Clustering</em></strong></p><p>Clustering is the act of grouping data together and can be further split into two subcategories, k-means and hierarchical.</p><p><em>K-means:</em></p><p>group data into k groups where the higher the k, the more groups and the more similar the data in the group is. While, the lower the k, the bigger the groups and the less similar the data group is.</p><p>Steps</p><ul><li>Define k centroids randomly</li><li>Assign each data point to the closest centroid cluster</li><li>Update the centroid of every cluster according to the newly added data point until the centroid stops changing/ algorithm converges</li></ul><p>K-means clustering can not be measured based on accuracy but by the the silhouette score, which measures cohesion, similarity of data points to each other in the same cluster and separation, difference between data points in different clusters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*zKE8FG5_ZXTxDU9greMoBQ.png" /></figure><p><em>Hierarchical:</em></p><p>group data in a way that the highest level has the most diversity and then the groups branch out into more specific and similar data points.</p><p>Steps</p><ul><li>Separate different data points into individual groups</li><li>Merge the groups that are most similar to each other</li><li>Continue to do this until eventually all the data points are grouped together in one large cluster.</li></ul><p>The result of hierarchical clustering can be represented by a dendrogram, depicting which are the more general clusters (ending points) that embody the more specific ones (starting points).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*8qzWSjkUsbC2s53opuwQKA.png" /></figure><h4>Auto Encoding</h4><p>A neural network that reconstructs its input to ignore signal noise broken into two processes, encoding and decoding. The success of auto encoding depends on the “loss” between the original and reconstructed data, where the less loss, the more successful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*d9VNH8_nYeORdXK7Mqr_5g.png" /></figure><h4>Reinforced Learning</h4><p>This branch of machine learning is very similar to supervised learning except that there is no training data. There are no set of labels to choose from, rather the machine has to learn from experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WqM2_ESlWJm6kJDz7f0FVg.png" /></figure><p><strong><em>Setup</em></strong></p><ul><li>Input: initial state of model</li><li>Output: there are no predetermined labels/outcomes</li><li>Training: based on the input. The user will decide to reward or punish the model based on its output.</li><li>The best solution is decided based on the maximum reward.</li></ul><p>Now that you understand the basic principles/concepts of machine learning and artificial intelligence, you can begin to conceptualize how robots work…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*2Gr8H1L8V8nszyuy8mT07w.png" /></figure><h4>References</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FcKxRvEZd3Mw%3Ffeature%3Doembed&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DcKxRvEZd3Mw&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FcKxRvEZd3Mw%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/8d134b00d11c0881bfa31a089c62e21d/href">https://medium.com/media/8d134b00d11c0881bfa31a089c62e21d/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FIUn8k5zSI6g%3Ffeature%3Doembed&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DIUn8k5zSI6g&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FIUn8k5zSI6g%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/da4e3ccf931325c2fdde8f37434a4c97/href">https://medium.com/media/da4e3ccf931325c2fdde8f37434a4c97/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FJgvyzIkgxF0%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DJgvyzIkgxF0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FJgvyzIkgxF0%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/edbf0b2058998c7b08799b50ddec3991/href">https://medium.com/media/edbf0b2058998c7b08799b50ddec3991/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fb2a0d6%3Fas_embed%3Dtrue&amp;dntp=1&amp;display_name=Upscribe&amp;url=https%3A%2F%2Fupscri.be%2Fb2a0d6%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/0707f5c806284d01a4a13c7b13a91ce3/href">https://medium.com/media/0707f5c806284d01a4a13c7b13a91ce3/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3be6134ac407" width="1" height="1" alt=""><hr><p><a href="https://medium.datadriveninvestor.com/introduction-to-machine-learning-3be6134ac407">Introduction to Machine Learning 🧠</a> was originally published in <a href="https://medium.datadriveninvestor.com/">DataDrivenInvestor</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>