<?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 Lorna Maria A on Medium]]></title>
        <description><![CDATA[Stories by Lorna Maria A on Medium]]></description>
        <link>https://medium.com/@lornamariak?source=rss-fcc02f105a85------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*1sBjs4bjIZZVZfKKZ9k8uQ.jpeg</url>
            <title>Stories by Lorna Maria A on Medium</title>
            <link>https://medium.com/@lornamariak?source=rss-fcc02f105a85------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 15 May 2026 16:10:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lornamariak/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[Easing your way into new topics with a learning plan.]]></title>
            <link>https://medium.com/@lornamariak/easing-your-way-into-new-topics-with-a-learning-plan-8e1ba45dd7d?source=rss-fcc02f105a85------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e1ba45dd7d</guid>
            <category><![CDATA[career-development]]></category>
            <category><![CDATA[life]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[education]]></category>
            <dc:creator><![CDATA[Lorna Maria A]]></dc:creator>
            <pubDate>Sun, 30 Jun 2019 13:40:08 GMT</pubDate>
            <atom:updated>2019-06-30T13:43:27.918Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vWQDCdjuK-NsF9wTbWr4kQ.png" /></figure><p>One of my goals for the second half of the year is to help as many people to get a grip on their learning goals for 2019. Throughout my YouTube series Learning with Lorna, I have shared the first step to the learning process, making a learning plan.</p><p>In the video, I am highlighting what the learning plan looks like, why you need one and the major components of the learning plan.</p><p>The article below is the blog version of the video so if you’re interested in the video to go ahead and watch it <a href="https://www.youtube.com/watch?v=xw5uGxuhiaM">here</a> and if prefer reading, use this article to guide you.</p><h4>Key points about a learning plan</h4><p>A learning plan is a document that lays out learning prospects over time. When one takes interest in a topic/skill and intends to start learning it, it is important to draft a plan that fits within their schedule to elaborate on how they will pursue this new-found interest. A learning plan is not a timetable.</p><p>The plan takes in your learning goals and helps you map out the steps, actions and resources needed to meet them and the evidence that you need to measure success.</p><h4>Section 1</h4><p>Name: Fill in your name or the name of the person you’re preparing this for.</p><p>Date: Fill in the intended learning period e.g 19th June 2019 to 19th July 2019</p><h4>Section 2</h4><p>This section is a personal introspective centred on helping you discover what you want to meet from this learning process.</p><p>Vision: What do you envision yourself achieving by learning this topic/skill?</p><p>Expected outcomes: What impact do you want to make by learning this? (centre this on yourself)</p><h4>Section 3</h4><h4>Topics</h4><p>General topic: Fill in the major topics and break them down into manageable sub-topics, if possible break it down further to fill the sub-specific topics. This will help you have a precise definition of what you’re trying to learn.</p><h4>Learning Aids</h4><p>In order to maximise your learning goals, you need to take advantage of the resources available to help you learn better. These include tutorials, articles, podcasts, books etc. It is essential for you to map these out ahead of your learning journey and go ahead to insert references to specific resources if you have already found them.</p><p>This saves a lot of time when you start your learning process and helps you focus more on learning than trying to find resources.</p><h4>Time frame</h4><p>Fill in the days and hours you’re dedicating to each sub topic: being specific to the hours will help you know how many hours you cumulatively dedicated to the learning which is a metric of accountability.</p><h4>Place</h4><p>A great learning environment contributes to the learning process. Depending on what you’re learning and what type of learner you’re, you have to choose your environment carefully and prepare it in advance to avoid distractions and save time.</p><p>Find out what type of learner you’re <a href="https://personalitymax.com/learning-styles-test/">here</a>.</p><h4>Expected Outcomes</h4><p>For a successful learning process, your goals should be measurable. In the outcomes, set simple actions you can fulfil after each topic learned. These can include taking a quiz, presenting to fellow learners among others. These will cumulatively be a way to measure the success of your learning process.</p><h4>Notes</h4><p>A space reserved for any comments about the process you have mapped out. You can use it for budgeting your learning process, evaluating how much you need to successfully set aside to buy resources, fund your movements etc. and compare with any available alternatives. The goal is to keep your learning process affordable.</p><p>Use this <a href="https://docs.google.com/spreadsheets/d/1L0yf_PhRLj0HYDk-DrDryf2W36Vlm4RBgXFZd4Zh0VQ/edit#gid=1710806421">link </a>to download a learning plan template of the format described in this article. Feel free to give me feedback on your own use case of the template.</p><p>Follow me on <a href="https://mobile.twitter.com/lornamariak">Twitter</a> and <a href="https://www.instagram.com/alornamaria/">Instagram</a> and subscribe to my <a href="https://www.youtube.com/channel/UCrvp8p_ONLjR25hzCz18sWA?view_as=subscriber">YouTube</a> to follow the Learning with Lorna series. I am happy to hear more people learning something new and challenging themselves further.</p><p>Happy learning! 😻</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e1ba45dd7d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A data science newbie’s guide through SQL.]]></title>
            <link>https://medium.com/@lornamariak/a-data-science-newbies-guide-through-sql-316de66561ec?source=rss-fcc02f105a85------2</link>
            <guid isPermaLink="false">https://medium.com/p/316de66561ec</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[postgresql]]></category>
            <dc:creator><![CDATA[Lorna Maria A]]></dc:creator>
            <pubDate>Thu, 30 May 2019 13:59:52 GMT</pubDate>
            <atom:updated>2019-05-30T13:59:52.858Z</atom:updated>
            <content:encoded><![CDATA[<h4>Chapter Four — Select and Alter</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*sPs17JeofCKernhxJQ621Q.png" /></figure><p>In chapter 4 of the SQL series, we shall look at the two SQL statements that will commonly be used when writing SQL from a data science perspective.</p><h4>Importing sample data into the database</h4><p>In order to show how these statements work we need to have sample data in our database. Using this <a href="https://sds-platform-private.s3-us-east-2.amazonaws.com/uploads/P9-ConsoleGames.csv">link</a>, download and import this csv file into your database:</p><p>Start your server &gt; open pgAdmin&gt; go to your database &gt; create a table: console_games &gt; add the columns with their column names in the csv and the corresponding data types &gt; right-click on the table&gt; import/export&gt;toggle to import, add csv, add delimiter “,”&gt;click ok.</p><p>Your imported data should look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZKXKfG-QFHR15SKjLsT1YQ.png" /><figcaption>Dataset is from <a href="https://www.superdatascience.com/">https://www.superdatascience.com/</a></figcaption></figure><p>Please note that the csv is imported without the column names.</p><p>Read more about data types in PostgreSQL 👉🏾 <a href="http://www.postgresqltutorial.com/postgresql-data-types/">here</a></p><h3>SELECT statement</h3><p>This is a statement used to “return” or “select” records from one or more database tables. From a data science perspective, select will be the most commonly used SQL statement because it answers questions about data sets. It returns a set of records defined by the parameters parsed/passed in it. In order to retrieve data, one must know the ins and outs of the select statement.</p><p>Let us break it down below:</p><h4>Main clauses</h4><p>SELECT: the opening clause specifies the columns selected.</p><p>FROM: this specifies the table(s) to be selected from.</p><h4>Optional Clauses</h4><p>These clauses apply different constraints on the rows. There are many optional clauses but the popular ones include:</p><p>WHERE: this specifies the rows selected / conditions parsed<br>ORDER BY: this specifies the order to show the returned rows<br>GROUP BY: this groups rows that share a property satisfied by a function<br>HAVING: this selects rows that have a specified parsed condition</p><h4>SELECT syntax</h4><pre>SELECT column1, column2, …<br> FROM  table_name<br> WHERE condition<br> HAVING condition<br> GROUP BY column_name<br> ORDER BY column_name</pre><h4>SELECT examples</h4><p>From our imported dataset, let us answer some questions about the dataset.</p><p><em>From the pgAdmin main menu select Tools &gt; Query Tool and open a new Query Editor window to run these queries.</em></p><p>Q1: Return all columns where the Name is “Tetris”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eb7jUS_b59uW6tlBdWYqSw.png" /></figure><p>Q2: Order the table by the highest North America sales (NA_sales)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lAGpgsECDQvCLv8oPcSJHg.png" /></figure><p>Q4: Show a list of top 20 publishers by their total sales(show the sales).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RlujHCSJbw83w8LG5cgREw.png" /></figure><p>Q5: Show a list of games and genres published by Microsoft Games Studio in 2010</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wCdrHPRW_qiWIIBwzfFrkg.png" /></figure><h4>JOINS</h4><p>A join in SQL is a statement that creates a set of records by joining columns from one or more tables with a common value and this is exported as a table.</p><p>Understanding more about joins 👉🏾<a href="https://www.techonthenet.com/postgresql/joins.php">here</a></p><h4>ALTER statement</h4><p>The Alter statement makes changes in an already existing record in a database. From a data science perspective, the alter statement is useful during data cleaning as it helps add, update or delete records. The alter keyword is <strong>ALTER</strong>.</p><p>We shall try using ALTER in the next chapter as we clean a data set.</p><h4>Conclusion</h4><p>Congrats, today you have done much more practical work and that takes much energy.👏🏾</p><p>Thank you so much for catching up with chapter 4 of the SQL series, the basics ins and outs are starting to get together and for the next chapter, we shall start to work on more industry-specific examples doing data cleaning and analysis with SQL.</p><p>Feel free to share with me feedback by leaving a clap, comment or tweeting me <a href="http://twitter/kalmpublication">@kalmpublication</a> or <a href="http://twitter/lornamariak">@lornamariak</a></p><p>Catch up with previous chapters here: <a href="https://medium.com/lornamariak/a-data-science-newbies-guide-through-sql-1ea5d4967444">1</a>, <a href="https://medium.com/lornamariak/a-data-science-newbies-guide-through-sql-c4ca3335c3ef">2</a>, <a href="https://medium.com/lornamariak/a-data-science-newbies-guide-through-sql-1a138aaebb7d">3</a></p><p>Happy Learning!😻</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=316de66561ec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A data science newbie’s guide through SQL.]]></title>
            <link>https://medium.com/@lornamariak/a-data-science-newbies-guide-through-sql-1a138aaebb7d?source=rss-fcc02f105a85------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a138aaebb7d</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Lorna Maria A]]></dc:creator>
            <pubDate>Tue, 21 May 2019 21:04:48 GMT</pubDate>
            <atom:updated>2019-05-30T14:03:48.698Z</atom:updated>
            <content:encoded><![CDATA[<h4>Chapter three— Creating tables in SQL</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*hkc0hlTPZSPtXeap5geblw.png" /></figure><p>It is finally time to start writing statements. In chapter 3 of the SQL series, we shall look deeper into the rules around writing SQL and we shall write our first statements.</p><h4>Syntax and semantics of SQL</h4><p>Like any other programming language, SQL has its rules and styles of writing that we shall need to know these as we start writing statements.</p><p>Here are resources that will guide you:</p><p><strong>SQL syntax and semantics guide </strong>👉🏾<a href="https://www.pubtracksda.com/analytics/olh/l_en/sql_syntax_semantics.htm">Here</a></p><p><strong>SQL data types</strong> 👉🏾<a href="https://www.essentialsql.com/commonly-used-sql-server-data-types/">Here</a></p><p><strong>SQL Keywords</strong> 👉🏾 <a href="https://www.w3schools.com/sql/sql_ref_keywords.asp">Here</a></p><p><strong>Keep in mind, practice makes perfect. So let&#39;s dive in!</strong></p><h3>Create a table in your database:</h3><p>This is the generic code structure to create a table.</p><pre> CREATE TABLE <em>table_name </em>(<br><em> column1 datatype[(size)][column level constraints]</em>,<br><em> column2 datatype</em>,<br><em> column3 datatype</em>,</pre><pre> CONSTRAINT table_name_constraint CONSTRAINT TYPE (column_name)<br>); </pre><p>From last week&#39;s exercise <a href="https://medium.com/lornamariak/a-data-science-newbies-guide-through-sql-c4ca3335c3ef">here</a>, let us create the table in the task. I envisioned my table to look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YS1WQmKjkoV2We-O6-5Nhw.png" /></figure><p>There are two ways to create this table;</p><p>using the terminal (psql)it can be created with this code;</p><pre>CREATE TABLE name_table<br>(<br>   name &quot;char&quot;,<br>   age integer,<br>   fav_number<br>)</pre><p>using pgAdmin: Ensure that your server is connected.</p><p>pgAdmin&gt;Servers&gt;Databases &gt; database name&gt; Schemas&gt; public&gt; Tables&gt; right click and select create, fill in the column names, constraints and finish.</p><p><strong>Constraints</strong>: When a table is created we are able to parse rules that will apply to either a column or the table these are called <em>constraints</em>. For example, the primary key commonly known as pk, table constraint that sets a column as the primary key or the not null column constraint that ensures that this column is never left blank.</p><p>There are about 7 commonly used constraints in SQL and you can read more about them <a href="https://www.w3schools.com/sql/sql_constraints.asp">here</a>.</p><p>From the above example, let&#39;s make column <em>name</em> the <em>primary key</em> and ensure <em>none of the columns is left blank</em>.</p><pre>CREATE TABLE name_table<br>(<br>   name &quot;char&quot; NOT NULL,<br>   age integer NOT NULL,<br>   fav_number integer NOT NULL,<br>   CONSTRAINT name_table_pkey PRIMARY KEY (name)<br>)</pre><h4>Creating a table using another table</h4><p>As a data scientist, it is very important to know table inheritance because it comes in hand when you need to use another table&#39;s columns to carry out a test. This means you can use parts of an existing table without working/altering that table.</p><pre>CREATE TABLE <em>new_table_name</em> AS<br> SELECT <em>column1, column2,</em><br> FROM <em>existing_table_name</em><br> WHERE (condition);</pre><p>We shall look more of this when we start to <em>SELECT.</em></p><h3>Inserting values into an SQL table</h3><p>If not already inserted there is an SQl statement to insert values in a table.</p><pre>INSERT INTO name_table(name,<em> age</em>,<em> fav_number</em>)<br>VALUES (<em>value1</em>,<em> value2</em>,<em> value3</em>);</pre><pre>-- Alternatively if inserting in all columns </pre><pre>INSERT INTO name_table<br>VALUES (<em>value1</em>,<em> value2</em>,<em> value3</em>);</pre><p>Alternatively using the GUI(pgAdmin) can go as far as allowing one to import a csv file although you have to take caution, the data should be clean especially at the data type level to ease the import.</p><p>This is a very crucial observation as a data scientist because you need to understand what data types will make your work easier in SQL so that your data cleaning process can match that.</p><h4>Conclusion</h4><p>Congrats, you have your database ready to query!👏🏾 Go ahead, try to insert about 10 values. (Remember, you don’t have to get it right, you’re just practising.)</p><p>Thank you so much for catching up with chapter 3 of the SQL series, next week shall start to write queries.</p><p>Feel free to share with me feedback by leaving a clap, comment or tweeting me <a href="http://twitter/kalmpublication">@kalmpublication</a> or <a href="http://twitter/lornamariak">@lornamariak</a></p><p>Catch up with previous chapters here: <a href="https://medium.com/lornamariak/a-data-science-newbies-guide-through-sql-1ea5d4967444">1</a>, <a href="https://medium.com/lornamariak/a-data-science-newbies-guide-through-sql-c4ca3335c3ef">2</a>,</p><p>Happy Learning!😻</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a138aaebb7d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A data science newbie’s guide through SQL.]]></title>
            <link>https://medium.com/@lornamariak/a-data-science-newbies-guide-through-sql-c4ca3335c3ef?source=rss-fcc02f105a85------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4ca3335c3ef</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Lorna Maria A]]></dc:creator>
            <pubDate>Tue, 14 May 2019 16:06:00 GMT</pubDate>
            <atom:updated>2019-05-14T16:06:00.959Z</atom:updated>
            <content:encoded><![CDATA[<h4>Chapter two — Installing a database management software</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*Kf1YBiUGN5LDX2CpqaCSeg.png" /></figure><p>Last week in SQL series <a href="https://medium.com/lornamariak/a-data-science-newbies-guide-through-sql-1ea5d4967444">chapter 1</a>, I introduced SQL and in this week’s chapter 2 we shall go through installing a database management software that will enable us to practice SQL queries in the coming weeks.</p><p>In this article, I shall provide a list of useful links to detailed installation guides of all software we shall need.</p><h4>Database Management software (DBMS)</h4><p>To be able to use SQL we shall need to create databases for practice, similarly, in production, these are databases where data is already stored. In order for us to create, view and manage databases, we shall use database management software. A DBMS is a program for creating and managing databases.</p><p>The choice of the DBMS defers from company to company depending on preference, resources available and infrastructure.</p><p>Check out this <a href="https://www.softwaretestinghelp.com/database-management-software/">list</a> of the 30 most popular DBMS of April 2019.</p><h4>PostgreSQL and pgAdmin</h4><p>In our learning series, we are going to use PostgreSQL as out DBMS and pgAdmin as an interface for our PostgreSQL server.</p><p>Feel free to install any other server interface you might be interested in discovering.</p><h4>Installation</h4><p>Choose the installation guide that applies to the operating system you’re using to follow the SQL series.</p><p><strong>PostgreSQL / pgAdmin for Mac users</strong>: <a href="https://www.codementor.io/engineerapart/getting-started-with-postgresql-on-mac-osx-are8jcopb#i-introduction">Getting Started with PostgreSQL on Mac OSX </a>by Patrick Sears</p><p><strong>PostgreSQL / pgAdmin for windows users</strong>:<a href="https://www.youtube.com/watch?v=e1MwsT5FJRQ"> How to Install PostgreSQL &amp; pgAdmin 4 on Windows 10</a> by ProgrammingKnowledge</p><p>About PostgreSQL: <a href="https://www.postgresql.org/">https://www.postgresql.org/</a></p><p>About pgAdmin: <a href="https://www.pgadmin.org/">https://www.pgadmin.org/</a></p><h4>Practice Exercise</h4><p>Congrats on following through this far!👏🏾 You are now ready to create your first database. Go ahead, try to create a table with the following columns: Name, Age, favourite number. (Remember, you don’t have to get it right, you’re just practising.)</p><p>Thank you so much for catching up with chapter 2 of the SQL series, next week shall start writing SQL statements.</p><p>Feel free to share with me feedback by leaving a clap, comment or tweeting me <a href="http://twitter/kalmpublication">@kalmpublication</a> or <a href="http://twitter/lornamariak">@lornamariak</a></p><p>Happy Learning!😻</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4ca3335c3ef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A data science newbie's guide through SQL.]]></title>
            <link>https://medium.com/@lornamariak/a-data-science-newbies-guide-through-sql-1ea5d4967444?source=rss-fcc02f105a85------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ea5d4967444</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Lorna Maria A]]></dc:creator>
            <pubDate>Tue, 07 May 2019 19:46:28 GMT</pubDate>
            <atom:updated>2019-05-07T19:51:36.206Z</atom:updated>
            <content:encoded><![CDATA[<h4>Chapter One — Introduction to SQL</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*tOO-O7EOFSHeEZGiUSHD-A.png" /></figure><p>SQL — Structured Query Language.</p><p>Choose your pronunciation: Sequel or Ess-que-el</p><h4>What is SQL?</h4><p>SQL is a programming language designed to manage data stored in relational databases. Relational databases are a type of database that holds records in tables with a series of keys linking each table to another. The data is structured and therefore SQL handles altering, retrieving and sometimes manipulation of structured data.</p><p>This, however, is not where the structured in SQL is derived. Structured is derived from the syntax/format of clauses in the SQL.</p><h4>Where is SQL used?</h4><p>Today SQL is widely used in many web frameworks and database applications. It is a highly sort after querying language because of its ease of use and logistical optimisation in the face of large databases.</p><p>Its ability to query many data points and return results in a short time is impressive.</p><h4>How is SQL used in data science</h4><p>As a data scientist, the process begins with obtaining data to be analysed, this data is stored in a database or a sheet. Most modern system architectures include structured databases and require the use of SQL to comb out the data you would like to analyze.</p><p>SQL is used to retrieve data from a database as specified(through queries) and can be used to store data too(creation of tables).</p><p>SQL is used to manipulate data with inbuilt functions that can do simple overall manipulation in the querying process.</p><p>SQL enables you to run tests by allowing you to create and destroy test tables.</p><p>As a data scientist having the SQL knowledge gives you an upper hand into understanding how to store and retrieve data in relational databases.</p><p>Most companies have adopted RDMS and knowledge of SQL to be able to retrieve data of your interest from a company database before analysing it.</p><h4>What do data scientists think about SQL?</h4><p>I asked two data scientists that use SQL what they think and here is what they had to say:</p><blockquote>I love SQL because even if data is updated, I can re-run the same script without no worries, says <a href="https://mobile.twitter.com/Shel_Kariuki">Shel Kariuki</a></blockquote><blockquote><a href="https://medium.com/u/15fb73ffb472">Oreoluwa Ogundipe</a> says Knowing the data you need to analyse is very key but furthermore being able to query it in the best/fastest way possible that meets your needs gives you a greater edge. Unlike tools where you have to create computed dimensions which do not represent how your data is stored, with SQL, you can query your data straight away and then filter your responses as you consider fit</blockquote><p>Thank you so much for catching up with chapter 1 of the SQL series, next week I will share about preparing yourself and your computer as a data science newbie to start writing SQL.</p><p>Feel free to share with me feedback by leaving a clap, comment or tweeting me @kalmpublication or @lornamariak</p><p>Happy Learning!😍</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ea5d4967444" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Meet-up lessons: From starting a meet-up and envisioning a community.]]></title>
            <link>https://medium.com/@lornamariak/meet-up-lessons-from-starting-a-meet-up-and-envisioning-a-community-5601a64c5258?source=rss-fcc02f105a85------2</link>
            <guid isPermaLink="false">https://medium.com/p/5601a64c5258</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[community]]></category>
            <category><![CDATA[meetup]]></category>
            <dc:creator><![CDATA[Lorna Maria A]]></dc:creator>
            <pubDate>Tue, 07 May 2019 15:19:55 GMT</pubDate>
            <atom:updated>2019-08-23T09:27:21.176Z</atom:updated>
            <content:encoded><![CDATA[<h3>Starting a meet-up and envisioning a community.</h3><h4>An organizer’s perspective on running a meet-up group with a vision to scale into a community.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LYFvfmes3uTBaDoqV6dQdg.jpeg" /><figcaption>Photo credit:<a href="https://www.pexels.com/@divinetechygirl"> Christina Morillo</a></figcaption></figure><h4>Background</h4><p>For close to 5 years now I have been part of many tech communities like Women techmakers, Google developer groups and recently R user groups. While at the university I learnt a lot through community involvement more than any other extracurricular club. I loved the sense of togetherness and I equally enjoyed organising events and facilitating workshops on technologies I was conversant with.</p><p>Fast forward to 2018, It had been almost a year after school and I had started working in a data science-related field, I decided to revive my community days by hosting a monthly ladies’ meet-up to introduce different data science tools. My employer then supported the idea and this even made it more exciting. I was able to host the meet-up consistently for about 7 months.</p><h4>Running the data ladies community</h4><p>When starting a community we usually have this long vision of seeing it evolve into a huge impactful part of the domain it belongs to; in this case, it was the data science community, and I hope to eventually grow it into a self-sustaining project.</p><p>Community building involves technical and non-technical elements.</p><p>When I started running data ladies I focused majorly on developing the technical skills of women interested in data science but I soon realised that it grew into something consistent and I needed to scale into a full-blown data science community. Did I? <a href="https://medium.com/lornamariak/a-2018-review-learning-and-life-ffcc737dac52">my year review</a> can answer this!</p><h4>Here are some of the lessons I learnt.</h4><h4>Core skills and codependency</h4><p>The focus on core/beginner skills in the data science field gave me a great starting advantage of nurturing participants from day one and later it became easy to introduce other much harder skills like machine learning. Every community has participants with different experience levels, focus on making these groups codependent.</p><p>It is great to have the novice group learn from the intermediate and advanced groups, the intermediate group is great at being learning facilitator for the novice group while working along the advanced and expert groups , the expert group is great at guiding and facilitating workshops for beginners and working alongside advanced group are great at coming up with learning material for the novice and intermediate groups. The expert group can always take up interns/volunteers from any group.</p><p>This will be an automated mentorship model in your community.</p><h4>Knowing your community members</h4><p>When you run consistent meet-ups you will start to see a number of members that keep showing up, build relations with these people, talk to them and start to involve them in the community, sometimes the creativity you need to hire to do something will be just among your people so pay attention.</p><p>This will also make leadership an easy transition in the community. Most communities I have been part of never had democratically elected leaders, most leadership was through volunteering and giving back to the community. Knowing my community members I was always ready to find who can work best in which place.</p><h4>All learning must be fun and safe</h4><p>No matter what topic or tool you decide to tackle, make the learning environment as fun as possible keeping in mind that community guidelines must be clear to everyone and followed religiously regardless of who they apply to. While communities are fun and free, they may also turn hostile if not governed by a certain level of rules.</p><h4>Funding: Partnership, sponsorships and scholarships.</h4><p>Most communities start while relying on external funding. It is very important to reach out to as many people or companies as possible and fine tune every partnership to also benefit the targeted sponsors. don’t make your proposals sound self-centred, be strategic.</p><p>Funding doesn&#39;t only come in terms of money, some people will give you space, a projector, snacks, photography, influencing, promo codes etc, take advantage of these to make your events great.</p><p>Always give your sponsors and supporting people feedback and a thank you note.</p><h4>Consistency and Visibility</h4><p>It is important to keep up with a pattern of events and if possible make a calendar and share with the community in advance. Be sure to also share your work especially on the meet-up social media or blog/website and urge your participants to share their growth too.</p><p>Growth will highly depend on feedback and follow-up and you can use a number of creative tools to collect feedback other that forms. Check out <a href="http://kahoot.com">Kahoot </a>and <a href="http://menti.com">mentimeter</a>. This will show you areas to improve, topics to rerun among other metrics.</p><p>Looking back at all these lessons I learned, I wished I had more time to spend with my data ladies group and even work hard to grow it further. However, I have noticed that two groups in the same niche have sprung up; <a href="https://mobile.twitter.com/Rladieskampala">R Ladies Kampala</a> and <a href="https://mobile.twitter.com/WiMLDS_Kampala">Women in Machine learning and data science Kampala </a>chapter.</p><p>I hope this article enlightens one thing or two for anyone looking at starting a learning group/community online or offline.</p><p>Feel free to drop any feedback to <a href="https://medium.com/u/fcc02f105a85">Lorna Maria A</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5601a64c5258" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A 2018 Review: Learning and Life.]]></title>
            <link>https://medium.com/@lornamariak/a-2018-review-learning-and-life-ffcc737dac52?source=rss-fcc02f105a85------2</link>
            <guid isPermaLink="false">https://medium.com/p/ffcc737dac52</guid>
            <category><![CDATA[life-lessons]]></category>
            <category><![CDATA[2018]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Lorna Maria A]]></dc:creator>
            <pubDate>Sun, 23 Dec 2018 11:20:08 GMT</pubDate>
            <atom:updated>2018-12-23T11:20:08.248Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*acCPT8zV21e0N7f3XnskBw.png" /><figcaption>A 360 of 2018 moments</figcaption></figure><blockquote><strong>“ I don’t see a utopia anywhere for me.” ~Bozoma Saint John</strong></blockquote><p>I cannot believe that 2018 has come to an end! Just like many years of my adult life, this one started off with lots of projections and goals. Today I want to take off time and share three aspects of my life that I felt can help someone reading this.</p><h3>Career and Learning</h3><p>I started off this year at the entry level of my career. Although I had past working experiences around the building of developer communities, I had picked up a keen interest in data science and the year began with me deciding to have a full-time data science career. I used as many learning methods as possible to help me grasp skills that would put me on the job market real quick. Thanks to the R stats community, I realised that <strong><em>I had to learn and write</em></strong>. This made me more creative, gave me the zeal to learn more concepts and the feedback was so encouraging. This is by far an all-around method that not only helped me learn quickly but also helped me showcase my skills and that’s where my entry to the industry began.</p><h4>What is it like to be a data scientist in the industry?</h4><p>I often get this question a lot especially when people find out what I do versus my job title. I will mention that being a data scientist in the industry is sometimes not a mentioned task, sometimes no one at your workplace even calls you a data [insert all those cool titles] but it is your responsibility to show your team that data exists and can be incorporated in decision making. My past 3 months at my new workplace have taught me a million lessons about being a data scientist in the field that none of the blogs on the internet ever did.</p><p>So if you ask what it is like to be in the industry, it is tough, more than python and R and all those fancy words in the tech and data industry, it is research, asking the right questions and formulating the right comparisons. Soon you realise that models are not the hardest thing but how to formulate the right models.</p><h4>Close and switch.</h4><p>Often times friends ask me, why don’t you do tech communities anymore, you should do one more event or which one is the next event/ community you’re organising?</p><p>Well after close to four years of being a community organiser, I rediscovered myself. I must appreciate that it is through community organising that I discovered my true strengths and passions. I worked with promoting the use of different technologies, inclusion and diversity in tech and when 2018 came, I decided that I would go out and practice a part of me that I had discovered about two years ago.</p><p>It is okay to quit that original thing that everyone thinks you should stick to and go after that thing that you think will help you make a difference in the world. I love to watch communities grow, mentor people into the whole culture but also not forgetting to work on my true self. <strong><em>I think the wave is beautiful to ride but don’t forget yourself in that ride.</em></strong></p><h3>Life and relocating.</h3><p>If you had told me at the beginning of this year that I would not spend the most important holidays with my family I would have said, well unless I am on Mars.</p><p>I made a bold decision to move into my own apartment because of numerous reasons but autonomy was top of the list. If you have grown up in a community where personal space is not really a thing you always wonder what it feels like. Well, self-reliance is as challenging as possible but every challenge is a lesson for years to come.</p><p>During this year, I had a chance to relocate(bucket list ticked). I enjoyed fitting my entire life in complimentary checked in luggage and starting all over but one big lesson that I learnt from this is <strong><em>it is never too late to start learning again.</em></strong></p><p>Cultural shock, weather changes, language barrier are all things that can take a toll on you while relocating. Be aware and protect your sanity in that phase because things will go wrong and you will have to keep calm.</p><p>But amidst all this I have really grown into a responsible human being, I am more aware of my surrounding, I plan and budget and I can account for everything I do. I manage my time and all this comes from constant self-training.</p><h3>Take time off and alone time.</h3><p>I used to think holiday/vacation was just a fancy thing but guess what, I found out that it is instead a healthy thing to do. For your health, sanity and well being if not for your muscles, take time off and switch off the work. I took two holidays this year, both were a week long and they gave me a great rest, peace of mind and the best two weeks of 2018.</p><p>The activities of this year were taking a toll on me and everything was happening so fast, I was stressed, angry and feisty. One little thing would go wrong and I would lose my mind. The air around me was tense and negative but taking time off and crying, ranting and reading just helped transform this energy into something positive. <strong><em>Life is not all roses remember.</em></strong></p><p>Not only did I enjoy the beautiful sights, but I also rediscovered myself and set my priorities, I learnt how to read a map(not google maps), talked to strangers, took beautiful pictures and spent time with beautiful people.</p><h3>Hello 2019</h3><p>2019 is my year to finally confront my bigger fears. I look forward to taking a very bold career step that will probably leave a mark on me for the next ten years. I also plan to start worrying less about things I cannot control and not to mention taking the matters of my diet and exercise routine into my own hands. I keep promising myself a better body but this time I am more than willing to give myself a better body.</p><p>Cheers, share with me your learning and life goals.</p><p><strong><em>Happy new 2019 to all of us!</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ffcc737dac52" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Get Started With Examples of Reactivity in Shiny apps.]]></title>
            <link>https://medium.com/data-science/get-started-with-examples-of-reactivity-in-in-shiny-apps-db409079dd11?source=rss-fcc02f105a85------2</link>
            <guid isPermaLink="false">https://medium.com/p/db409079dd11</guid>
            <category><![CDATA[shiny]]></category>
            <category><![CDATA[rstats]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Lorna Maria A]]></dc:creator>
            <pubDate>Tue, 06 Mar 2018 20:42:12 GMT</pubDate>
            <atom:updated>2018-03-07T16:58:52.239Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LezNz1WCj3h9yuX1XUynOA.jpeg" /><figcaption>Photo Credit : <a href="https://pixabay.com/en/background-christmas-3009949/">Pixabay</a></figcaption></figure><h3>Introduction</h3><p>One of the things that makes shiny apps interactive is reactivity. In the simplest of terms reactivity/reactive programming is the ability of a program to compute outputs from a given set of user inputs. The ability of a shiny app to handle reactivity makes a two-way communication between the user and the existing information.</p><p>Reactivity is applied in cases such as performing calculations, data manipulation, the collection of user information among other scenarios.</p><p>As a beginner setting out to build shiny apps, having the basic knowledge to handle reactivity will help you go a long way to exploring different use cases of shiny apps.</p><h3>Let’s get started</h3><p>The idea of reactivity will not occur to one until the error message below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VgAmq1yuakrCK2reLbuCng.png" /><figcaption>error message</figcaption></figure><p>This error occurs when a reactive component is placed inside a non reactive function. The app will not load and will parse this error. Let’s us look at what a reactive function is and what it does.</p><h3>Reactive Components of a shiny app</h3><p>There are three major reactive components of a shiny app:</p><h4><strong>Reactive Inputs</strong></h4><p>A<strong> </strong>reactive input is defined as an input that a user provides through the browser interface. For example when a user fills a form,selects an item or clicks a button. These actions will trigger values to be set form the reactive inputs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*hT9JQQqjq__Xp6g0tIPoUQ.png" /><figcaption>Text input and Add button are reactive inputs</figcaption></figure><h4>Reactive Outputs</h4><p>A reactive output is defined as program provided output in the browser interface. For example a graph, a map, a plot or a table of values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*M3XW_QSHyCtX4BXWF0ZEsw.png" /><figcaption>Table of values as a reactive output</figcaption></figure><h4>Reactive Expressions</h4><p>A reactive expression is defined as one that transforms the reactive inputs to reactive outputs.These perform computations before sending reactive outputs.These will also mask slow operations like reading data from a server, making network calls among other scenarios.We shall see one in our example.</p><h3>Example</h3><p>Let’s start with a simple example of adding up two integers and returning their sum in a shiny app.</p><h4>ui</h4><pre>titlePanel(&quot;Sum of two integers&quot;),<br>  <br>  #number input form<br>  sidebarLayout(<br>    sidebarPanel(<br>      textInput(&quot;one&quot;, &quot;First Integer&quot;),<br>      textInput(&quot;two&quot;, &quot;Second Integer&quot;),<br>      actionButton(&quot;add&quot;, &quot;Add&quot;)<br>    ),<br>    <br>    # Show result<br>    mainPanel(<br>      <br>   textOutput(&quot;sum&quot;)<br>      <br>    )</pre><h4>server</h4><pre>server &lt;- function(input,output,session) {</pre><pre>#observe the add click and perform a reactive expression<br>  observeEvent( input$add,{<br>    x &lt;- as.numeric(input$one)<br>    y &lt;- as.numeric(input$two)<br>    #reactive expression<br>    n &lt;- x+y<br>    output$sum &lt;- renderPrint(n)<br>  }<br>    <br>  )</pre><h4>Result</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*Z2UPro-d4jPxdrBp4RkMeg.png" /><figcaption>Example</figcaption></figure><h3>Demo</h3><p>Now let’s build something a bit complex while handling reactivity.</p><h4>ui</h4><pre>fields &lt;- c(&quot;name&quot;,&quot;age&quot;,&quot;height&quot;,&quot;weight&quot;)<br>ui &lt;- fluidPage(<br>   <br>   # Application title<br>   titlePanel(&quot;Health card&quot;),<br>   <br>   # Sidebar with reactive inputs<br>   sidebarLayout(<br>      sidebarPanel(<br>         textInput(&quot;name&quot;,&quot;Your Name&quot;),<br>        selectInput(&quot;age&quot;,&quot;Age bracket&quot;,c(&quot;18-25&quot;,&quot;25-45&quot;,&quot;above 45&quot;)),<br>         textInput(&quot;weight&quot;,&quot;Please enter your weight in kg&quot;),<br>         textInput(&quot;height&quot;,&quot;Please enter your height in cm&quot;),<br>         actionButton(&quot;save&quot;,&quot;Add&quot;)<br>        <br>      ),<br>      <br>      # a table of reactive outputs<br>      mainPanel(<br>         mainPanel(<br>            <br>            DT::dataTableOutput(&quot;responses&quot;, width = 500), tags$hr()<br>            <br>         )<br>      )<br>   )<br>)</pre><h4>server</h4><pre># Define server logic <br>   server &lt;- function(input, output,session) {<br>      </pre><pre>#create a data frame called responses<br>      saveData &lt;- function(data) {<br>         data &lt;- as.data.frame(t(data))<br>         if (exists(&quot;responses&quot;)) {<br>            responses &lt;&lt;- rbind(responses, data)<br>         } else {<br>            responses &lt;&lt;- data<br>         }<br>      }<br>      <br>      loadData &lt;- function() {<br>         if (exists(&quot;responses&quot;)) {<br>            responses<br>         }<br>      }<br>      <br>      <br>      # Whenever a field is filled, aggregate all form data<br>      #formData is a reactive function</pre><pre>      formData &lt;- reactive({<br>         data &lt;- sapply(fields, function(x) input[[x]])<br>         data<br>      })<br>      <br>      # When the Save button is clicked, save the form data<br>      observeEvent(input$save, {<br>         saveData(formData())<br>      })<br>      <br>      # Show the previous responses<br>      # (update with current response when save is clicked)<br>      output$responses &lt;- DT::renderDataTable({<br>         input$save<br>         loadData()<br>      })     <br>   }</pre><h4>Result</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nr_jHuuZuAdvZH3o7UfAwQ.png" /><figcaption>When project is run.</figcaption></figure><p>Project Demo: <a href="https://rstudio.cloud/project/22236">https://rstudio.cloud/project/22236</a></p><p>There you go! Now that you can handle the basics, please go ahead and try it out.Feel free to share and ask me questions or give feedback on twitter <a href="https://twitter.com/lornamariak">@lornamariak</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db409079dd11" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/get-started-with-examples-of-reactivity-in-in-shiny-apps-db409079dd11">Get Started With Examples of Reactivity in Shiny apps.</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting Up Twitter for Text mining in R.]]></title>
            <link>https://medium.com/data-science/setting-up-twitter-for-text-mining-in-r-bcfc5ba910f4?source=rss-fcc02f105a85------2</link>
            <guid isPermaLink="false">https://medium.com/p/bcfc5ba910f4</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[twitter]]></category>
            <category><![CDATA[rstats]]></category>
            <category><![CDATA[data-mining]]></category>
            <category><![CDATA[twitter-data]]></category>
            <dc:creator><![CDATA[Lorna Maria A]]></dc:creator>
            <pubDate>Mon, 05 Feb 2018 14:00:56 GMT</pubDate>
            <atom:updated>2018-02-10T13:36:33.215Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y1SxH-0q0NpSZDIyPLwSpg.jpeg" /><figcaption>Photo Credit : <a href="https://pixabay.com/en/twitter-line-power-line-sit-2713571/">Pixabay</a></figcaption></figure><h4>Introduction</h4><p>Over the years, social media has become a hot spot for data mining. Every day there are always topics trending, campaigns running and groups of people discussing different global, continental or national issues.This is a major target to harness data.</p><p>In this article, we focus on Twitter as a centre of opinions and sentiments across the globe.We set out to mine text from the millions of tweets that go out every day to be able to understand what is going on all even beyond our own timelines.</p><h4>Twitter API Set Up</h4><p>To use the twitter API we need to have a twitter account. <br>Sign Up via <a href="https://twitter.com">https://twitter.com</a> ,go to <a href="https://apps.twitter.com/">https://apps.twitter.com/</a> to access twitter developer options.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UcvlcwBTh3Ubes8lpqf8tQ.png" /><figcaption>Click create New App</figcaption></figure><p>Create a new application</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k932jZDx08KhBdzSKMipFg.png" /></figure><p><strong>Application Name:</strong> Give your app a unique name. if it is taken you will be notified to change.<br><strong>Application site: </strong>This can be a link to your Github repository where the application code will be if your app has no site yet. (like mine)<br><strong>Call back URL:</strong> This is a link to which a success or failure message is relayed from one program to another.It tells the program on where to go next in both cases.You can direct your application to any port available, mine is port 1410.</p><h4>App Credentials</h4><p>These are very important to help one log into the application.<br>There are four major credentials used in this set up.<br><strong>Consumer key :</strong> This key identifies the client to the application.<br><strong> Consumer Secret:</strong> This is the clients password that is used with server authentication.<br><strong>Access Token:</strong>This is the consumer identification that is used to define their privileges. <br><strong>Access Secret:</strong>This is sent with the access token as a password.&lt;/li&gt;<br>They are obtained this way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rHaEis4CDOpGzmmgfRc-Og.png" /><figcaption>App credentials</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XxhAH8uq-g-f5tOW2r4Wlw.png" /><figcaption>Generating Tokens</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ez9X57oj2Igt0oxb1Qjf7g.png" /><figcaption>App Tokens</figcaption></figure><p><strong>Note : T</strong>hese credentials are meant to be kept private,that is why i shaded through mine.<br>Voila! We have an API set up</p><h4>R Studio Set Up</h4><p>R uses the <strong>twitteR</strong> library, an R based Twitter client that handles communication with the Twitter API. Let us take a moment and thank <strong>Jeff Gentry</strong> for putting this library together.</p><p>Now go ahead and install the library using the code below.</p><pre>#from CRAN<br>install.packages(“twitteR”)</pre><pre>#alternatively from the Github<br>library(devtools)<br>install_github(“geoffjentry/twitteR”)</pre><p>The difference between the two methods above is that the first method downloads the package from the CRAN site and will take the argument of a package name while the second will install packages from the GitHub repository and will take an argument of the repository name. Read more about packages and installation <a href="https://www.datacamp.com/community/tutorials/r-packages-guide">here</a>.</p><h4>AUTHENTICATION</h4><p>Twitter uses Open Authentication (OAuth) to grant access to the information. Open Authentication is a token based authentication method.Let’s refer to our four credentials.</p><p><strong>Step 1</strong></p><pre>#load library<br>library(twitteR)</pre><pre>#load credentials<br>consumer_key &lt;- “****************”<br>consumer_secret&lt;- “*******************”<br>access_token &lt;- “*******************”<br>access_secret &lt;- “************************”<br></pre><p><strong>Step 2</strong></p><p>We use the <strong>setup_twitter_oauth</strong> function to set up our authentication.The <strong>setup_twitter_oauth()</strong> function takes in the four twitter credentials that we generated from the API set up above.</p><pre><br>#set up to authenticate<br>setup_twitter_oauth(consumer_key ,consumer_secret,access_token ,access_secret)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/371/1*q7-TeToUNiHVtUFSim9_BQ.png" /></figure><p>Go ahead and authorise direct authentication by pressing Y on our keyboard.</p><h4>Querying Twitter</h4><p>To query is to simply ask a question. To be able to access the data we need, we have to send meaningful queries to twitter. With Twitter, we have access to tons of information from trends to campaigns to accounts. We have a range of things to query.<br>Let us run query on this hashtag #rstats</p><pre>#fetch tweets associated with that hashtag , 12 tweets-n in <br>#(en)glish-lang since the indicated date yy/mm/dd</pre><pre>tweets &lt;- twitteR::searchTwitter(“#rstats”,n =12,lang =”en”,since = ‘2018–01–01’)</pre><pre>#strip retweets<br>strip_retweets(tweets)</pre><p>This code returns the tweets as a list.The <strong>strip_retweets()</strong> function eliminates any retweets in the returned tweets.</p><p>For further analyse these tweets we shall consider converting the returned tweets to a data frame and store them locally .</p><pre>#convert to data frame using the twListtoDF function<br>df &lt;- twListToDF(tweets)\#extract the data frame save it locally<br>saveRDS(df, file=”tweets.rds”)<br>df1 &lt;- readRDS(“mytweets.rds”)</pre><h4>Cleaning the Tweets</h4><p>From the query, we have managed to store the results into a data frame on our computers.Now let us examine this data to find out whoever has the highest Retweets and give them a shoutout straight from our script.<br>We shall use the <strong>dplyr </strong>library to traverse through this data frame.</p><pre><br>library(dplyr)</pre><pre>#clean up any duplicate tweets from the data frame using #dplyr::distinct</pre><pre>dplyr::distinct(df1)</pre><p>Let us make use of dplyr verbs to select the tweet,screenname,id and retweet count for a tweet with the most retweets and store the result in a data frame called winner.</p><pre>winner &lt;-df1 %&gt;% select(text,retweetCount,screenName,id )%&gt;% filter(retweetCount == max(retweetCount))<br>View(winner)</pre><p>Check out more on <strong>dplyr</strong> via this <a href="https://www.rstudio.com/wp-content/uploads/2015/02/data-wrangling-cheatsheet.pdf">cheat sheet</a>.</p><h4>Sending a Direct Message</h4><p>To notify our retweet competition winner ,we shall send them a direct message from this script by picking their handle from the winner data frame.<br>The <strong>dmsend() </strong>function takes in the message and username which is saved as the screenName.</p><pre>us &lt;- userFactory$new(screenName= winner$screenName)<br>dmSend(“Thank you for participating in #rstats,Your tweet had the highest retweets” , us$screenName)</pre><h4>Conclusion</h4><p>We have just created our first mined dataset from twitter and used it to find out our retweet competition winner. Well, that is just a small example of what we can do, however, there is a column that contains text from the mined tweets which can be analysed using techniques from the previous articles from on this <a href="https://medium.com/@lornamariak">blog</a>.</p><p>There are more possibilities with this mined data like sentiment analysis and word frequency visualisations.<br>I suggest you check out a live example of twitter text mining via this GitHub <a href="https://github.com/lornamariak/TextMinningR">repository</a>.<br>For any further questions and comments about this article ask me <a href="http://twitter.com/lornamariak">@lornamariak</a> via twitter. <br>Happy Tweet Mining!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bcfc5ba910f4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/setting-up-twitter-for-text-mining-in-r-bcfc5ba910f4">Setting Up Twitter for Text mining in R.</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring Sentiment Analysis]]></title>
            <link>https://medium.com/swlh/exploring-sentiment-analysis-a6b53b026131?source=rss-fcc02f105a85------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6b53b026131</guid>
            <category><![CDATA[r]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[rstats]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[text-mining]]></category>
            <dc:creator><![CDATA[Lorna Maria A]]></dc:creator>
            <pubDate>Fri, 19 Jan 2018 13:51:17 GMT</pubDate>
            <atom:updated>2018-01-23T17:55:46.345Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NK1aoSh9jUgMOJz9YHqYSg.jpeg" /><figcaption>Photo credit : <a href="https://pixabay.com/en/display-dummy-board-face-technology-915135/">Pixabay</a></figcaption></figure><h4>Understanding Text mining - Part 2</h4><h4>Introduction</h4><p>This article is part 2 of Understanding Text Mining.If you just landed here, Part 1 is available <a href="https://medium.com/@rblog/understanding-and-writing-your-first-text-mining-script-with-r-c74a7efbe30f">here</a>.</p><p>One of the applications of text mining is sentiment analysis.In order for us to go ahead and carry out a sentiment analysis of our mined text,we are required to clean and prepare our data set as we saw in Part 1.</p><h4>Understanding Sentiment Analysis</h4><p>Sentiment Analysis:The study of extracted information to identify reactions, attitudes, context and emotions.As one of the applications of text mining, sentiment analysis exposes the attitudes in the mined text.</p><p>It is based on word polarities, it takes into account positive or negative words and neutral words are dismissed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/299/1*mZ3CGBeP2wV6UlAsybuslw.png" /><figcaption>Table showing word polarity examples</figcaption></figure><p>Sentiment analysis is done based on lexicons. A lexicon in simpler terms is a vocabulary , say the English lexicon.In this context, a lexicon is a selection of words with the two polarities that can be used as a metric in sentiment analysis.</p><p>There are many different types of lexicons that can be used depending on the context of the data you are working with.There is also a possibility of creating a custom lexicon depending on how much customisation we would like to make with your data.</p><p>In this article,we shall make use of the <a href="https://cran.r-project.org/web/packages/syuzhet/vignettes/syuzhet-vignette.html"><strong>syuzhet</strong></a> package.While there are a number of packages for sentiment analysis on CRAN,the syuzhet package is great to learn with because it is a combination of the most common lexicons like<strong> nrc</strong>, <strong>bing</strong> and <strong>afinn</strong>.</p><p>We also make use of <a href="https://www.rstudio.com/wp-content/uploads/2015/03/ggplot2-cheatsheet.pdf"><strong>ggplot2</strong></a> to further visualise our results from the sentiment analysis.</p><h4>How does Sentiment analysis work?</h4><p>In simple terms,sentiment analysis is performed as an intersection of a term-document (built from the mined text ) and a lexicon of choice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*ZFx_0mWqK6eiWgFVLCFv1w.png" /><figcaption>The first step is to have a term-document and a lexicon of your choice.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/481/1*xdZJYulcufsdrnheJKNSuw.png" /><figcaption>Then form an intersection between the two sets.</figcaption></figure><h4>Hands-on with Sentiment analysis</h4><p><strong>Example one </strong>: This is a simple example where we extract emotions from a sentence.We load the sentence,split each word using the strsplit() function to form a character vector and use the get_nrc_sentiment() function from the syuzhet library.This function takes in new_sentence and compares it with the nrc emotion lexicon to return the scores as shown below.</p><pre>library(syuzhet)</pre><pre>sentence &lt;- &quot;i love cats such a bundle of joy.&quot;<br>new_sentence &lt;- as.character(strsplit(sentence,&quot; &quot;))</pre><pre>get_nrc_sentiment(new_sentence)</pre><pre>#This is the output</pre><pre>anger anticipation disgust fear joy sadness surprise trust negative<br>   0          0       0    0   2       0        0     0        0<br>positive<br>     2</pre><p><strong>Example two:</strong> This second example makes use of a TED talks data set that was downloaded from<a href="https://www.kaggle.com/rounakbanik/ted-talks/data"> Kaggle </a>under the name <strong>transcript.csv</strong>.It underwent cleaning using the <strong>tm package</strong> following the steps in part 1 of this article and was carried forward for sentiment analysis in this part 2.</p><pre>#load the libraries<br>library(syuzhet)<br>library(tm)<br>library(ggplot2)</pre><pre>#mydataCopy is a term document,generated from cleaning #transcripts.csv </pre><pre>mydataCopy &lt;- mydata</pre><pre>#carryout sentiment mining using the <strong>get_nrc_sentiment()</strong>function #log the findings under a variable <strong>result</strong></pre><pre>result &lt;- get_nrc_sentiment(as.character(mydataCopy))</pre><pre>#change result from a list to a data frame and transpose it </pre><pre>result1&lt;-data.frame(t(result))</pre><pre>#rowSums computes column sums across rows for each level of a #grouping variable.</pre><pre>new_result &lt;- data.frame(rowSums(result1))</pre><pre>#name rows and columns of the dataframe</pre><pre>names(new_result)[1] &lt;- &quot;count&quot;<br>new_result &lt;- cbind(&quot;sentiment&quot; = rownames(new_result), new_result)<br>rownames(new_result) &lt;- NULL</pre><pre>#plot the first 8 rows,the distinct emotions<br>qplot(sentiment, data=new_result[1:8,], weight=count, geom=&quot;bar&quot;,fill=sentiment)+ggtitle(&quot;TedTalk Sentiments&quot;)</pre><pre><br>#plot the last 2 rows ,positive and negative<br>qplot(sentiment, data=new_result[9:10,], weight=count, geom=&quot;bar&quot;,fill=sentiment)+ggtitle(&quot;TedTalk Sentiments&quot;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*UbgLyCypbkA3vZkSJ_Y75w.png" /><figcaption>Plot 1: Shows distinct emotions</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*RFb0zNeq8VcXYtpL_Dt6Kw.png" /><figcaption>Plot 2: Shows the combination of emotions under two polarities.</figcaption></figure><p>The code from this example can be accessed from this <a href="https://github.com/lornamariak/Sentiment-Analysis">repository</a>.</p><h4>Conclusion</h4><p>We have applied our sentiment analysis tricks on mined text to come up with an evident description of the emotions attached to text data.</p><p>This could be a whole project that can help you gain insights on how and when to talk to your audience, what they feel about a certain topic /product/service and what better way you can interact with them.</p><p>Now, go ahead choose an article/dataset /campaign that you want to try sentiment analysis on and follow the steps.<br>Happy Coding , I am always here to help &lt;- <a href="http://twitter.com/lornamariak">@lornamariak</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6gfnVvkMRFtjVsWF7vkClA.png" /></figure><h4>This story is published in <a href="https://medium.com/swlh">The Startup</a>, Medium’s largest entrepreneurship publication followed by 288,884+ people.</h4><h4>Subscribe to receive <a href="http://growthsupply.com/the-startup-newsletter/">our top stories here</a>.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6gfnVvkMRFtjVsWF7vkClA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6b53b026131" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/exploring-sentiment-analysis-a6b53b026131">Exploring Sentiment Analysis</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>