<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Qasim H. (aiwithqasim 🚀)</title>
    <description>The latest articles on Forem by Qasim H. (aiwithqasim 🚀) (@aiwithqasim).</description>
    <link>https://forem.com/aiwithqasim</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F741750%2Ffb7c33a6-ded5-47eb-8e87-6e02917b0a65.png</url>
      <title>Forem: Qasim H. (aiwithqasim 🚀)</title>
      <link>https://forem.com/aiwithqasim</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/aiwithqasim"/>
    <language>en</language>
    <item>
      <title>Batch Processing using PySpark on AWS EMR</title>
      <dc:creator>Qasim H. (aiwithqasim 🚀)</dc:creator>
      <pubDate>Sat, 11 Nov 2023 04:01:22 +0000</pubDate>
      <link>https://forem.com/aws-builders/batch-processing-using-pyspark-on-aws-emr-59n4</link>
      <guid>https://forem.com/aws-builders/batch-processing-using-pyspark-on-aws-emr-59n4</guid>
      <description>&lt;p&gt;Are you a Data Engineer and want to do hands-on on AWS services? This blog is about batch data processing using AWS services, you will learn to do batch processing using AWS services: S3 as storage,  EMR as processing cluster, and Athena for querying the processed results. &lt;/p&gt;

&lt;h3&gt;
  
  
  About Batch Data Pipeline:
&lt;/h3&gt;

&lt;p&gt;The Wikipedia Activity data will be put into a folder in the S3 bucket. We will have PySpark code that will run on the EMR cluster. This code will fetch the data from the S3  bucket, perform filtering and aggregation on this data, and push the processed data back into  S3 in another folder. We will then use Athena to query this processed data present in S3. We will create a table on top of the processed data by providing the relevant schema and then use  ANSI SQL to query the data.&lt;/p&gt;

&lt;h3&gt;
  
  
  Architecture Diagram:
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgxpb963tyc7i5rf2qbw4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgxpb963tyc7i5rf2qbw4.png" alt="Architecture Diagram"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Languages&lt;/strong&gt; - Python &lt;br&gt;
&lt;strong&gt;Package&lt;/strong&gt; - PySpark &lt;br&gt;
&lt;strong&gt;Services&lt;/strong&gt; - AWS EMR, AWS S3, AWS Athena.&lt;/p&gt;

&lt;h3&gt;
  
  
  Dataset:
&lt;/h3&gt;

&lt;p&gt;We'll be using the Wikipedia activity logs JSON dataset that has a huge payload comprising 15+ fields&lt;/p&gt;

&lt;p&gt;NOTE: In our Script created we'll take two conditions into consideration that we want only those payloads where &lt;strong&gt;&lt;em&gt;isRobot&lt;/em&gt;&lt;/strong&gt; is &lt;strong&gt;&lt;em&gt;False&lt;/em&gt;&lt;/strong&gt; &amp;amp; user &lt;strong&gt;&lt;em&gt;country&lt;/em&gt;&lt;/strong&gt; is from &lt;strong&gt;&lt;em&gt;United Estate&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm7osv4y1on84ssmjmqdx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm7osv4y1on84ssmjmqdx.png" alt="dataset"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Steps of Working:
&lt;/h3&gt;

&lt;p&gt;1- Create an S3 bucket with a suitable name i:e., &lt;em&gt;emr-batchprocessing-raw-useast1-Account ID-dev&lt;/em&gt; &amp;amp; inside the bucket create folders i:e., &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;input-source&lt;/em&gt;&lt;/strong&gt; (upload your dataset here it will be your source folder),&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;output-destination&lt;/em&gt;&lt;/strong&gt; (According to scenarios processed from AWS EMR data will be dumped here for further processing) &amp;amp; &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;logs&lt;/em&gt;&lt;/strong&gt; (AWS EMR logs will be saved here. We'll specify this directory during creation of EMR)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6flo8wg7q99a7tze3rqx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6flo8wg7q99a7tze3rqx.png" alt="S3 bucket Creation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2- Goto EC2-keypair &amp;amp; create Key pair for using that into EMR cluster creation&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjb8ruqe3pot7lzp0kt1l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjb8ruqe3pot7lzp0kt1l.png" alt="EC2 key pair"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3- Now, We have to create an AWS EMR cluster for that go to AWS EMR from AWS Console &amp;amp; choose &lt;strong&gt;EMR on EC2: Clusters&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwv9pyw9bva8jy8lk1cei.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwv9pyw9bva8jy8lk1cei.png" alt="EMR clsuter creation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4- During the Cluster creation provide some suitable name in my case I have provided "&lt;strong&gt;&lt;em&gt;emr-batch-processing&lt;/em&gt;&lt;/strong&gt;" &amp;amp; selected &lt;strong&gt;&lt;em&gt;spark&lt;/em&gt;&lt;/strong&gt; as the processing engine.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgvt7tbt34asgeim5rau1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgvt7tbt34asgeim5rau1.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;5- As EMR stands for Elastic Map Reduce &amp;amp; it works under the rule of distributed processing we need &lt;strong&gt;&lt;em&gt;master node&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;woker/core nodes&lt;/em&gt;&lt;/strong&gt; for processing. &lt;em&gt;Note: I removed the Task nodes here during creation&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl012n2lxrmpjzu75aoou.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl012n2lxrmpjzu75aoou.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;6- For cluster scaling and provisioning let's go with 2 &lt;strong&gt;&lt;em&gt;woker/core nodes&lt;/em&gt;&lt;/strong&gt; since our working in minimal and realistic&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw161ld0h9jprpqkdgth7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw161ld0h9jprpqkdgth7.png" alt="EMR Scaling"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;NOTE: Keep default setting for &lt;strong&gt;_Networking _&lt;/strong&gt;&amp;amp; &lt;strong&gt;&lt;em&gt;Cluster termination&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;7- Select EC2 key pair that we created in Step 2 so that we can do SSH using the terminal &lt;/p&gt;

&lt;p&gt;8- For cluster logs Let's choose the Log folder that we created during the Bucket creation step.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9rr688eygvvs26e2xr7t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9rr688eygvvs26e2xr7t.png" alt="EMR logs directory"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;9- Lastly we Need to create the &lt;strong&gt;&lt;em&gt;Amazon EMR service role&lt;/em&gt;&lt;/strong&gt; for Identity and Access Management (IAM) &amp;amp; Similarly &lt;strong&gt;&lt;em&gt;Instance Profile&lt;/em&gt;&lt;/strong&gt; for EC2 instance profile for Amazon EMR. After that review steps &amp;amp; Click on Create Create EMR Cluster.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn4jdx6baqc9p7qwg4na6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn4jdx6baqc9p7qwg4na6.png" alt="Service Role &amp;amp; Instance Profile"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;10- Let's create a script that we want to run into our EMR cluster. NOTE: The code given below is only one filtering script for full scripts please refer to GitHub.&lt;/p&gt;

&lt;p&gt;Github link: &lt;a href="https://github.com/aiwithqasim/emr-batch-processing" rel="noopener noreferrer"&gt;https://github.com/aiwithqasim/emr-batch-processing&lt;/a&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

from pyspark.sql import SparkSession

S3_DATA_INPUT_PATH="&amp;lt;&amp;lt;bucket link to source dataset&amp;gt;&amp;gt;"
S3_DATA_OUTPUT_PATH_FILTERED="&amp;lt;&amp;lt;bucket link to output folder&amp;gt;&amp;gt;/filtered"

def main():
    spark = SparkSession.builder.appName('EMRBathcProcessing').getOrCreate()
    df = spark.read.json(S3_DATA_INPUT_PATH)
    print(f'The total number of records in the source data set is {df.count()}')
    filtered_df = df.filter((df.isRobot == False) &amp;amp; (df.countryName == 'United States'))
    print(f'The total number of records in the filtered data set is {filtered_df.count()}')
    filtered_df.show(10)
    filtered_df.printSchema()
    filtered_df.write.mode('overwrite').parquet(S3_DATA_OUTPUT_PATH_FILTERED)
    print('The filtered output is uploaded successfully')

if __name__ == '__main__':
    main()


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;11- Make sure the EMR cluster you created has SSH port 22 open for cluster connection from local &lt;strong&gt;_Terminal _&lt;/strong&gt; or &lt;strong&gt;_Putty _&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;12- Connect to your AWS EMR EC2 instance using the connection command as shown below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqms0mh5zelipr72ihe8a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqms0mh5zelipr72ihe8a.png" alt="connectin to AWS EMR"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;13- Create the main script (include the script that we created above) using the Linux command and submit the code using &lt;strong&gt;&lt;em&gt;spark-submit main.py&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F86tw8x268koc62i6xdcb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F86tw8x268koc62i6xdcb.png" alt="creating &amp;amp; submitting spark script"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;14- After completion validate that the code ran successfully &amp;amp; &amp;amp; the terminal has print schema as shown below&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F75g6ms4zviqs014xjhg4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F75g6ms4zviqs014xjhg4.png" alt="code completetion Validation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and also &amp;amp; the S3 bucket has processed data.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi1pfhx9z7b0ixh24e6ck.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi1pfhx9z7b0ixh24e6ck.png" alt="Prcessed data in S3"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;15- Goto AWS Athena query editor&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Create a table using data in the S3 output folder (processed data)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Make sure the &lt;strong&gt;&lt;em&gt;table&lt;/em&gt;&lt;/strong&gt;&amp;amp; &lt;strong&gt;&lt;em&gt;database&lt;/em&gt;&lt;/strong&gt;are created properly&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Created a new &lt;strong&gt;&lt;em&gt;query&lt;/em&gt;&lt;/strong&gt;to select data from the table created&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Make sure the query is returning the result properly.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1bd8vfybn3jpboqk7ei3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1bd8vfybn3jpboqk7ei3.png" alt="Querying using Athena"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;In a professional data engineering career, you have various scenarios where data gets collected every day. The data can be processed once a day, i.e., batch processed, and the processed results are stored in a location to derive insights and take appropriate action based on the insights. In this blog, we have implemented a batch-processing pipeline using AWS services. We have taken a day’s worth of data related to Wikipedia, and performed batch processing on it.&lt;/p&gt;

&lt;p&gt;For more such content please follow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;LinkedIn: &lt;a href="https://www.linkedin.com/in/qasimhassan/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/qasimhassan/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;GitHub: &lt;a href="https://github.com/aiwithqasim" rel="noopener noreferrer"&gt;https://github.com/aiwithqasim&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Join our &lt;a href="https://chat.whatsapp.com/LoLXrRI18lPJlLiDK7Mson" rel="noopener noreferrer"&gt;AWS Data Engineering WhastApp&lt;/a&gt; Group &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>datapipeline</category>
      <category>pyspark</category>
      <category>dataengineering</category>
      <category>amazonwebservices</category>
    </item>
    <item>
      <title>What is Databricks Lakehouse ?</title>
      <dc:creator>Qasim H. (aiwithqasim 🚀)</dc:creator>
      <pubDate>Tue, 04 Oct 2022 08:09:52 +0000</pubDate>
      <link>https://forem.com/aiwithqasim/what-is-databricks-lakehouse--35cp</link>
      <guid>https://forem.com/aiwithqasim/what-is-databricks-lakehouse--35cp</guid>
      <description>&lt;p&gt;In this blog, I’ll introduce you to the Databricks Lakehouse platform &amp;amp; discuss some of the problems that Lakehouse addresses. Databricks is a data and AI company. They provide the first Lakehouse which offers one simple platform to unify all your data analytics and AI workloads.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--J4QHCLir--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wg4x7dfalmqbdvdrobow.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--J4QHCLir--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wg4x7dfalmqbdvdrobow.png" alt="what is Databricks Lakehouse platform" width="649" height="396"&gt;&lt;/a&gt;&lt;br&gt;
Challenges that most organizations have with data. Generally, start with the architecture. Note here as in below Fig2 have different isolated stocks for Data Warehousing, Data Engineering &amp;amp; streaming, and Data Science and Machine Learning. This needs to develop and maintain very different stocks of technologies can result in a lot of complications and confusion often times the underlying technologies don't work very well together and it's difficult to maintain this overall ecosystem. &lt;br&gt;
Secondly, we have a lot of different tools that power each of these architectures and it ends up being just a huge slew of different open-source tools that you have to connect. In the Data Warehousing stack, you're often dealing with proprietary data formats and if you want to enable Advanced use cases, you have to move the data across the stacks. It ends up being expensive and resource-intensive to manage. All of this complexity ends up being felt by your data teams. Both people trying to query and analyze your data. As well as those responsible for maintaining these systems. Because the systems are siloed, the teams become siloed too, so communication slows down hindering Innovation and speed, and different teams often end up with different versions of the truth. So, we end up with many copies of data. No, consistent security or governance model closed systems and disconnected less productive teams.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bo10LZlK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mrrsnqxzt0srwsq6dfw4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bo10LZlK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mrrsnqxzt0srwsq6dfw4.png" alt="Data roles, tools &amp;amp; responsibilities" width="880" height="440"&gt;&lt;/a&gt;&lt;br&gt;
The core problem is the technologies in these stacks are built upon. The solution for this is a Data Lakehouse. Data Lake and Data Warehouses have complementary but different benefits that have acquired both to exist in most enterprise environments.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--csaUr7aU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0zoh1wibmz17lsrbp7ej.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--csaUr7aU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0zoh1wibmz17lsrbp7ej.png" alt="Delta Lake &amp;amp; Data warehouse" width="880" height="357"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data Lakes&lt;/strong&gt;, do a great job supporting machine learning, they have open formats and a big ecosystem, but they have poor support for business intelligence and suffer from complex data Quality problems.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On the other hand, &lt;strong&gt;Data Warehouses&lt;/strong&gt; are great for business intelligence applications, but they have limited support for machine learning workloads, and they are proprietary systems with only a SQL interface.&lt;br&gt;
Unifying, these systems can be transformational and how we think about data. Therefore, Databrick’s culture of innovation and dedication to open source, bring Lakehouse to provide one platform to unify all of your data analytics and AI.&lt;br&gt;
While it's an oversimplification, a good starting point to talking about the Lakehouse is to describe it as enabling design patterns and use cases associated with Data Warehouses to be stored in an open format and economical cloud object storage, as known as Data Lake&lt;br&gt;
With proper planning and implementation, Lakehouse can provide organizations of any size with &lt;strong&gt;&lt;em&gt;robust&lt;/em&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;em&gt;secure&lt;/em&gt;&lt;/strong&gt; &amp;amp; &lt;strong&gt;&lt;em&gt;scalable systems&lt;/em&gt;&lt;/strong&gt; that drastically lower total operating costs while increasing the simplicity of system maintenance and reducing the time to reach actionable insights.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uxTckcb7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pmcq4hm9eor7y2ya0f1f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uxTckcb7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pmcq4hm9eor7y2ya0f1f.png" alt="Delta Lake" width="880" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At the heart of the Databricks Lakehouse is a Delta Lake format, Delta Lake provides the ability to build curated Data Lakes that add reliability and performance, and the governance you expect from Data Warehouses directly to your existing Data Lake. You gain reliability with acid transactions now; you can be sure that all operations in the data Lake either fully succeed or fail with the ability to easily time travel backward to understand every change made to your data. Additionally, the lake is underpinned by Apache spark and utilizes Advanced caching and indexing methods. This allows you to process and query data on your data Lake extremely quickly at scale. And finally, Databricks provide support for a fine-grained, access control list to give you much more control over who can access what data in your data Lake. &lt;/p&gt;

&lt;p&gt;Now with this Foundation, let's look at the Lakehouse that's built on top of it. The Databricks Lakehouse. The platform is unique in three ways. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4Mfy8eL8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hb9qi8ox5k1jjjmcmmad.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4Mfy8eL8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hb9qi8ox5k1jjjmcmmad.png" alt="Benefits of Lakehouse" width="880" height="467"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It's simple data only needs to exist, once to support all of your data workloads on one common platform. &lt;/li&gt;
&lt;li&gt;It's based on open source and Open Standards to make it easy to work with existing tools and avoid proprietary formats and &lt;/li&gt;
&lt;li&gt;It's collaborative your Data Engineers, Analysts, and Data Scientists can work together much more easily. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's explore this a little more, &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--whePPPuO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ivvxin5c949bjbiiorya.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--whePPPuO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ivvxin5c949bjbiiorya.png" alt="Lakehouse: Simple" width="880" height="415"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With a Lakehouse much more of your data can remain in your Data Lake rather than having to be copied into other systems. You no longer need separate data architectures, to support your workloads, across Analytics, Data Engineering &amp;amp; streaming, and Data Science, and Databricks provides the capabilities and workspaces to handle all of these workloads. This gives you one common way to get things done, across all of the major Cloud providers. The unification of the Lakehouse extends beyond the architecture and workloads as stated above.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xtnci-fd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wfuawzfvkuz11n9de4jf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xtnci-fd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wfuawzfvkuz11n9de4jf.png" alt="Lakehouse: Open" width="880" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Databricks invented some of the most successful open-source projects in the world. These Innovations underpin, everything we do, and they are born from our expertise in space. A commitment to open source is why we believe your data should always be in your control. Without the lake, there's no vendor lock-in on your data because it's built on open-source technology, the Databricks Lakehouse. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1YAfxQe9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vgbbwr976t8bto56dkwu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1YAfxQe9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vgbbwr976t8bto56dkwu.png" alt="Lakehouse: collaborative" width="880" height="409"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With Databricks and all your Data teams from Data Engineers to Data Analysts and Scientists can collaborate and share across all of your workloads. You can easily share data products, like models, Dashboards, Notebooks, and Datasets, and get more initiatives to production, so that you can be a data native organization. &lt;/p&gt;

&lt;p&gt;I had read many of blogs related to Lakehouse but most of them include a lot of marketing stuff added in the blog. I tried to write too the point while explaining the core concept &amp;amp; feature that Lakehouse offers. Hope you like it. If you're curious how to pass the Databricks Lakehouse fundamentals Accreditation? Kindly follow the link -&amp;gt;&lt;br&gt;
&lt;a href="https://dev.to/aiwithqasim/how-to-pass-the-databricks-lakehouse-accreditation-22a1"&gt;Databricks Lakehouse Exam Guide&lt;/a&gt;&lt;/p&gt;

</description>
      <category>lakehouse</category>
      <category>databricks</category>
      <category>deltalake</category>
      <category>dataengineers</category>
    </item>
    <item>
      <title>How to pass the Databricks Lakehouse Accreditation?</title>
      <dc:creator>Qasim H. (aiwithqasim 🚀)</dc:creator>
      <pubDate>Tue, 04 Oct 2022 08:05:48 +0000</pubDate>
      <link>https://forem.com/aiwithqasim/how-to-pass-the-databricks-lakehouse-accreditation-22a1</link>
      <guid>https://forem.com/aiwithqasim/how-to-pass-the-databricks-lakehouse-accreditation-22a1</guid>
      <description>&lt;h2&gt;
  
  
  ABOUT ACCREDIATION
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Number of questions : 20&lt;/li&gt;
&lt;li&gt;Type of questions: Multiple choice questions&lt;/li&gt;
&lt;li&gt;Duration: 20min&lt;/li&gt;
&lt;li&gt;Cost  : Free&lt;/li&gt;
&lt;li&gt;Retry: Unlimited&lt;/li&gt;
&lt;li&gt;Passing score: 80%&lt;/li&gt;
&lt;li&gt;Expiration: 1 year&lt;/li&gt;
&lt;li&gt;Where to register for the certification :  Databricks Academy

&lt;ul&gt;
&lt;li&gt;If you are a partner : &lt;a href="https://partner-academy.databricks.com/learn"&gt;Link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;If you are a customer : &lt;a href="https://customer-academy.databricks.com/lms/"&gt;Link&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  TOPICS COVERED OVERVIEW
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Databricks SQL&lt;/li&gt;
&lt;li&gt;Databricks Lakehouse platform&lt;/li&gt;
&lt;li&gt;Databricks Data Engineering and Data Science Workspace&lt;/li&gt;
&lt;li&gt;Databricks Machine Learning&lt;/li&gt;
&lt;li&gt;How to prepare for the certification:&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  PREPARATION MATERIAL
&lt;/h2&gt;

&lt;p&gt;Some of the material Recommended by Databricks to clear the accreditation are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What's Databricks Machine Learning? : &lt;a href="https://www.youtube.com/embed/4lcQ77rei-k"&gt;Link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;What's Data Science and Engineering Workspace? : &lt;a href="https://www.youtube.com/embed/d8hTZhLlWQQ"&gt;Link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;What's SQL Databricks? : &lt;a href="https://www.youtube.com/embed/beHMFhoFzDc"&gt;Link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;What's the Databricks Lakehouse Platform? : &lt;a href="https://www.youtube.com/embed/BdAiu6CoLfA"&gt;Link&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Apart from those resources if you're still curious supported material is attached below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Managed MLflow : &lt;a href="https://www.databricks.com/product/managed-mlflow"&gt;Link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Delta Lake: &lt;a href="https://docs.databricks.com/delta/index.html"&gt;Link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Workspace assets: &lt;a href="https://docs.databricks.com/workspace/workspace-assets.html"&gt;Link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Navigate the workspace: &lt;a href="https://docs.databricks.com/workspace/index.html"&gt;Link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Databricks Machine Learning: &lt;a href="https://docs.databricks.com/machine-learning/index.html"&gt;Link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Databricks runtime: &lt;a href="https://docs.databricks.com/runtime/index.html"&gt;Link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Introduction to Databricks AutoML : &lt;a href="https://docs.databricks.com/machine-learning/automl/index.html"&gt;Link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Introduction to Feature Store: &lt;a href="https://docs.databricks.com/machine-learning/feature-store/index.html"&gt;Link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Introduction to SQL Databricks: &lt;a href="https://docs.databricks.com/sql/index.html"&gt;Link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Introduction to the medallion architecture : &lt;a href="https://learn.microsoft.com/en-us/azure/databricks/lakehouse/medallion"&gt;Link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Add Users and  groups to workspace : &lt;a href="https://docs.databricks.com/administration-guide/users-groups/users.html"&gt;Link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Databricks Compliance: &lt;a href="https://www.databricks.com/trust#compliance"&gt;Link&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  ABOUT ME
&lt;/h2&gt;

&lt;p&gt;I make &lt;strong&gt;#dataEngineering&lt;/strong&gt; &amp;amp; &lt;strong&gt;#machinelearing&lt;/strong&gt; complex problem easy &amp;amp; make a way for new learners to learn fast &amp;amp; smart. Follow me for more content &amp;amp; don't forget to share if you think material is worthy.&lt;/p&gt;

</description>
      <category>lakehouse</category>
      <category>accreditation</category>
      <category>databricks</category>
      <category>exam</category>
    </item>
    <item>
      <title>Databricks Assets ?</title>
      <dc:creator>Qasim H. (aiwithqasim 🚀)</dc:creator>
      <pubDate>Sun, 25 Sep 2022 12:13:01 +0000</pubDate>
      <link>https://forem.com/aiwithqasim/databricks-assets--3e96</link>
      <guid>https://forem.com/aiwithqasim/databricks-assets--3e96</guid>
      <description>&lt;p&gt;Talking about Data Science &amp;amp; Engineering workspace, the classic &lt;strong&gt;&lt;em&gt;Databricks&lt;/em&gt;&lt;/strong&gt; environment for collaboration among Data Scientists, Data Engineers, and Data Analysts. Just mentioning it is the backbone of Databrick’s machine learning environment and provides an environment for accessing and managing all your Databricks assets, you might be asking yourself what sorts of assets I'm talking about? The below figure shows the some of the Data assets &amp;amp; all three Personas assets in Databricks.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uXycEY_b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q01hffwwrmvp96xrli2y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uXycEY_b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q01hffwwrmvp96xrli2y.png" alt="Databricks Assets" width="880" height="357"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sounds Interesting right? Let's address all of them one by one in this blog with some short description to get to know all of them.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tClgGYC2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u09hxvn8l3vsa6k543l0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tClgGYC2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u09hxvn8l3vsa6k543l0.png" alt="Data Assets in Databricks" width="253" height="409"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Data assets&lt;/em&gt;&lt;/strong&gt;, while accessible from the space fall under the category of unity catalog i: e., Databricks data governance solution,&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;These assets include &lt;em&gt;Databases&lt;/em&gt;, &lt;em&gt;Tables&lt;/em&gt; and &lt;em&gt;Views&lt;/em&gt; also included under this umbrella or &lt;em&gt;catalogs&lt;/em&gt;, which is a top-level container that contains the database&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Storage credentials&lt;/em&gt; and &lt;em&gt;external locations&lt;/em&gt; which managed credentials and paths for accessing files and external cloud storage containers&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Share recipients&lt;/em&gt;, which are special assets in principles for use with Delta. Sharing the open-source high-performance secured data sharing protocol developed by Databricks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_3pvJkTs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w3n0pq8tazfn1mfh1x1p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_3pvJkTs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w3n0pq8tazfn1mfh1x1p.png" alt=" Databricks SQL &amp;amp; ML Assests" width="862" height="179"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;These assets like &lt;em&gt;Queries&lt;/em&gt;, &lt;em&gt;Dashboards&lt;/em&gt;, &lt;em&gt;Alerts&lt;/em&gt;, and &lt;em&gt;Endpoints&lt;/em&gt; also, do not fall under the category of Data Science and Engineering workspace, but rather manage and access within Databricks SQL, likewise &lt;em&gt;Experiments&lt;/em&gt; and &lt;em&gt;Models&lt;/em&gt; are managed within Databricks Machine Learning. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Data Science &amp;amp; Engineering workspace, the classic Databricks environment for collaboration among Data Scientists, Data Engineers, and Data Analysts. Just mention it is the backbone of Databrick’s machine learning environment and provides an environment for accessing and managing all your Databricks assets These assets are:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Notebooks&lt;/em&gt;&lt;/strong&gt;, arguably, the centerpiece of the data science and engineering workspace cost to feed a web-based interface to documents that contain a series of cells. These cells can contain commands that operate on data in any of the languages supported by Databricks. Visualizations that provide a visual interpretation of an output narrative text can be employed to document the notebook Magic commands that allow you to perform higher-level operations, such as running, other notebooks invoking, a database utility, and more notebooks that are collaborative. They have a built-in history and users can exchange notes. They can be run interactively or in batch mode as a job through Databricks workflows.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RzNfuHBm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wdyi5bmiint31o87ycv1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RzNfuHBm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wdyi5bmiint31o87ycv1.png" alt="Notebook Assets" width="880" height="165"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Folders&lt;/em&gt;&lt;/strong&gt;provide a file system, like construct within the workspace, to organize workspace assets, such as notebooks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CQJZlEyo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9g680zr24fn79pvdcc0l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CQJZlEyo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9g680zr24fn79pvdcc0l.png" alt="folder" width="880" height="165"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;While notebooks provide a built-in history that can be very handy in many circumstances. The functionality is limited and does not go far to fulfill the requirements of a fully-fledged CI/CD environment. &lt;strong&gt;&lt;em&gt;Repose&lt;/em&gt;&lt;/strong&gt;provides the ability to sync notebooks and files to remote git. Repose provides functionality for Pushing and Pulling, Managing Branches, Viewing Differences &amp;amp; reverting changes. Repos also provide an API for integration with other CI/CD tools. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--A5xE-LMi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gdkz6ghw0aan63vrg6zs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A5xE-LMi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gdkz6ghw0aan63vrg6zs.png" alt="repose" width="880" height="167"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Databrick &lt;strong&gt;&lt;em&gt;Secret&lt;/em&gt;&lt;/strong&gt; fulfills security best practices by providing secure key-value storage, for sensitive information allowing you to easily decouple such material from your code. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--V2eZc7B3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7kveyhhqgaffa2omfqqt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--V2eZc7B3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7kveyhhqgaffa2omfqqt.png" alt="secret" width="880" height="170"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Jobs&lt;/em&gt;&lt;/strong&gt; have the capability of automatically running tasks. Jobs can be simple with a single task or can be large multitask workflows with complex dependencies. Job tasks can be implemented with notebooks, jobs pipelines, or applications written in Python Scala, and Java, or using the spark summit style. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ystfd-cu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2raeb0sgskd1lo2q0k56.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ystfd-cu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2raeb0sgskd1lo2q0k56.png" alt="Jobs" width="880" height="164"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Delta live table is a framework that delivers, a simplified approach for building reliable, maintainable, and testable data processing &lt;strong&gt;&lt;em&gt;pipelines&lt;/em&gt;&lt;/strong&gt;. The main unit of execution in Delta live tables is a pipeline which is a directed acyclic graph, linking data sources to target datasets. pipelines are implemented using notebooks. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oDsCjm5s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tlnk1oulk8ikbrj0ab2n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oDsCjm5s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tlnk1oulk8ikbrj0ab2n.png" alt="pipelines" width="880" height="166"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;&lt;em&gt;cluster&lt;/em&gt;&lt;/strong&gt; is a set of computation resources and configurations on which you run Data, Engineering, Data Science, and Data Analytics workloads such as production ETL pipeline, streaming analytics, Ad-hoc analytics, and Machine Learning. The workloads can consist of a set of commands in a notebook or a workflow that runs jobs or pipelines. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MBvt7Fqv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lltzjherckjtqsg2i0rz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MBvt7Fqv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lltzjherckjtqsg2i0rz.png" alt="cluster" width="880" height="165"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Pools&lt;/em&gt;&lt;/strong&gt; reduce cluster start, and auto-scaling times by maintaining a set of idols ready-to-use virtual machine instances when a cluster is attached to a pool, cluster nodes are created using the pool idle instances, creating new ones as needed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_zljaJ1c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qo98agt2fxp2zdmw4a62.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_zljaJ1c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qo98agt2fxp2zdmw4a62.png" alt="pools" width="880" height="162"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;NOTE: Reference &amp;amp; Images in the blogs are taken from Databricks site &amp;amp; courses.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This is it for this blog, hope you like the blog. Kindly do Follow.&lt;/p&gt;

</description>
      <category>databricks</category>
      <category>databricksassets</category>
      <category>datacatalog</category>
      <category>workspaceasset</category>
    </item>
    <item>
      <title>Using AWS for Text Classification Part-1</title>
      <dc:creator>Qasim H. (aiwithqasim 🚀)</dc:creator>
      <pubDate>Sat, 27 Aug 2022 13:42:23 +0000</pubDate>
      <link>https://forem.com/aws-builders/using-aws-for-text-classification-part-1-1hae</link>
      <guid>https://forem.com/aws-builders/using-aws-for-text-classification-part-1-1hae</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--imtYHl6j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/4200/1%2APRFmXq4Hy52nUj8yPpsHdA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--imtYHl6j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/4200/1%2APRFmXq4Hy52nUj8yPpsHdA.png" alt="Using AWS for Text Classification" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Online conversations are ubiquitous in modern life, spanning industries from video games to telecommunications. This has led to an exponential growth in the amount of online conversation data, which has helped develop state-of-the-art natural language processing (NLP) systems like chatbots and natural language generation (NLG) models. Over time, various NLP techniques for text analysis have also evolved. This necessitates a fully managed service that can be integrated into applications using API calls without the need for extensive machine learning (ML) expertise. AWS offers pre-trained AWS AI services like &lt;a href="https://aws.amazon.com/comprehend/"&gt;Amazon Comprehend&lt;/a&gt;, which can effectively handle NLP use cases involving classification, text summarization, entity recognition, and more to gather insights from text.&lt;/p&gt;

&lt;p&gt;Additionally, online conversations have led to a widespread phenomenon of non-traditional usage of language. Traditional NLP techniques often perform poorly on this text data due to the constantly evolving and domain-specific vocabularies within different platforms, as well as the significant lexical deviations of words from proper English, either by accident or intentionally as a form of adversarial attack.&lt;/p&gt;

&lt;p&gt;In this post, we describe multiple ML approaches for text classification of online conversations with tools and services available on AWS.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before diving deep into this use case, please complete the following prerequisites:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Set up an &lt;a href="https://aws.amazon.com/getting-started/guides/setup-environment/module-one/"&gt;AWS account&lt;/a&gt; and &lt;a href="https://aws.amazon.com/getting-started/guides/setup-environment/module-two/"&gt;create an IAM user&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Set up the &lt;a href="https://aws.amazon.com/getting-started/guides/setup-environment/module-three/"&gt;AWS CLI&lt;/a&gt; and &lt;a href="https://aws.amazon.com/tools/"&gt;AWS SDKs&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;(Optional) Set up your &lt;a href="https://aws.amazon.com/getting-started/guides/setup-environment/module-four/"&gt;Cloud9 IDE environment&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Dataset
&lt;/h2&gt;

&lt;p&gt;For this post, we use the &lt;a href="https://www.kaggle.com/c/jigsaw-unintended-bias-in-toxicity-classification/overview"&gt;Jigsaw Unintended Bias in Toxicity Classification dataset&lt;/a&gt;, a benchmark for the specific problem of classification of toxicity in online conversations. The dataset provides toxicity labels as well as several subgroup attributes such as obscene, identity attack, insult, threat, and sexually explicit. Labels are provided as fractional values, which represent the proportion of human annotators who believed the attribute applied to a given piece of text, which are rarely unanimous. To generate binary labels (for example, toxic or non-toxic), a threshold of 0.5 is applied to the fractional values and comments with values greater than the threshold are treated as the positive class for that label.&lt;/p&gt;

&lt;h2&gt;
  
  
  Subword embedding and RNNs
&lt;/h2&gt;

&lt;p&gt;For our first modeling approach, we use a combination of subword embedding and recurrent neural networks (RNNs) to train text classification models. Subword embeddings were introduced by &lt;a href="https://arxiv.org/abs/1607.04606"&gt;Bojanowski et al. in 2017&lt;/a&gt; as an improvement upon previous word-level embedding methods. Traditional Word2Vec skip-gram models are trained to learn a static vector representation of a target word that optimally predicts that word’s context. Subword models, on the other hand, represent each target word as a bag of the character n-grams that make up the word, where an n-gram is composed of a set of n consecutive characters. This method allows for the embedding model to better represent the underlying morphology of related words in the corpus as well as the computation of embeddings for novel, out-of-vocabulary (OOV) words. This is particularly important in the context of online conversations, a problem space in which users often misspell words (sometimes intentionally to evade detection) and also use a unique, constantly evolving vocabulary that might not be captured by a general training corpus.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://aws.amazon.com/sagemaker/"&gt;Amazon SageMaker&lt;/a&gt; makes it easy to train and optimize an unsupervised subword embedding model on your own corpus of domain-specific text data with the built-in &lt;a href="https://docs.aws.amazon.com/sagemaker/latest/dg/blazingtext.html"&gt;BlazingText algorithm&lt;/a&gt;. We can also download existing general-purpose models trained on large datasets of online text, such as the following &lt;a href="https://fasttext.cc/docs/en/english-vectors.html"&gt;English language models available directly from fastText&lt;/a&gt;. From your SageMaker notebook instance, simply run the following to download a pre-trained fastText model:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;!wget -O vectors.zip [https://dl.fbaipublicfiles.com/fasttext/vectors-english/crawl-300d-2M-subword.zip](https://dl.fbaipublicfiles.com/fasttext/vectors-english/crawl-300d-2M-subword.zip) 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Whether you’ve trained your own embeddings with BlazingText or downloaded a pre-trained model, the result is a zipped model binary that you can use with the gensim library to embed a given target word as a vector-based on its constituent subwords:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
After we preprocess a given segment of text, we can use this approach to generate a vector representation for each of the constituent words (as separated by spaces). We then use SageMaker and a deep learning framework such as PyTorch to train a customized RNN with a binary or multilabel classification objective to predict whether the text is toxic or not and the specific sub-type of toxicity based on labeled training examples.&lt;/p&gt;

&lt;p&gt;To upload your preprocessed text to &lt;a href="http://aws.amazon.com/s3"&gt;Amazon Simple Storage Service&lt;/a&gt; (Amazon S3), use the following code:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
&lt;br&gt;
To initiate scalable, multi-GPU model training with SageMaker, enter the following code:&lt;br&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
&lt;br&gt;
Within &lt;em&gt;&lt;/em&gt;, we define a PyTorch Dataset that is used by train.py to prepare the text data for training and evaluation of the model:&lt;br&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
&lt;br&gt;
Note that this code anticipates that the vectors.zip file containing your fastText or BlazingText embeddings will be stored in &lt;em&gt;&lt;/em&gt;.

&lt;p&gt;Additionally, you can easily deploy pretrained fastText models on their own to live SageMaker endpoints to compute embedding vectors on the fly for use in relevant word-level tasks. See the following &lt;a href="https://github.com/aws/amazon-sagemaker-examples/blob/master/introduction_to_amazon_algorithms/blazingtext_hosting_pretrained_fasttext/blazingtext_hosting_pretrained_fasttext.ipynb"&gt;GitHub example&lt;/a&gt; for more details.&lt;/p&gt;

&lt;p&gt;In the Next Part, I’ll explain how to use a &lt;strong&gt;Transformer with a Hugging Face&lt;/strong&gt; for text classification in AWS. The link to Part 2 will be given soon.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>nlp</category>
      <category>deeplearning</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Data Science Process</title>
      <dc:creator>Qasim H. (aiwithqasim 🚀)</dc:creator>
      <pubDate>Sat, 27 Aug 2022 08:13:48 +0000</pubDate>
      <link>https://forem.com/aiwithqasim/data-science-process-5081</link>
      <guid>https://forem.com/aiwithqasim/data-science-process-5081</guid>
      <description>&lt;h2&gt;
  
  
  Data Science Process
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sXmIso-M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2ALeoAkY_pldNp7d1iSQKgCQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sXmIso-M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2ALeoAkY_pldNp7d1iSQKgCQ.png" alt="Fig1: data science Process" width="635" height="487"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Why is it called Data Science?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;So, what exactly does it mean to &lt;em&gt;do&lt;/em&gt; data science?&lt;/p&gt;

&lt;p&gt;Professionals who do data science are driven by a desire to ask questions. Questions like, how many customers prefer website A to website B? Are wildfires in California getting bigger? &lt;a href="https://pudding.cool/2018/06/makeup-shades/"&gt;Is Fenty Makeup more inclusive than other foundations&lt;/a&gt;?&lt;/p&gt;

&lt;p&gt;To answer these questions, data scientists use a process of experimentation and exploration to find answers. Sound familiar? Like other scientific fields, data science follows the &lt;em&gt;scientific method&lt;/em&gt;. But the data science process also includes steps particular to working with large, digital datasets.&lt;/p&gt;

&lt;p&gt;The process generally goes as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Ask a question&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Determine the necessary data&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Get the data&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Clean and organize the data&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Explore the data&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Model the data&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Communicate your findings&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this lesson, we’re going to dig into the data science process. While we present these steps as a linear process, it’s important to keep in mind that you’ll often repeat steps or do things out of order. Consider this to be a set of guidelines to get you started.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1-Determine the Necessary Data
&lt;/h2&gt;

&lt;p&gt;After you have a question, you have to make an educated guess about what you think the answer might be. This educated guess is known as a &lt;em&gt;hypothesis&lt;/em&gt; and helps to determine the data you need to collect.&lt;/p&gt;

&lt;p&gt;It’s important to remember that the data you decide to collect can’t just be the data that you think is going to answer your question. We can’t carefully select for what we &lt;em&gt;know&lt;/em&gt; will prove the hypothesis is correct — actually, the data needs to &lt;em&gt;disprove&lt;/em&gt; the hypothesis.&lt;/p&gt;

&lt;h3&gt;
  
  
  What do we mean by that?
&lt;/h3&gt;

&lt;p&gt;In science, it’s actually impossible to &lt;em&gt;prove&lt;/em&gt; that something is true. Rather, we try and show that we’re &lt;em&gt;really, really&lt;/em&gt; confident that it’s not false. That’s because the only way we can say we’re 100% positive our hypothesis is correct is to collect all the data for an entire population — and that’s pretty much impossible!&lt;/p&gt;

&lt;p&gt;So, how do we determine what data is necessary to collect?&lt;/p&gt;

&lt;p&gt;First, we need to determine &lt;strong&gt;what&lt;/strong&gt; data could disprove our hypothesis. For example, if our hypothesis is that Sriracha is the most popular hot sauce in the entire world, we can’t just survey a group of 100 people and ask if they prefer Sriracha over Frank’s Red Hot. We would need to look at how Sriracha consumption compares to the consumption of multiple other brands of hot sauce.&lt;/p&gt;

&lt;p&gt;Next, we need to figure out &lt;strong&gt;how much&lt;/strong&gt; data to collect. While it’s preferable to get information for an entire population, that process is often difficult or impractical. So instead, we collect a &lt;em&gt;sample&lt;/em&gt; set of data, a smaller amount of data that are representative of the entire population.&lt;/p&gt;

&lt;p&gt;How do we ensure that our sample is representative? We figure out the necessary number of samples that have similar descriptive statistics to the entire population. For example, say that we want to know the length of oysters in Long Island. Our hypothesis is that they’re about three inches. If we collect five oyster shells, they may only measure, on average, two inches. However, if we collect 145 more, we’ll find that the average is closer to three inches.&lt;/p&gt;

&lt;p&gt;Rule of thumb: the larger the sample size and the more diverse your dataset is, the more confident you’ll be in your results. We don’t want to go through the trouble of designing and running an experiment only to discover that we don’t have enough information to make a good decision!&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2-Getting Data
&lt;/h2&gt;

&lt;p&gt;Once you’ve determined which data you need, it’s time to collect it!&lt;/p&gt;

&lt;p&gt;Data collection can be as simple as locating a file or as complicated as designing and running an experiment.&lt;/p&gt;

&lt;p&gt;Here are a couple of different ways to get data:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Active data collection&lt;/strong&gt; — you’re setting up specific conditions in which to get data. You’re on the hunt. Examples include running experiments and surveys.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Passive data collection&lt;/strong&gt; — you’re looking for data that already exists. You’re foraging for data. Examples include locating datasets and web scraping.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are a couple of things to keep in mind when we collect data. An important one is the size of our dataset. Remember that we usually can’t get data from an entire population, so we need to have an appropriate sample that is representative of the larger population. If you’re ever unsure about the size of your dataset, use a sample size calculator.&lt;/p&gt;

&lt;p&gt;Another thing to keep in mind is that errors and bias can occur in data collection. For example, early facial recognition software was trained on datasets that disproportionately contained portraits of white males. Other developers continued to use these datasets and for many years, facial recognition software was not adequate at recognizing other faces. Again, having a larger sample size is one way to mitigate errors and bias.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3-Cleaning Data
&lt;/h2&gt;

&lt;p&gt;As soon as you get your data, you’ll be excited to get started. But wait just one moment — we might be ready to go, but how can we be sure that our data is?&lt;/p&gt;

&lt;p&gt;Data is typically organized in columns and rows as you’d see in a spreadsheet. But raw data can actually come in a variety of file types and formats. This is especially true if you’re getting your data from elsewhere, like public datasets.&lt;/p&gt;

&lt;p&gt;We as humans may be able to understand the organizing logic of a dataset, but computers are very literal. A missing value or unlabeled column can completely throw them off their game. Even worse — your program could still run, but your outcomes would be incorrect. Ouch!&lt;/p&gt;

&lt;p&gt;An important part of the data science process is to clean and organize our datasets, sometimes referred to as &lt;em&gt;data wrangling&lt;/em&gt;. Processing a dataset could mean a few different things. For example, it may mean getting rid of invalid data or correctly labeling columns.&lt;/p&gt;

&lt;p&gt;The Python library &lt;a href="https://pandas.pydata.org/pandas-docs/stable/"&gt;Pandas&lt;/a&gt; is a great tool for importing and organizing datasets. You can use Pandas to convert a spreadsheet document, like a CSV, into easily readable tables and charts known as &lt;em&gt;DataFrames&lt;/em&gt;. We can also use libraries like Pandas to &lt;em&gt;transform&lt;/em&gt; our datasets by adding columns and rows to an existing table, or by merging multiple tables together!&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4-Explore the Data
&lt;/h2&gt;

&lt;p&gt;Now that our data is organized, we can begin looking for insights. But just because our data is all cleaned up, we still can’t learn a lot by staring at tables. In order to truly explore our data, we’ll need to go a few steps further.&lt;/p&gt;

&lt;p&gt;Exploring a dataset is a key step because it will help us quickly understand the data we’re working with and allow us to determine if we need to make any changes before moving forward. Changes could include some additional dataset cleaning, collecting more data, or even modifying the initial question we’re trying to answer. Remember: data science is not necessarily a linear process.&lt;/p&gt;

&lt;p&gt;There are two strategies for exploring our data:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Statistical calculations&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Data visualizations&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  STATISTICAL CALCULATIONS
&lt;/h3&gt;

&lt;p&gt;When we first get a dataset, we can use descriptive statistics to get a sense of what it contains. Descriptive statistics summarize a given dataset using statistical calculations, such as the average (also known as mean), median, and standard deviation. We can immediately learn what are common values in our dataset and how to spread out the dataset is (are most of the values the same, or are they wildly different?).&lt;/p&gt;

&lt;p&gt;We can use a Python module known as NumPy to calculate descriptive statistics values. NumPy (short for Numerical Python) supplies short commands to easily perform statistical calculations, like np.mean(), which calculates the mean of a dataset.&lt;/p&gt;

&lt;h3&gt;
  
  
  DATA VISUALIZATIONS
&lt;/h3&gt;

&lt;p&gt;Another way we can quickly get a sense of our data is by visualizing it. The practice of data visualization enables us to see patterns, relationships, and outliers, and how they relate to the entire dataset. Visualizations are particularly useful when working with large amounts of data.&lt;/p&gt;

&lt;p&gt;Python data visualization libraries like Matplotlib and Seaborn can display distributions and statistical summaries for easy comparison. The JavaScript library D3 enables the creation of interactive data visualizations, which are useful for modeling different scenarios.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5 -Modeling and Analysis
&lt;/h2&gt;

&lt;p&gt;Data in hand, we can begin to dig in and analyze what we have. To analyze our data, we’ll want to create a &lt;em&gt;model&lt;/em&gt;. Models are abstractions of reality, informed by real data, that allow us to understand situations and make guesses about how things might change given different variables.&lt;/p&gt;

&lt;p&gt;A model gives us the relationship between two or more variables. For example, you could build a model that relates the number of grade school children in a neighborhood with sales of toys, or a model that connects the number of trucks that travel certain roads with the amount of a city’s budget assigned to road maintenance.&lt;/p&gt;

&lt;p&gt;Models allow us to analyze our data because once we begin to understand the relationships between different variables, we can make inferences about certain circumstances. Why is it that the sales of toys increases as the number of grade school children grows? Well, maybe it’s because parents are buying their children more toys.&lt;/p&gt;

&lt;p&gt;Models are also useful for informing decisions, since they can be used to predict unknowns. Once we understand a relationship between variables, we can introduce unknown variables and calculate different possibilities. If the number of children in the neighborhood increases, what do we predict will happen to the sales of toys?&lt;/p&gt;

&lt;p&gt;As we collect more data, our model can change, allowing us to draw new insights and get a better idea of what might happen in different circumstances. Our models can tell us whether or not an observed variance is within reason, is due to an error, or possibly carries significance. How would our understanding of our model change if in 2016 we discovered that the number of toys &lt;em&gt;did not&lt;/em&gt; increase, but instead, decreased? We’d want to look for an explanation as to why this year did not fit the trend.&lt;/p&gt;

&lt;p&gt;Models can be expressed as mathematical equations, such as the equation for a line. You can use data visualization libraries like Matplotlib and Seaborn to visualize relationships. If you pursue machine learning, you can use the Python package scikit-learn to build predictive models, such as linear regressions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6-Communicating Findings
&lt;/h2&gt;

&lt;p&gt;After you’ve done your analyses, built your models, and gotten some results, it’s time to communicate your findings.&lt;/p&gt;

&lt;p&gt;Two important parts of communicating data are &lt;em&gt;visualizing&lt;/em&gt; and &lt;em&gt;storytelling&lt;/em&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  VISUALIZING
&lt;/h3&gt;

&lt;p&gt;As we saw earlier, visualizations are helpful for exploring and understanding our data; however, they are also very useful for communicating results. So, can you just reuse the ones you already have? Not necessarily. The answer depends on your audience. If you’re giving a presentation at a conference for data scientists who also work at dating companies, then sure, they’ll probably be able to interpret your graphs. But if you’re writing an article for Medium, you’ll probably want to simplify your visualizations and style them so they’re easy to read and highly engaging.&lt;/p&gt;

&lt;h3&gt;
  
  
  STORYTELLING
&lt;/h3&gt;

&lt;p&gt;It’s also important to remember that visualizations can’t always stand on their own — they need to tell a story. Storytelling is an important part of data science because it gives meaning to the data. In fact, data storytelling is an important practice in its own right. Contextualizing your findings and giving them a narrative draws people into your work and enables you to convince them as to why these results are important and why they should make a certain decision.&lt;br&gt;
To do practice of the above steps follow the link below:&lt;br&gt;
GitHub: &lt;a href="https://github.com/qasim1020/medium-code/tree/main/data%20science%20process"&gt;medium-code/data science process at main · qasim1020/medium-code (github.com)&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Reference: &lt;a href="https://www.codecademy.com/"&gt;https://www.codecademy.com/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>datascience</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
