<?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 rbahaguejr on Medium]]></title>
        <description><![CDATA[Stories by rbahaguejr on Medium]]></description>
        <link>https://medium.com/@rbahaguejr?source=rss-c16b3f2888c0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*IlZ25_1ARib0aUoasWukyw.jpeg</url>
            <title>Stories by rbahaguejr on Medium</title>
            <link>https://medium.com/@rbahaguejr?source=rss-c16b3f2888c0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 02:25:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rbahaguejr/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[Building data products without the Mesh]]></title>
            <link>https://medium.com/@rbahaguejr/building-data-products-without-the-mesh-5a1d5c617637?source=rss-c16b3f2888c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a1d5c617637</guid>
            <category><![CDATA[product-data]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-governance]]></category>
            <category><![CDATA[modern-data-architecture]]></category>
            <category><![CDATA[data-mesh]]></category>
            <dc:creator><![CDATA[rbahaguejr]]></dc:creator>
            <pubDate>Sat, 26 Feb 2022 00:07:43 GMT</pubDate>
            <atom:updated>2022-02-26T00:07:43.260Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F_bmYXWCxF_Q%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D_bmYXWCxF_Q&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F_bmYXWCxF_Q%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/43e86f0eceaf0550c30217a608b8956a/href">https://medium.com/media/43e86f0eceaf0550c30217a608b8956a/href</a></iframe><p>In 2019, distributed data mesh has been offered as a route for companies to leverage data at scale. The next generation enterprise data platform architecture was suggested to be the convergence of distributed domain driven architecture, self-serve platform design, and product thinking with data. One of the central idea of this paradigm is the treatment of “domain data” as a product and the introduction of the data mesh architecture.</p><p>However, for enterprises with large centralized IT organization, distributing the data platform into domains will be a long process or even unthinkable. For these organizations, building data products without the “Mesh” is more practical and doable.</p><p>In the next paragraphs, the concept of data product is borrowed and adapted from Zhamak Dehgani while leveraging existing data lake and data warehouse architectures.​</p><p>​Central to building data products is the identification of its life cycle. Taking SDLC as reference, the data product lifecycle has similar stages including requirements gathering and feasibility study, data pipeline development, testing, deployment and continuous improvement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TOh7PXw4XpZ6husVKro6bQ.png" /><figcaption>Data product lifecycle is similar to the well-known software development life cycle.</figcaption></figure><p>The data product development process can be further elaborated to support products: exposed raw or transformed data, operationalized insights, exposed analytics model and automated decision.​</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OwjdYbMZDYw14gdUENHJ4Q.png" /><figcaption>Detailed Data Products Lifecycle supporting different forms of products.</figcaption></figure><p>To take out the mystery in the composition of a data product — its anatomy is illustrated below which is composed of input data (can be multiple formats), the code or data pipeline to deliver the output data (can also be of multiple formats) and the environment where these three components resides.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G4Gb88l5DSja2uKWsStzSQ.png" /><figcaption>Data Product Anatomy. The Governance and Infrastructure is an important part of the full data product.</figcaption></figure><p>A ​data product can have different data inputs (some are flat files, some are APIs, some are direct database connections) which are transformed into the needed outputs though business rules or a computational algorithm. In mature use cases, outputs are delivered through different “output ports” to maximize its value. Data product output or “output ports” can be through an API, file-based extracts, automated triggers or decisions or visualizations.​</p><p>​This anatomy in a way also surfaces the required skills of data product developers. The developer team should have members with expertise in governance, infrastructure, data ingestion, data transformation, machine learning and end-to-end data pipeline. An effective data products team should combine this skills around an infrastructure, whether on cloud or on-premise. While there are much hype of bringing everything on the cloud, data product teams should be flexible in their development process, deployment and continuous improvement. ​</p><p>​In addition, data product owners who usually hail from the business side of the enterprise, should keep this anatomy in mind. Unlike traditional software development team where feature requests can be broken down into very agile execution, this may not be straightforward in data product development. ​</p><p>​In place of a data mesh infrastructure, the data lake and data warehouse can be organized according to domains of data being stored. This will enable easier domain-centric data products. Cross-domain data products will then be a matter of policy and governance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F9FbF1RSBrLhEC0cedsa4A.png" /><figcaption>Data architecture on the data lake and data warehouse to support domain-centric data products.</figcaption></figure><p>Without redistributing existing centralized data lakes and data warehouses, domain-centric data products can be delivered with carefully designed organization of data. Hive can be used for data virtualization to organize data per domain.</p><p>With data becoming very ubiquitous in the enterprise, proper definition of a data product, its lifecycle and development process should now be part of the enterprise process. In doing this, the real-value of data through the value of data products can measured, governance can be put in place (while supporting individual experimentation) and opportunities for monetization can also be discovered.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a1d5c617637" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Serve Data Models with MLFlow in Production]]></title>
            <link>https://medium.com/@rbahaguejr/serve-data-models-with-mlflow-in-production-c9fa4e368073?source=rss-c16b3f2888c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/c9fa4e368073</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[mlflow]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[rbahaguejr]]></dc:creator>
            <pubDate>Thu, 14 Feb 2019 17:37:21 GMT</pubDate>
            <atom:updated>2019-02-15T01:11:12.690Z</atom:updated>
            <content:encoded><![CDATA[<p>For organizations looking for a way to “democratize” data science, it is a must that data models are accessible to the enterprise in a very simple way. In our context, this is part of “model operationalization.” There are other solutions out there to serve data models which is a very common problem for data scientists.</p><p>We’ve thought of having a REST API to handle running data models on a HTTP post with new data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ie00MXJCUPzmyZfFgkysUQ.png" /><figcaption>Model service using Jupyter notebook</figcaption></figure><p>Then, came <a href="https://mlflow.org/">MLFlow</a> — which allows serving data models as REST API without the complicated setup.</p><p>To serve models using MLFlow, we did the following:</p><ol><li>Save R models as RDS format using the saveRDS function.</li><li>Convert RDS format into MLFLOW flavor using the mlflow_save_model()</li></ol><pre>model = readRDS(“./LR_Model.rds”)<br>predictor &lt;- crate(~ stats::predict.lm(model, as.data.frame(.x)), model)<br>mlflow_save_model(predictor, “&lt; path_to_save &gt;”)</pre><p>3. Commit to Git.</p><p>4. Setup a server to host the model. Clone git repo.</p><p>5. Serve model using the mlflow_rfunc_serve().</p><pre>mlflow_rfunc_serve(&quot;&lt; path_to_save &gt;&quot;, run_uuid = NULL, host = &quot;127.0.0.1&quot;,port = 8090)</pre><p>6. On users’ jupyter notebook, we have the following R lines to query the rest api endpoint with the <em>output </em>variable storing the model response.</p><pre>request_body_json &lt;- toJSON(feature_dataframe[column_name_features],dataframe=&#39;rows&#39;)<br>request_body_json<br>result = POST(url = paste0(&#39;<a href="http://127.0.0.1:8090/&#39;,&#39;predict/&#39;),body=request_body_json">http://127.0.0.1:8090/&#39;,&#39;predict/&#39;),body=request_body_json</a>,add_headers(.headers = c(&quot;Content-Type&quot;=&quot;application/json&quot;,&quot;Accept&quot; = &quot;application/json&quot;)))<br>output &lt;- content(result)</pre><p>7. On python, a similar function is available</p><pre>import requests<br>import json</pre><pre>def mlflow_predict(dd,model_name=&#39;LR12&#39;):<br>    url = &quot;<a href="http://127.0.0.1:8090/predict/">http://127.0.0.1:8090/predict/</a>&quot;<br>    headers = {&quot;Accept&quot;: &quot;application/json&quot;, &quot;Content-Type&quot;:&quot;application/json&quot;}<br>    resp = requests.post(url=url,json=dd,headers=headers)<br>    res=json.loads(resp.content.decode(&quot;utf-8&quot;))<br>    return res[&#39;predictions&#39;]</pre><p>If you’re deploying on AWS, make sure to set host=”0.0.0.0&quot; to make it listen to the public internet address.</p><p>For Python-based models, MLFLow supports deploying to SageMaker.</p><p>If you have multiple models to serve, MLFLOW assigns a port to each of them.</p><p>Make sure you have a working R and Python installations. We used anaconda3 to setup the environment. Also, at least 1GB of RAM is needed to get R running with MLFlow in AWS LightSail.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9fa4e368073" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Science for the 99% Courses]]></title>
            <link>https://medium.com/@rbahaguejr/data-science-for-the-99-courses-2d0406cd975d?source=rss-c16b3f2888c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d0406cd975d</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[activism]]></category>
            <dc:creator><![CDATA[rbahaguejr]]></dc:creator>
            <pubDate>Thu, 13 Apr 2017 01:21:07 GMT</pubDate>
            <atom:updated>2017-04-13T01:21:07.630Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m developing an offline course for local activists for data science applications in the context of campaigns on social issues.</p><p>Here’s my outline. I’ve added a master class targeted for enterprises.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u3UesdXywGh2hEq-JZqrgg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d0406cd975d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Threaded Tasks in PySpark Jobs]]></title>
            <link>https://medium.com/@rbahaguejr/threaded-tasks-in-pyspark-jobs-d5279844dac0?source=rss-c16b3f2888c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/d5279844dac0</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[spark]]></category>
            <category><![CDATA[pyspark]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[rbahaguejr]]></dc:creator>
            <pubDate>Thu, 06 Apr 2017 22:15:30 GMT</pubDate>
            <atom:updated>2017-04-06T22:31:32.281Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-nc-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<p>There are circumstances when tasks (Spark action, e.g. save, count, etc) in a PySpark job can be spawned on separate threads. Doing so, optimizes distribution of tasks on executor cores.</p><p>From <a href="http://spark.apache.org/docs/latest/job-scheduling.html#scheduling-within-an-application">Spark docs</a>,</p><blockquote><em>By default, Spark’s scheduler runs jobs in FIFO fashion. Each job is divided into “stages” (e.g. map and reduce phases), and the first job gets priority on all available resources while its stages have tasks to launch, then the second job gets priority, etc. </em>If the jobs at the head of the queue don’t need to use the whole cluster, later jobs can start to run right away, but if the jobs at the head of the queue are large, then later jobs may be delayed significantly.</blockquote><p>Threading tasks addresses this particular situation: <em>if the jobs at the head of the queue are large, then later jobs may be delayed significantly,</em> through,</p><blockquote><em>Spark assigns tasks between jobs in a “round robin” fashion, so that all jobs get a roughly equal share of cluster resources. This means that short jobs submitted while a long job is running can start receiving resources right away and still get good response times, without waiting for the long job to finish.</em></blockquote><h4>Simple But Very Common Use Case</h4><p>Saving multiple results to parquet files is a common action. Here’s how to thread three <em>write.parquet</em> action.</p><p>An important reminder is to set set(&#39;spark.scheduler.mode&#39;,&#39;FAIR&#39;) in the sparkContext.</p><pre>import threading</pre><pre>def set_spark_context(app_name=None):<br>    conf = SparkConf().\<br>            setAppName(app_name).\<br>            set(&#39;spark.hadoop.mapreduce.output.fileoutputformat.compress&#39;, &#39;false&#39;).\<br>            set(&#39;spark.sql.parquet.compression.codec&#39;,&#39;uncompressed&#39;).\<br>            set(&#39;spark.scheduler.mode&#39;,&#39;FAIR&#39;) # need to set this on the sparkContext<br>    sc = SparkContext(conf=conf)<br>    try:<br>        sc._jvm.org.apache.hadoop.hive.conf.HiveConf()<br>        sqlCtx = sqlContext = HiveContext(sc)<br>    except py4j.protocol.Py4JError:<br>        sqlCtx = sqlContext = SQLContext(sc)<br>    return sc, sqlContext</pre><pre>#function to be called on spawned threads*<br>def saveParquet(df,path,pool_id,sc):<br>    sc.setLocalProperty(&quot;spark.scheduler.pool&quot;, str(pool_id))<br>    df.repartition(1).write.parquet(path)<br>    sc.setLocalProperty(&quot;spark.scheduler.pool&quot;, None)</pre><pre>sc, sqlContext = set_spark_context(&quot;Simple TASK&quot;)</pre><pre># Do processing here to produce three dataframes to be written as parquets.<br># The tree results are df1, df2, df3</pre><pre>path1 = &quot;/path/1&quot;<br>path2 = &quot;/path/2&quot;<br>path3 = &quot;/path/3&quot;</pre><pre>df1_write = threading.Thread(target=saveParquet, args=(df1,path1,1,sc,))<br>df2_write = threading.Thread(target=saveParquet, args=(df2,path2,2,sc,))<br>df3_write = threading.Thread(target=saveParquet, args=(df3,path3,3,sc,))</pre><pre>df1.start()<br>df2.start()<br>df3.start()</pre><pre>df1.join()<br>df2.join()<br>df3.join()</pre><p>When this job is submitted on the cluster, at first it will show 1 scheduler pool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fSJvxlsAVqdOZsDIj62rwA.png" /></figure><p>However, at the stage where the actual snippet above is already being interpreted, it will show the 3 pools spawned and the active pools currently being processed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z8dx8UGZeXe0t2oZy7Vtzg.png" /></figure><p>Hopefully, this is something useful for us trying to speed up running jobs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d5279844dac0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Spark in a Box: Making Apache Spark Accessible to Small Enterprises and Academic Institutions]]></title>
            <link>https://medium.com/@rbahaguejr/spark-in-a-box-making-apache-spark-accessible-to-small-enterprises-and-academic-institutions-3a1c6198f2e9?source=rss-c16b3f2888c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a1c6198f2e9</guid>
            <category><![CDATA[spark]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[rbahaguejr]]></dc:creator>
            <pubDate>Wed, 08 Mar 2017 12:11:40 GMT</pubDate>
            <atom:updated>2017-03-08T12:11:40.255Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<p>Apache Spark is a powerful tool for data processing. However, it is becoming a restrictive tool available only to Big Enterprises. Hortonworks and Cloudera are the de facto distribution for installation on expensive cluster setup.</p><p>A standalone setup for Apache Spark is already a useful tool for data processing of small enterprises and instruction for academic institutions.</p><p>I found this specification for the above use case:</p><p>8 cores Intel® Xeon® processor D-1541 SoC or Intel® Atom™ processor SOC<br>128GB GB RAM<br>3TB x 4 Hot-swap 3.5&quot; SATA3 drive bays, <br>1 x 1 Internal 2.5&quot; drive bays<br>250W Multi-output Power Supply</p><p>It will be interesting to set this machine up and do some tests.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a1c6198f2e9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Word cloud on Python]]></title>
            <link>https://medium.com/@rbahaguejr/word-cloud-on-python-3b44d6d1e77c?source=rss-c16b3f2888c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b44d6d1e77c</guid>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[rbahaguejr]]></dc:creator>
            <pubDate>Wed, 15 Feb 2017 00:40:26 GMT</pubDate>
            <atom:updated>2017-02-15T00:40:26.455Z</atom:updated>
            <content:encoded><![CDATA[<p>Last year our Vice President resigned from the Cabinet. She was appointed “Housing Czar” but the President is not able to trust her.</p><p>Upon his resignation (or was fired), her staff released a list of accomplishment. A simple word cloud looks like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*F7teCjy7J3QY92mgXPMjPg.png" /></figure><p>Download the notebook <a href="https://github.com/RickBahague/vp-leni-wordcloud">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b44d6d1e77c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Window Function on PySpark]]></title>
            <link>https://medium.com/@rbahaguejr/window-function-on-pyspark-17cc774b833a?source=rss-c16b3f2888c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/17cc774b833a</guid>
            <category><![CDATA[pyspark]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[apache-spark]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[rbahaguejr]]></dc:creator>
            <pubDate>Wed, 08 Feb 2017 11:38:29 GMT</pubDate>
            <atom:updated>2017-02-08T11:38:29.519Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-nc-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<p>Here’s how to get the least value of col5 for a group:</p><pre>from pyspark.sql.window import Window</pre><pre>window = Window.\<br>              partitionBy(&#39;col1&#39;,&#39;col2&#39;,\<br>                          &#39;col3&#39;,&#39;col4&#39;).\<br>              orderBy(df[&#39;col5&#39;].desc())</pre><pre>df = df.withColumn(&quot;rank_based_on_col5&quot;,rank().over(window))<br>df_w_least = df.filter(&quot;rank_based_on_col5=1&quot;)</pre><p>ref: <a href="https://databricks.com/blog/2015/07/15/introducing-window-functions-in-spark-sql.html">https://databricks.com/blog/2015/07/15/introducing-window-functions-in-spark-sql.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17cc774b833a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adding Python Files to PySpark Job]]></title>
            <link>https://medium.com/@rbahaguejr/adding-python-files-to-pyspark-job-b725e02c8ab2?source=rss-c16b3f2888c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/b725e02c8ab2</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[apache-spark]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[rbahaguejr]]></dc:creator>
            <pubDate>Thu, 26 Jan 2017 08:18:36 GMT</pubDate>
            <atom:updated>2017-01-26T21:54:09.264Z</atom:updated>
            <content:encoded><![CDATA[<p>There are varying suggestions on how to do this on <a href="http://stackoverflow.com/questions/27644525/pyspark-py-files-doesnt-work">SO</a>. However, the pointers are creating more frustrations even for us familiar with PySpark.</p><p><strong>Scenario:</strong></p><ol><li>A Spark job in Python called <em>spark_job.py.</em></li><li><em>spark_job.py</em> needs a few other python files, <em>module1.py</em> and <em>module2.py</em> to be imported.</li></ol><p><strong>Solution</strong></p><ol><li>Add the <em>module1.py</em> and <em>module2.py</em> to <em>spark_job.py</em> via</li></ol><pre>sc.addFile(&quot;&lt;base_path&gt;/module1.py&quot;)<br>sc.addFile(&quot;&lt;base_path&gt;/module2.py&quot;)</pre><p><em>&lt;base_path&gt;</em> should be the location of <em>module1.py</em> and <em>module2.py</em> in your local spark client.</p><p>2. Since Spark will distribute all files on every cluster node, we need to add the base path of <em>module1.py</em> and <em>module1.py</em> to the system path of the spark job. We do this through the <em>SparkContext.SparkFiles</em> api and the usual python <em>sys</em> module. Using <em>sys.append</em>, for some reason, does not work.</p><pre>from pyspark import SparkConf, SparkContext, SparkFiles<br>sys.path.insert(0,SparkFiles.getRootDirectory())</pre><p>3, Do your usual imports on <em>spark_job.py</em>.</p><pre>import module1 as md1<br>import module2 as md2</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b725e02c8ab2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Support the Relief and Rehabilitation Efforts in Catanduanes, Philippines Due to Typhoon Nina…]]></title>
            <link>https://medium.com/@rbahaguejr/support-the-relief-and-rehabilitation-efforts-in-catanduanes-philippines-due-to-typhoon-nina-3d9e049df01b?source=rss-c16b3f2888c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d9e049df01b</guid>
            <category><![CDATA[philippines]]></category>
            <category><![CDATA[travel]]></category>
            <category><![CDATA[disaster-relief]]></category>
            <category><![CDATA[disaster-recovery]]></category>
            <dc:creator><![CDATA[rbahaguejr]]></dc:creator>
            <pubDate>Sat, 07 Jan 2017 23:14:36 GMT</pubDate>
            <atom:updated>2017-01-07T23:15:32.944Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Support the Relief and Rehabilitation Efforts in Catanduanes, Philippines Due to Typhoon Nina Devastation</strong></h3><p>My first post for the year is a call for support on the on-going rehabilitation efforts in areas devastated by Typhoon Nock-Ten/Nina.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*PrwzPUrqylusDxTzVUR8IA.jpeg" /><figcaption>Typhoon Nock-Ten/Nina’s devastation in San Roque, Bato, Catanduanes</figcaption></figure><p>On December 25, 2016, Christmas Day, the Philippines bade goodbye to the New Year with one last typhoon. Its gustiness was up to 250 kph with sustained winds of 185 kph, that rampaged in the Bicol Region and Southern Luzon. Thousands were left homeless. The prepositioned relief packs from the <a href="http://www.dswd.gov.ph/">Department of Social Welfare and Development</a> provided much needed immediate help to the affected population. The more painful part is the rehabilitation effort.</p><p>Bato, Catanduanes was the first town where Nina made landfall. This sleepy fifth class town in the Southern part of Catanduanes, just beside the capital town of Virac, has 27 barangays with a <a href="https://en.wikipedia.org/wiki/Bato,_Catanduanes">total population of about 21,279 people</a>. Catanduanes is an island province with a population that is mostly confined near the coast. Its interior is rocky and montainuous. Thus, after the typhoon hit, Virac became quite isolated from majority of the island-province’s 11 towns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*PD9Wrm5EF8VCEoK4Bq5XYA.jpeg" /><figcaption>Image Source:<a href="http://www.philstar.com/headlines/2016/12/25/1656718/powerful-nina-heads-christmas-day-blow-philippines"> Philstar</a>/PAGASA</figcaption></figure><p>On January 2, <a href="https://www.facebook.com/catanduanes.province/posts/1309273669136186">According to Governor Joseph Cua</a>, only around 4,196 boxes of relief packs for the same number of families were able to reach the island as of yesterday. Help is slowly coming in. An estimated 36,614 affected families need support.</p><p>Please support the relief and rehabilitation efforts in Catanduanes, Philippines.</p><p><strong><em>Here’s a list of initiatives on social media with affected families in Bato, Catanduanes as beneficiaries. You can send your donations to them. Also, please help us monitor contributions via this </em></strong><a href="https://docs.google.com/forms/d/e/1FAIpQLSfEYfYExuTX5Ve2MFxbOJd-TzUgG8vYiwQRl_NOQQ8tptQnGQ/viewform"><strong><em>simple pledge form</em></strong></a><strong><em>.</em></strong></p><p><strong>Saint John the Baptist Civic Association (SJTBCA)</strong></p><pre>Bank Account Details<br>Bank Name: Banco de Oro<br>Branch: Virac</pre><pre>Account No: 006030227385<br>Account Name: Saint John the Baptist Civic Association</pre><pre>Western Union Money Transfer<br>Recipient: Ms. Agnes Dela Cruz (Coordinator - SJTBCA)</pre><p><strong>Bato Development Foundation</strong></p><p>A nascent group directly coordinating with the Office of the Vice Mayor Roy Regalado of Bato, Catanduanes.</p><pre>Contacts:<br>- Vice Mayor Roy Regalado, +63 9286245170<br>= Ms. Bhing Comiso, +63 9475764523</pre><pre>Donations can be sent to:<br>8TriMedia Broadcasting<br>DZRJ 810 AM Radio<br>Room 404 Seneca Plaza, E Rodriguez Sr. Ave,<br>New Manila, Quezon City, Philippines</pre><p><strong>BRDHS Batch 1997</strong></p><p>Your donations will support the rehabilitation of various facilities in Bato Rural Development High School.</p><pre>Contacts:</pre><pre>- Marcus Teope, +63 9157280169<br>- Rick Bahague, +63 9399266549</pre><pre>Bank Account Details (Cash Deposits Only)<br>Bank Name: Banco de Oro<br>Account No: 160969417<br>Account Name: Mark Rhestie Teope &amp; Ricardo Bahague Jr.</pre><pre>Please send us your deposit slip, rick [at] cp-union [dot] com</pre><p><strong>SRBC Support Group</strong></p><p>Your donations will support the rehabilitation efforts in San Roque, Bato, Catanduanes. <a href="http://www.cp-union.com/">Computer Professionals’ Union</a> is helping organize this effort.</p><pre>Contacts:</pre><pre>- Rick Bahague, +63 9399266549</pre><pre>Bank Account Details<br>Bank Name: Banco de Oro<br>Account No: 003988006344<br>Account Name: CP-Union.Org Inc</pre><pre>Please send us your deposit slip, rick [at] cp-union [dot] com.</pre><p><strong>If you are donating to any of the above groups, please help us monitor contributions via this </strong><a href="https://docs.google.com/forms/d/e/1FAIpQLSfEYfYExuTX5Ve2MFxbOJd-TzUgG8vYiwQRl_NOQQ8tptQnGQ/viewform"><strong>simple pledge form</strong></a><strong>.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d9e049df01b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How-to Declutter Your Data Science Workspace]]></title>
            <link>https://medium.com/@rbahaguejr/how-to-de-clutter-your-data-science-workspace-68948a59032b?source=rss-c16b3f2888c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/68948a59032b</guid>
            <category><![CDATA[workflow]]></category>
            <category><![CDATA[apache-spark]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[rbahaguejr]]></dc:creator>
            <pubDate>Fri, 11 Nov 2016 03:27:37 GMT</pubDate>
            <atom:updated>2016-11-11T03:35:05.182Z</atom:updated>
            <content:encoded><![CDATA[<p>Working on a data science project is almost always equivalent to an amazing clutter in the working directory. Data scientists would most likely have the following materials dumped in their project working directory:</p><ul><li>Python/R scripts</li><li>Data sets</li><li>Reference materials — includes journal articles, slides, other documents</li><li>Notebooks</li><li>Notes</li><li>Scala sources (if using spark)</li><li>Cloned repository of other projects relevant to the current work — usually, a source of inspiration, methodology or case studies</li><li>Other scripts for data transfer, data clean-up or even for runners.sh to submit jobs on a cluster. I always have a runner.sh that contains yarn settings for spark-submit.</li><li>Other stuffs, thought to be useful but oftentimes are not.</li></ul><h4>Workflow of data science work</h4><p>Given a project, Data Scientists follows these steps to tackle it;</p><ul><li>Requirements gathering</li><li>ETL data from sources using python, R or scala</li><li>Data calibration - perform descriptive statistics on data to validate whether it reflects business facts. This takes sometime, even on collaborative environment where business and data scientists are working closely. In addition, data calibration is also needed to further verify business facts.</li><li>Data Science and Insights Generation - with data validated and calibrated, A Data Scientist can now start working on generating insights - producing notebooks, scripts or scala jars. Notes, journal articles and other references will add to the clutter in the working directory.</li><li>Visualization and Reports creation - reports for business are consolidated in a presentation from outputs of various visualization tools (png files, tableau workbooks)</li><li>PySpark or Spark jobs sources for operationalization - if the study is to be operationalized, prototypes are built as Data Engineers guide.</li></ul><p>Different activities necessary for the above steps, inevitably clutters the project directory.</p><h4>De-clutter working directories</h4><p>This is the directory heirarchy I have for every data science project:</p><ul><li>ansible-playbooks: ansible playbooks are created to automated repeatitive tasks</li><li>data: all data sets (toy, final, intermediate aggregates, etc). I would usually have to sub directories, for (1) datasets generated in the cluster (we&#39;re running on a spark environment), (2) locally generated</li><li>Notebooks: with subdirectories for notebooks running on the cluster and locally</li><li>References: pdfs, journal articles, references</li><li>repo: for all python, scala and R scripts, organized as repo/src/python/main/R, repo/src/python/lib (for various utilities), repo/src/main (for scala codes). repo is organized like this to allow easy compilation of scala codes using maven build.</li><li>Reports: all reports goes here</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h1BGoaVIjkemnIy7Li8_dQ.png" /></figure><h4>Version Control</h4><p>I use git to manage versions and changes. A .gitignore file which ignores everything except for the main directories above keeps accidental inclusion of files not intended for commit to the remote repo.</p><p>Here’s my .gitignore file.</p><pre>/*<br>**/.DS_Store<br>**/.ipynb_checkpoints<br>**/*.log<br>repo/src/python/lib/<br>!/resources<br>!/notebooks<br>!/repo<br>!/ansible<br>!/data<br>!/.gitignore</pre><h4>Tools</h4><ul><li>Ansible: I am using ansible for automating repeative scp and spark submit on a cluster client. For simpler tasks, this may not be neccessary. Read about it <a href="https://medium.com/@rbahaguejr/ansible-for-the-impatient-devops-83b44828f885#.dzs36kmsk">here</a>.</li><li>Git: for version control</li><li>Sublime: for text editor</li><li>Anaconda3: as python distribution with jupyter-notebook</li><li>Markdown cheatsheet: for any documentation using sublime.</li><li>I’ve recently added, AirBnB&#39;s knowledge-Repo for knowledge-sharing with collegues. You can read more about it <a href="https://medium.com/@rbahaguejr/exploring-airbnbs-knowledge-repo-a-curated-knowledge-sharing-platform-ebd8086a093e#.9ykye3ibj">here</a>. ​​</li></ul><h4>End Notes</h4><p>How are you de-cluttering your working directory? Get the workspace template <a href="https://github.com/RickBahague/datascience-workspace-template">here</a>. Feel free to comment and improve.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=68948a59032b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>