<?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 Bruce Yang on Medium]]></title>
        <description><![CDATA[Stories by Bruce Yang on Medium]]></description>
        <link>https://medium.com/@bruceyanghy?source=rss-7d4d17cde259------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*Ldq7Tz_soDSaJsGJ6sgYYg.jpeg</url>
            <title>Stories by Bruce Yang on Medium</title>
            <link>https://medium.com/@bruceyanghy?source=rss-7d4d17cde259------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 16 May 2026 22:57:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bruceyanghy/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[NLP and Deep Learning All-in-One Part III: Transformer, BERT, and XLNet]]></title>
            <link>https://medium.com/@bruceyanghy/nlp-and-deep-learning-all-in-one-part-iii-transformer-bert-and-xlnet-c090d7fc7982?source=rss-7d4d17cde259------2</link>
            <guid isPermaLink="false">https://medium.com/p/c090d7fc7982</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[xlnet]]></category>
            <category><![CDATA[attention]]></category>
            <category><![CDATA[bert]]></category>
            <category><![CDATA[nlp]]></category>
            <dc:creator><![CDATA[Bruce Yang]]></dc:creator>
            <pubDate>Sat, 22 Feb 2020 07:15:12 GMT</pubDate>
            <atom:updated>2020-08-18T05:33:02.454Z</atom:updated>
            <content:encoded><![CDATA[<h4>Attention Based Models Interview Questions</h4><h4>1. Why choose Attention based models over Recurrent based ones?</h4><h4>2. What is Attention? What’s wrong with seq2seq model?</h4><h4>3. What’s Self-Attention?</h4><h4>4. How to implement Self-Attention?</h4><h4>5. What is Transformer? <strong>What is Multi-head self-attention?</strong></h4><h4>6. What is BERT? Why choose Bert over Embedding models?</h4><h4>7. What’s the difference between BERT and other traditional language models? or Why is Masked Language Modeling more effective than Sequential Language Modeling?</h4><h4>8. What’s the flaw of Transformer? How does BERT solve that problem?</h4><h4>9. How does BERT do classification?</h4><h4>10. What type of classification tasks can BERT do?</h4><h4>11. How to do BERT fine-tuning? what hyper-parameters does BERT use?</h4><h4>12. What’s wrong with BERT? What’s its limitations?</h4><h4>13. What is XLNet? Why Choose XLNet over BERT?</h4><h4>14. What’s the difference between BERT and XLNet [CLS] and [SEP] pattern?</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c090d7fc7982" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NLP and Deep Learning All-in-One Part II: Word2vec, GloVe, and fastText]]></title>
            <link>https://medium.com/@bruceyanghy/nlp-and-deep-learning-all-in-one-part-ii-word2vec-glove-and-fasttext-184bd03a7ba?source=rss-7d4d17cde259------2</link>
            <guid isPermaLink="false">https://medium.com/p/184bd03a7ba</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[fasttext]]></category>
            <category><![CDATA[word2vec]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Bruce Yang]]></dc:creator>
            <pubDate>Fri, 21 Feb 2020 04:42:28 GMT</pubDate>
            <atom:updated>2020-08-18T05:34:44.784Z</atom:updated>
            <content:encoded><![CDATA[<h4>Embedding Based Models Interview Questions</h4><h4>1. What are some of the traditional ways to represent words in numeric vectors?</h4><h4>2. What is Word Embedding or Word2vec?</h4><h4>3. What are the 2 architectures of Word2vec?</h4><h4>4. How to train Word2vec (Skip-gram)?</h4><h4>5. What are the pros and cons for Word2vec?</h4><h4><strong>6. What is GloVe? </strong>How is GloVe different from Word2vec?</h4><h4>7. What is fastText? How is fastText different from Word2vec?</h4><h4>8. Why choose fastText over Word2vec?</h4><h4>9. How to handle Out-of-Vocabulary words?</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=184bd03a7ba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NLP and Deep Learning All-in-one Part I: RNN and LSTM]]></title>
            <link>https://medium.com/@bruceyanghy/nlp-and-deep-learning-all-in-one-part-i-rnn-and-lstm-db3f9cb626d8?source=rss-7d4d17cde259------2</link>
            <guid isPermaLink="false">https://medium.com/p/db3f9cb626d8</guid>
            <category><![CDATA[lstm]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning-ai]]></category>
            <category><![CDATA[rnn]]></category>
            <dc:creator><![CDATA[Bruce Yang]]></dc:creator>
            <pubDate>Thu, 20 Feb 2020 07:23:34 GMT</pubDate>
            <atom:updated>2020-08-18T05:36:38.741Z</atom:updated>
            <content:encoded><![CDATA[<h3>NLP and Deep Learning All-in-One Part I: RNN and LSTM</h3><h4><strong>Recurrent Based </strong>Models Interview Questions</h4><h4>1. What is Recurrent Neural Network (RNN)?</h4><h4><strong>2. How to train RNN?</strong></h4><h4><strong>3. What are the Advantages of RNN?</strong></h4><h4><strong>4. What are the Disadvantages of RNN?</strong></h4><h4><strong>5. What is Gradient Vanishing and </strong>Exploding<strong> Problem?</strong></h4><h4><strong>6. What are some the general ways to handle the vanishing gradient problem?</strong></h4><h4><strong>7. What is Long Short-Term Memory (LSTM)?</strong></h4><h4><strong>8. What is Cell State?</strong></h4><h4><strong>9. What is Gating Mechanism?</strong></h4><h4>10. How to update cell state?</h4><h4>11. <strong>How does LSTMs forget gate structure avoid vanishing gradient? how does the forget gate manipulate these internal vectors?</strong></h4><h4>12. What is a Batch? What is an Epoch? What’s the difference?</h4><h4>13. How to choose the <strong>Number of Hidden Layers?</strong></h4><h4>14. How to choose the <strong>Number of Neurons in the Hidden Layers?</strong></h4><h4>15. What is Dropout?</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db3f9cb626d8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Crack the Machine Learning Phone Interview Guide]]></title>
            <link>https://medium.com/@bruceyanghy/crack-the-machine-learning-phone-interview-guide-9e4dc316f65b?source=rss-7d4d17cde259------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e4dc316f65b</guid>
            <category><![CDATA[machine-learning-models]]></category>
            <category><![CDATA[random-forest]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[phone-interview]]></category>
            <dc:creator><![CDATA[Bruce Yang]]></dc:creator>
            <pubDate>Tue, 16 Jul 2019 19:47:31 GMT</pubDate>
            <atom:updated>2020-10-10T00:27:27.706Z</atom:updated>
            <content:encoded><![CDATA[<h4>Machine Learning Interview Questions</h4><p>According to Medium’s policies, I can only put the interview questions here, not the answers. For the answers to these interview questions, you have to refer to my personal blog:</p><p><a href="https://bruceyanghy.github.io/posts/machine_learning_breadth/index_breadth.html">Bruce Yang&#39;s Blog</a></p><p>Machine Learning is the crucial part of Data Scientist’s interview, because this skill is like the Force for a Jedi master.</p><p>Different types of machine learning problems can be asked during an interview. I am only focusing on how to crack the phone interview in this blog. For an On-Site interview, you probably need to hand-write some of the machine learning algorithms in Python. For example, implement a Logistics Regression in Python.</p><h3>Machine Learning Interview Questions</h3><ol><li>What is Bias-Variance Tradeoff?</li><li>What is the curse of dimensionality?</li><li>What is Multi-Collinearity? Why is it an issue?</li><li>How do you detect multicollinearity in Model Data?</li><li>What are the remedies of problem of Multi-collinearity?</li><li>What are Outliers? Leverage &amp; Influential points?</li><li>How can we deal with Outliers?</li><li>If you have set of data and do regression, what if you duplicate all the data and do regression on the new data set?</li><li>What is the primary difference between R square and adjusted R square?</li><li>What’s Gradient Descent?</li><li>How to implement Gradient Descent?</li><li>What’s the difference between confidence interval and predicted interval?</li><li>Why do you need Cross-Validation?</li><li>How to detect overfitting?</li><li>How do you handle overfitting problem?</li><li>How to handle missing data?</li><li>You have a train-set, a dev-set and a test-set, how did you manage the distribution of those sets?</li><li>How to handle imbalanced data?</li><li>What are the methods for over-sampling?</li><li>What is Confusion Matrix? What’s TP, TN, FP, FN, Precision and Recall?</li><li>What is ROC and AUC?</li><li>How to handle categorical variables?</li><li>What is the difference between Generative models and Discriminative models?</li><li>What is linear regression? What are the steps of the algorithm?</li><li>What are the assumptions of linear regression?</li><li>What plot is best suited to test the linear relationship of independent and dependent continuous variables?</li><li>Let’s assume that the errors break the normality assumption, it’s not a Gaussian distribution, can you still use linear regression?</li><li>What is the cost function of linear regression?</li><li>How do you interpret a Q-Q plot in a linear regression model?</li><li>What is the importance of the F-test in a linear model?</li><li>What are the Advantages/Disadvantages of linear regression?</li><li>What is regularization?</li><li>What’s the difference between Lasso and Ridge? What’s the cost function?</li><li>Why does Lasso can make coefficients to 0 but Ridge can’t?</li><li>What is lambda λ?</li><li>What are the Advantages/Disadvantages of Lasso and Ridge?</li><li>What’s Logistic Regression? How to implement Logistic Regression?</li><li>What’s the cost function of logistic regression?</li><li>What does Cross-Entropy measure?</li><li>What’s an Entropy?</li><li>How to tune hyperparameters of logistic regression? What does the parameter mean?</li><li>What are the Advantages/Disadvantages of Logistic Regression?</li><li>What are the basic concepts of Naïve Bayes? What problem does it solve?</li><li>What are the assumptions of Naïve Bayes?</li><li>What is Bayes’ Theorem?</li><li>How to implement Naïve Bayes?</li><li>What are the Advantages/Disadvantages of Naïve Bayes?</li><li>What are the variations of Naïve Bayes?</li><li>What are the applications of NaïveBayes?</li><li>What’s KNN? How to implement KNN?</li><li>What are the Advantages/Disadvantages of KNN?</li><li>What’s K-means?</li><li>How to implement K-means?</li><li>How to choose K?</li><li>How to evaluate clusters?</li><li>When to stop the iteration?</li><li>How to do categorical data clustering?</li><li>What about a data set considering both numerical and categorical values?</li><li>What are the Advantages/Disadvantages of K-means?</li><li>What’s Decision Tree?</li><li>How to implement Classification Tree? What if the features are categorical values? What if the features are numerical values?</li><li>How to implement Regression Tree?</li><li>How to decide which feature is more important? What should be at the top of our decision tree? The root node?</li><li>When to stop splitting?</li><li>What is tree pruning?</li><li>What metrices to use to evaluate classification tree?</li><li>What are the Advantages/Disadvantages of Decision Tree?</li><li>What’s Random Forest? How to implement Random Forest?</li><li>Why randomly restrict the features in each split? Build a random forest at each split the algorithm is not allowed to consider a majority of the available predictors. Why?</li><li>What’s the difference between bagging and boosting?</li><li>How to tune hyperparameters of Random Forest?</li><li>What are the Advantages/Disadvantages of Random Forest?</li><li>What’s Ada-boost? How to implement Ada-boost?</li><li>Why use exponential function as loss function?</li><li>What are the Advantages/Disadvantages of Ada-boost?</li><li>What’s Gradient Boosting? How to implement Gradient Boosting?</li><li>What are the Advantages/Disadvantages of Gradient Boosting?</li><li>What’s the difference between XGBoost and GBM?</li><li>What’s Support Vector Machine (SVM)? How to implement SVM?</li><li>What’s Kernel Trick?</li><li>What’s the cost function of SVM?</li><li>What are the Advantages/Disadvantages of SVM?</li><li>What’s PCA? How to implement PCA?</li><li>What is the truncation of PCA?</li><li>How would you choose the value of K? The eigenvectors you will take to next stage?</li><li>What are the Advantages/Disadvantages of PCA?</li><li>What are the basic concepts of Neural Network?</li><li>How to implement Neural Network? What’s feedforward? What’s backpropagation?</li><li>What’s the cost function of Neural Network?</li><li>What are the activation functions of Neural Network?</li><li>What are the Advantages/Disadvantages of Neural Network?</li></ol><p><em>Disclaimer: Views and ideas expressed in this post are my personal, individual and unique perspectives, and not those of my employer.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e4dc316f65b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[End to End Guide for Setting up AWS SageMaker Ground Truth Public Data Labeling Jobs]]></title>
            <link>https://medium.com/@bruceyanghy/end-to-end-guide-for-setting-up-aws-sagemaker-ground-truth-public-data-labeling-jobs-8732cf49b865?source=rss-7d4d17cde259------2</link>
            <guid isPermaLink="false">https://medium.com/p/8732cf49b865</guid>
            <category><![CDATA[amazon-sagemaker]]></category>
            <category><![CDATA[mechanical-turk]]></category>
            <category><![CDATA[data-labeling]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Bruce Yang]]></dc:creator>
            <pubDate>Thu, 11 Jul 2019 02:59:09 GMT</pubDate>
            <atom:updated>2020-08-18T23:16:26.441Z</atom:updated>
            <content:encoded><![CDATA[<h4>AWS Data Labeling</h4><p>According to AWS: “Amazon SageMaker Ground Truth helps you build training datasets for machine learning.”</p><p><a href="https://aws.amazon.com/sagemaker/groundtruth/">Machine Learning Labeling - Amazon SageMaker Ground Truth - AWS</a></p><p>Basically, you put your unlabeled datasets into AWS, and AWS will hire someone to do the label for you.</p><p>This service is crucial to Data Scientist, it saves a lot of labeling time.</p><p>AWS claims 3 Benefits of this service:</p><ol><li>Reduce data labeling costs by up to 70%.</li><li>Work with public and private human labelers.</li><li>Achieve accurate results quickly.</li></ol><p>Let us walk through this data labeling process step by step by showing a real-world example.</p><p><strong>Data Sources</strong>: I am using Kaggle’s Quora Insincere Questions Classification Competition Training data as our example data to label. It already has the label-“target”, so we can test the quality of SageMaker’s data labeling.</p><p><a href="https://www.kaggle.com/c/quora-insincere-questions-classification/data">Quora Insincere Questions Classification</a></p><p><strong>Input Data Prepare</strong>:</p><p>Sagemaker’s default Text Classification mode requires CSV format data in one piece without any newline character such as “/n, /n/r, /n/n”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F9mx59Qb_eUoacRee6BGOw.png" /></figure><p>I attached a jupyter notebook script to do the data prepare &amp; preprocessing here:</p><p><a href="https://github.com/BruceYanghy/AWS-SageMaker-Data-Labeling/blob/master/DATA_sagemaker_input_data_prepare.ipynb">BruceYanghy/AWS-SageMaker-Data-Labeling</a></p><p><strong>Steps to Deploy a AWS SageMaker Data Labeling job</strong>:</p><p>I assume you have already created an AWS Account and know how to create an S3 bucket.</p><p><strong>Step 1</strong>: Create an S3 bucket and make sure to turn off “Block all public access”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*5RKW9cx-PnyKg3O1kDabRQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*h0aniF3r_8gA5bfIux2sLw.png" /></figure><p><strong>Step 2</strong>: Create a folder with well-defined name and put your data-set into this folder</p><p>Here I use “test-quora-200-36c”, because I randomly select 200 samples and I use $0.36/data as price.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*PZvWDZCTfduZqNFLxws3XQ.png" /></figure><p><strong>Step 3</strong>: Navigate to AWS SageMaker Dashboard, Click Labeling jobs and hit ‘Create labeling job’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WQoVs0w3mEGm_DP0e4a3yA.png" /></figure><p><strong>Step 4</strong>: Job name, Input &amp; Output dataset location, IAM Role and Task type</p><p><strong>Job name</strong>: come up with an unique and meaningful name</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Ing-lSvEwYUpNfv6OyH1A.png" /></figure><p><strong>Input dataset location</strong>: this is the most important one</p><p>Hit ‘Create manifest file’, select ‘Text’, paste S3 path, in this case is: s3://test-label/test-quora-200–36c/</p><p>Click ‘Create’ and wait about 1–2 minutes, it will automatically create a manifest file, you can download it and check it out, it’s in the same S3 folder.</p><p>Select ‘Use this manifest’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nvctaHMNgbaz_HPclp1CrA.png" /></figure><p><strong>Output dataset location</strong>: s3://test-label/test-quora-200-36c/</p><p>I use the same S3 folder, you can create another folder but it’s easy to forget where it is.</p><p><strong>IAM Role</strong>: Make sure to create an IAM role</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*_ncauw6r91gVz4SeOTJXyg.png" /></figure><p><strong>Task type</strong>: Select ‘Text classification’ and click Next</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*G81FHvIzwrlQ51_3U-aMbw.png" /></figure><p><strong>Step 5</strong>: Worker types, Price per task, Automated data labeling, and Number of workers per dataset object</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*xE8flDlRcLS6-522T6TnBg.png" /></figure><p><strong>Price per task:</strong></p><p>low complexity tasks: $0.012</p><p>Medium complexity tasks: from $0.024 to $0.24</p><p>High complexity tasks: $0.36 to $1.2</p><p>If you are doing image labeling like ‘Cat or Dog’, then low complexity cost would be fine, but for text classification you probably want to choose medium or even high complexity costs to in order to get a high quality labeled data.</p><p><strong>Number of workers per dataset object:</strong></p><p>More workers more costs and more consistency:</p><p>Here I choose $0.36 and 3 workers, then it’s gonna be $1.08 per data cost.</p><p>In the end, this is a majority vote label.</p><p><strong>Step 6</strong>: <strong>Instructions</strong></p><p>You want to write as more details as possible. Here I copy the description from Kaggle.</p><p><a href="https://www.kaggle.com/c/quora-insincere-questions-classification/data">Quora Insincere Questions Classification</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*Lzt7EBCEgR3XcKKM0hK8HA.png" /></figure><p>Click Preview to see what it looks like for your labeler.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*P1dx1_7nbq_9w8gh8bNzVA.png" /></figure><p><strong>Step 7</strong>: Collect the outputs</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/444/1*QdvTOyQ-qrvZV2pKtz14kg.png" /></figure><p>The output file is always in the /manifests/output/output.manifest</p><p>You can just download it from S3, change to .json because it’s a json file.</p><p>It took AWS Mechanical Turk 15 minutes to finish the 200 questions’ labeling job which is pretty fast.</p><p>Let’s evaluate the data quality by compare it with the true label.</p><p><strong>Output Data Preprocessing &amp; Quality Test</strong>:</p><p>I also attached a jupyter notebook script to do the data preprocessing &amp; quality test here:</p><p><a href="https://github.com/BruceYanghy/AWS-SageMaker-Data-Labeling/blob/master/DATA_sagemaker_output_preprocess_and_quality_test.ipynb">BruceYanghy/AWS-SageMaker-Data-Labeling</a></p><p>Here is the Evaluation Metrics:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*DgHpClQgnunPfFSkSWG0iw.png" /></figure><p>We have 10 false positive and 13 false negative. Not bad! If we increase the price/label, I am sure the quality will increase.</p><p>Thanks!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8732cf49b865" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS EC2 Launch Jupyter Notebook Server/Jupyter Lab with Screen]]></title>
            <link>https://medium.com/@bruceyanghy/aws-ec2-launch-jupyter-notebook-server-jupyter-lab-with-screen-daee4429cc4a?source=rss-7d4d17cde259------2</link>
            <guid isPermaLink="false">https://medium.com/p/daee4429cc4a</guid>
            <category><![CDATA[jupyter-notebook]]></category>
            <category><![CDATA[ec2-instance]]></category>
            <category><![CDATA[jupyterlab]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[ssh]]></category>
            <dc:creator><![CDATA[Bruce Yang]]></dc:creator>
            <pubDate>Sun, 09 Jun 2019 02:54:06 GMT</pubDate>
            <atom:updated>2019-07-30T20:56:57.270Z</atom:updated>
            <content:encoded><![CDATA[<h3>AWS EC2 Launch Jupyter Notebook/Lab Server with linux screen</h3><p><strong>Part 1: </strong>Create AWS EC2 Instance</p><p><a href="https://medium.com/@GalarnykMichael/aws-ec2-part-1-creating-ec2-instance-9d7f8368f78a">AWS EC2: Create EC2 Instance (Linux)</a></p><p><strong>Part 2</strong>: SSH to your EC2 instance (Ubuntu)</p><p>In your terminal with keypem.pem in your current folder:</p><pre>sudo ssh -i “keypem.pem” ubuntu@ec2–ip-address.region.compute.amazonaws.com</pre><p><a href="https://medium.com/@alexjsanchez/python-3-notebooks-on-aws-ec2-in-15-mostly-easy-steps-2ec5e662c6c6">Jupyter Notebooks on AWS EC2 in 12 (mostly easy) steps [updated April 2019]</a></p><p><strong>Part 3</strong>: Install Anaconda on Ubuntu</p><p><a href="https://linuxize.com/post/how-to-install-anaconda-on-ubuntu-18-04/">How to Install Anaconda on Ubuntu 18.04</a></p><p><strong>Part 4</strong>: Start a Jupyter Notebook/Jupyter Lab Server</p><p><a href="https://hackernoon.com/aws-ec2-part-4-starting-a-jupyter-ipython-notebook-server-on-aws-549d87a55ba9">AWS EC2: Start a Jupyter (IPython) Notebook Server</a></p><p><strong>Step 1</strong>: In the terminal of your EC2 Ubuntu environment</p><pre>ipython</pre><p><strong>Step 2</strong>: In ipython</p><pre>from IPython.lib import passwd</pre><pre>#set up your password and save it somewhere<br>passwd()</pre><pre>quit()</pre><p><strong>Step 3</strong>: In the terminal</p><pre>jupyter notebook --generate-config</pre><pre>mkdir certs</pre><pre>cd certs</pre><pre>sudo openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.pem -out mycert.pem</pre><pre>cd ~/.jupyter/</pre><pre>nano jupyter_notebook_config.py</pre><p><strong>Step 4</strong>: Copy and Paste into jupyter_notebook_config.py</p><pre>c = get_config()</pre><pre>c.IPKernelApp.pylab = &#39;inline&#39;</pre><pre>c.NotebookApp.certfile = u&#39;/home/ubuntu/certs/mycert.pem&#39;</pre><pre>c.NotebookApp.ip = &#39;*&#39;</pre><pre>#or try this<br>#c.NotebookApp.ip = ‘0.0.0.0’</pre><pre>c.NotebookApp.open_browser = False</pre><pre># Your password below will be whatever you copied earlier<br>c.NotebookApp.password = u&#39;<strong>your ipython password</strong>&#39;</pre><pre>c.NotebookApp.port = 8888</pre><p><strong>Step 5</strong>: In the terminal</p><pre>screen -mdS jupyter_lab_serving bash -c &#39;jupyter lab&#39;</pre><pre>#kill all screens: pkill screen</pre><p>So that you will keep the jupyter notebook running even if you close the terminal.</p><p><strong>Step 6</strong>: In the web browser:</p><pre>https://public-ip-address:port/</pre><p>“Your connection is not private” — click advance and allow.</p><p>Enter passoword.</p><p>You should have your Jupyter lab running!!!</p><p><strong>Tip1</strong>: If you have permission error</p><p><a href="https://stackoverflow.com/questions/55871531/permissionerror-errno-13-permission-denied-cannot-open-jupyter-on-browser-de">PermissionError: [Errno 13] Permission denied: Cannot open Jupyter on Browser despite running correctly on AWS EC2 instance</a></p><p>sudo chown $USER:$USER /home/ubuntu/certs/mycert.pem</p><p><strong>Tip 2</strong>: If you have security group problem</p><p><a href="https://stackoverflow.com/questions/26338301/ec2-how-to-add-port-8080-in-security-group">EC2: How to add port 8080 in security group?</a></p><p>Just add ‘8888’ or whatever port your choose to your security group.</p><p><strong>Tip 3: </strong>make sure use https:// not http</p><p><a href="https://stackoverflow.com/questions/34345605/ssl-wrong-version-number-when-setting-up-public-juypter-server">SSL: WRONG_VERSION_NUMBER when setting up public Juypter server</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=daee4429cc4a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>