LoginSignup
10
7

More than 3 years have passed since last update.

AWS 認定 機械学習 – 専門知識 サンプル問題 日本語訳

Last updated at Posted at 2019-06-07

先日、セキュリティ専門知識になんとか合格できました。
これでアソシエイトとプロと専門知識1個の6冠です。
で、次なのですが・・機械学習いってみようかと。

とはいっても機械学習、ほぼわかりません。これにしようと思った理由は単に模試があるから。
深く考えずにひとまず取り組んでみましょう。
サンプル問題 なのですが・・英語ですね。
ちょっとググってみても日本語訳がみつからず。

では翻訳してみましょう。
俺のgoogle翻訳が唸ります。

サンプル問題日本語訳

早速サンプル問題をみてみましょう。
download sample questions - pdf

10問あって全部解答付きです。
ちなみに・・日本語訳とか書いてますが、書いてる人の英語力はほぼありませんのであらかじめご了承下さい。
基本google翻訳に通した後に補正しています。
気になる点とかがあればご指摘くださればなおします。

Q1

A Machine Learning team has several large CSV datasets in Amazon S3. Historically, models built with the Amazon SageMaker Linear Learner algorithm have taken hours to train on similar-sized datasets. The team’s leaders need to accelerate the training process. 

What can a Machine Learning Specialist do to address this concern? 

A. Use Amazon SageMaker Pipe mode. 

B. Use Amazon Machine Learning to train the models. 

C. Use Amazon Kinesis to stream the data to Amazon SageMaker. 

D. Use AWS Glue to transform the CSV dataset to the JSON format.

answer

A – Amazon SageMaker Pipe mode streams the data directly to the container, which improves the performance of training jobs. (Refer to this link for supporting information.) In Pipe mode, your training job streams data directly from Amazon S3. Streaming can provide faster start times for training jobs and better throughput. With Pipe mode, you also reduce the size of the Amazon EBS volumes for your training instances. B would not apply in this scenario. C is a streaming ingestion solution, but is not applicable in this scenario. D transforms the data structure.

機械学習チームは、Amazon S3にいくつかの大きなCSVデータセットを持っています。
歴史的に、Amazon SageMaker 線形学習アルゴリズムを使用して構築されたモデルは、同じサイズのデータ​​セットを学習するのに何時間もかかりました。
チームのリーダーはトレーニングプロセスを加速する必要があります。

機械学習の専門家はこの懸念に対処するために何ができるでしょうか?

A. Amazon SageMaker Pipeモードを使用してください。

B. Amazon Machine Learningを使用してモデルをトレーニングします。

C. Amazon Kinesisを使用してデータをAmazon SageMakerにストリーミングします。

D. AWS Glueを使用してCSVデータセットをJSON形式に変換します。

answer

A - Amazon SageMaker Pipeモードはデータを直接コンテナにストリーミングするため、トレーニングジョブのパフォーマンスが向上します。 (このlink を参照してください。)パイプモードでは、トレーニングジョブはAmazon S3から直接データをストリーミングします。ストリーミングにより、トレーニングジョブの開始時間が短縮され、スループットが向上します。パイプモードでは、トレーニングインスタンス用のAmazon EBSボリュームのサイズも縮小します。 Bはこのシナリオには適用されません。 Cはストリーミング取り込みソリューションですが、このシナリオには適用されません。 Dはデータ構造を変換します。

Q2

A term frequency–inverse document frequency (tf–idf) matrix using both unigrams and bigrams is built from a text corpus consisting of the following two sentences: 

1. Please call the number below. 
2. Please do not call us. 

What are the dimensions of the tf–idf matrix? 

A. (2, 16) 

B. (2, 8) 

C. (2, 10) 

D. (8, 10)

answer

A – There are 2 sentences, 8 unique unigrams, and 8 unique bigrams, so the result would be (2,16). The phrases are “Please call the number below” and “Please do not call us.” Each word individually (unigram) is “Please,” “call,” ”the,” ”number,” “below,” “do,” “not,” and “us.” The unique bigrams are “Please call,” “call the,” ”the number,” “number below,” “Please do,” “do not,” “not call,” and “call us.” The tf–idf vectorizer is described at this link.

unigramsとbigramsの両方を使用するterm frequency–inverse document frequency (tf–idf) matrixは、次の2つの文からなるテキストコーパスから作成されます。

1. Please call the number below.  
2. Please do not call us. 

tf–idf matrixの大きさは?

A.(2、16)

B.(2、8)

C.(2、10)

D.(8、10)

answer

A - 2つの文、8つの固有のunigrams、および8つの固有のbigramsがあるため、結果は(2,16)になります。フレーズは、「Please call the number below. 」および「Please do not call us. 」です。個々の単語(unigrams)は、“Please,” “call,” ”the,” ”number,” “below,” “do,” “not,” “us.”です。ユニークなbigramsは、“Please call,” “call the,” ”the number,” “number below,” “Please do,” “do not,” “not call,” “call us.”です。 tf–idf vectorizerはこのlink で説明されています。

Q3

A company is setting up a system to manage all of the datasets it stores in Amazon S3. The company would like to automate running transformation jobs on the data and maintaining a catalog of the metadata concerning the datasets. The solution should require the least amount of setup and maintenance. 

Which solution will allow the company to achieve its goals? 

A. Create an Amazon EMR cluster with Apache Hive installed. Then, create a Hive metastore and a script to run transformation jobs on a schedule. 

B. Create an AWS Glue crawler to populate the AWS Glue Data Catalog. Then, author an AWS Glue ETL job, and set up a schedule for data transformation jobs. 

C. Create an Amazon EMR cluster with Apache Spark installed. Then, create an Apache Hive metastore and a script to run transformation jobs on a schedule. 

D. Create an AWS Data Pipeline that transforms the data. Then, create an Apache Hive metastore and a script to run transformation jobs on a schedule..

answer

B – AWS Glue is the correct answer because this option requires the least amount of setup and maintenance since it is serverless, and it does not require management of the infrastructure. Refer to this link for supporting information. A, C, and D are all solutions that can solve the problem, but require more steps for configuration, and require higher operational overhead to run and maintain.

ある会社が、Amazon S3に保存しているすべてのデータセットを管理するためのシステムを設定しています。
同社は、データに対して変換ジョブを実行し、データセットに関するメタデータのカタログを管理することを自動化したいと考えています。
このソリューションは、最小限のセットアップとメンテナンスで済みます。

どのソリューションが会社の目標を達成するのを可能にするでしょうか

A. Apache HiveをインストールしてAmazon EMRクラスターを作成します。次に、スケジュールに基づいて変換ジョブを実行するためのHive metastoreとスクリプトを作成します。

B. AWS Glueデータカタログを作成するためのAWS Glueクローラーを作成します。次に、AWS Glue ETLジョブを作成し、データ変換ジョブのスケジュールを設定します。

C. Apache SparkがインストールされたAmazon EMRクラスターを作成します。それから、Apache Hiveメタストアと変換ジョブをスケジュールに従って実行するスクリプトを作成します。

D.データを変換するAWS Data Pipelineを作成します。次に、Apache Hiveメタストアと、スケジュールに従って変換ジョブを実行するスクリプトを作成します。

answer

B - AWS Glueは正しい答えです。これは、このオプションはサーバーがないため最小限のセットアップとメンテナンスで済み、インフラストラクチャの管理が不要だからです。補足情報についてはこちら link を参照してください。 A、C、およびDは、問題を解決できるソリューションですが、構成に必要な手順が増え、実行と保守に高い運用オーバーヘッドが必要になります。

Q4

A Data Scientist is working on optimizing a model during the training process by varying multiple parameters. The Data Scientist observes that, during multiple runs with identical parameters, the loss function converges to different, yet stable, values. 

What should the Data Scientist do to improve the training process?

A. Increase the learning rate. Keep the batch size the same. 

B. Reduce the batch size. Decrease the learning rate. 

C. Keep the batch size the same. Decrease the learning rate. 

D. Do not change the learning rate. Increase the batch size.

answer

B – It is most likely that the loss function is very curvy and has multiple local minima where the training is getting stuck. Decreasing the batch size would help the Data Scientist stochastically get out of the local minima saddles. Decreasing the learning rate would prevent overshooting the global loss function minimum. Refer to the paper at this link for an explanation.

データサイエンティストは、トレーニングプロセス中に複数のパラメータを変更することによってモデルの最適化に取り組んでいます。
データサイエンティストは、同一のパラメータでの複数回の実行中に、損失関数は異なるが安定した値に収束することを観察しています。

データサイエンティストはトレーニングプロセスを改善するために何をすべきですか?

A.学習率を上げてください。バッチサイズを同じにしてください。

B.バッチサイズを減らします。学習率を下げてください。

C.バッチサイズを同じにしてください。学習率を下げてください。

D.学習率を変えないでください。バッチサイズを大きくしてください。

answer

B - 損失関数は非常に曲線的で、トレーニングが行き詰まっている場所で複数の極小値を持つことが最も可能性があります。バッチサイズを小さくすると、データサイエンティストは確率的にlocal minima saddlesから抜け出すことができます。学習率を下げると、グローバルな損失関数の最小値を超えることを防ぐことができます。説明はこのlinkにある論文を参照してください。

Q5

A Data Scientist is evaluating different binary classification models. A false positive result is 5 times more expensive (from a business perspective) than a false negative result. 

The models should be evaluated based on the following criteria: 
1) Must have a recall rate of at least 80% 
2) Must have a false positive rate of 10% or less 
3) Must minimize business costs 

After creating each binary classification model, the Data Scientist generates the corresponding confusion matrix. 

Which confusion matrix represents the model that satisfies the requirements? 

A. TN = 91, FP = 9 
 FN = 22, TP = 78 

B. TN = 99, FP = 1 
 FN = 21, TP = 79 

C. TN = 96, FP = 4 
 FN = 10, TP = 90 

D. TN = 98, FP = 2 
 FN = 18, TP = 82

answer

D – The following calculations are required:

TP = True Positive
FP = False Positive
FN = False Negative
TN = True Negative
FN = False Negative

Recall = TP / (TP + FN)

False Positive Rate (FPR) = FP / (FP + TN)

Cost = 5 * FP + FN

A B C D
Recall 78 / (78 + 22) = 0.78 79 / (79 + 21) = 0.79 90 / (90 + 10) = 0.9 82 / (82 + 18) = 0.82
False Positive Rate 9 / (9 + 91) = 0.09 1 / (1 + 99) = 0.01 4 / (4 + 96) = 0.04 2 / (2 + 98) = 0.02
Costs 5 * 9 + 22 = 67 5 * 1 + 21 = 26 5 * 4 + 10 = 30 5 * 2 + 18 = 28

Options C and D have a recall greater than 80% and an FPR less than 10%, but D is the most cost effective. For supporting information, refer to this link.

データサイエンティストが、さまざまなバイナリ分類モデルを評価しています。
誤検出の結果は、5倍のコストがかかります(ビジネスの観点から)。

以下の基準に基づいてモデルを評価する必要があります。
1)再現率が80%以上であること
2)誤検知率が10%以下であること
3)ビジネスコストを最小限に抑える

各バイナリ分類モデルを作成した後、データサイエンティストは対応する混同行列を生成します。

要件を満たすモデルを表す混同行列はどれですか。

A. TN = 91、FP = 9
 FN = 22、TP = 78

B. TN = 99、FP = 1
 FN = 21、TP = 79

C. TN = 96、FP = 4
 FN = 10、TP = 90

D. TN = 98、FP = 2
 FN = 18、TP = 82

answer

D - 以下の計算が必要です。

TP =True Positive
FP =False Positive
FN =False Negative
TN =True Negative
FN =False Negative

Recall= TP /(TP + FN)

False Positive Rate(FPR)= FP /(FP + TN)

Costs= 5 * FP + FN

A B C D
Recall 78 / (78 + 22) = 0.78 79 / (79 + 21) = 0.79 90 / (90 + 10) = 0.9 82 / (82 + 18) = 0.82
False Positive Rate 9 / (9 + 91) = 0.09 1 / (1 + 99) = 0.01 4 / (4 + 96) = 0.04 2 / (2 + 98) = 0.02
Costs 5 * 9 + 22 = 67 5 * 1 + 21 = 26 5 * 4 + 10 = 30 5 * 2 + 18 = 28

オプションCとDの再現率は80%を超え、FPRは10%未満ですが、Dが最も費用対効果に優れています。補足情報については、こちらのlinkを参照してください。

Q6

A Data Scientist uses logistic regression to build a fraud detection model. While the model accuracy is 99%, 90% of the fraud cases are not detected by the model. 

What action will definitively help the model detect more than 10% of fraud cases? 

A. Using undersampling to balance the dataset 

B. Decreasing the class probability threshold 

C. Using regularization to reduce overfitting 

D. Using oversampling to balance the dataset

answer

B – Decreasing the class probability threshold makes the model more sensitive and, therefore, marks more cases as the positive class, which is fraud in this case. This will increase the likelihood of fraud detection. However, it comes at the price of lowering precision. This is covered in the Discussion section of the paper at this link.

データサイエンティストは、ロジスティック回帰を使用して不正検出モデルを構築します。
モデルの精度は99%ですが、不正の90%はモデルによって検出されません。

このモデルが10%以上の不正を確実に検出するためにどのようなアクションが確実に役立つでしょうか?

A.アンダーサンプリングを使ってデータセットのバランスをとる

B.クラス確率のしきい値を下げる

C.オーバーフィッティングを減らすための正則化の使用

D. オーバーサンプリングを使ってデータセットのバランスをとる

answer

B - クラス確率のしきい値を下げると、モデルの感度が高くなり、したがって、ポジティブクラスとしてより多くのケースがマークされます。これは、このケースでは不正です。これは不正検出の可能性を高めます。ただし、精度が低下するという代償があります。これについてはこのlinkのホワイトペーパーのDiscussionセクションで説明されています。

Q7

A company is interested in building a fraud detection model. Currently, the Data Scientist does not have a sufficient amount of information due to the low number of fraud cases. 

Which method is MOST likely to detect the GREATEST number of valid fraud cases? 

A. Oversampling using bootstrapping 

B. Undersampling 

C. Oversampling using SMOTE 

D. Class weight adjustment

answer

C – With datasets that are not fully populated, the Synthetic Minority Over-sampling Technique (SMOTE) adds new information by adding synthetic data points to the minority class. This technique would be the most effective in this scenario. Refer to Section 4.2 at this link for supporting information.

ある会社が不正検出モデルの構築に興味を持っています。
現在、データサイエンティストは、不正ケースの数が少ないため、十分な量の情報を持っていません。

正当な不正ケースの最大数を検出する可能性が最も高いのはどの方法ですか?

A.ブートストラップを使ったオーバーサンプリング

B.アンダーサンプリング 

C.SMOTEを使ったオーバーサンプリング

D.クラスの重みの調整

answer

C - 完全に入力されていないデータセットでは、Synthetic Minority Over-sampling Technique (SMOTE)が、少数派クラスにsynthetic data pointsを追加することによって新しい情報を追加します。このシナリオでは、この手法が最も効果的です。補足情報については、このlinkでセクション4.2を参照してください。

Q8

A Machine Learning Engineer is preparing a data frame for a supervised learning task with the Amazon SageMaker Linear Learner algorithm. The ML Engineer notices the target label classes are highly imbalanced and multiple feature columns contain missing values. The proportion of missing values across the entire data frame is less than 5%. 

What should the ML Engineer do to minimize bias due to missing values? 

A. Replace each missing value by the mean or median across non-missing values in same row. 

B. Delete observations that contain missing values because these represent less than 5% of the data. 

C. Replace each missing value by the mean or median across non-missing values in the same column. 

D. For each feature, approximate the missing values using supervised learning based on other features.

answer

D – Use supervised learning to predict missing values based on the values of other features. Different supervised learning approaches might have different performances, but any properly implemented supervised learning approach should provide the same or better approximation than mean or median approximation, as proposed in responses A and C. Supervised learning applied to the imputation of missing values is an active field of research. Refer to this link for an example.

機械学習エンジニアが、Amazon SageMaker 線形学習アルゴリズムを使用して、教師付き学習タスク用のデータフレームを準備しています。 
機械学習エンジニアは、target label classesのバランスが非常に悪く、複数のfeature columnsに欠損値が含まれていることに気付きました。
データフレーム全体の欠損値の割合は5%未満です。

欠損値による偏りを最小限に抑えるために機械学習エンジニアは何をすべきですか?

A.各行の欠損値を、同じ行の欠損値以外の値の平均または中央値で置き換えます。

B.欠損値を含む観測値は、データの5%未満を表すため、それらを削除します。

C.それぞれの欠損値を、同じ列の欠損値以外の値の平均または中央値で置き換えます。

D.各特徴について、他の特徴に基づく教師あり学習を使用して欠損値を概算する。

answer

D - 教師付き学習を使用して他の特徴の値に基づいて欠損値を予測します。教師付き学習アプローチが異なるとパフォーマンスも異なる場合がありますが、回答Aおよび回答Cで提案されているように、適切に実装された教師付き学習アプローチは平均または中央値近似と同じまたはそれ以上の近似値を提供します。研究のこれを参照してくださいlink

Q9

A company has collected customer comments on its products, rating them as safe or unsafe, using decision trees. The training dataset has the following features: id, date, full review, full review summary, and a binary safe/unsafe tag. During training, any data sample with missing features was dropped. In a few instances, the test set was found to be missing the full review text field. 

For this use case, which is the most effective course of action to address test data samples with missing features? 

A. Drop the test samples with missing full review text fields, and then run through the test set. 

B. Copy the summary text fields and use them to fill in the missing full review text fields, and then run through the test set. 

C. Use an algorithm that handles missing data better than decision trees. 

D. Generate synthetic data to fill in the fields that are missing data, and then run through the test set.

answer

B – In this case, a full review summary usually contains the most descriptive phrases of the entire review and is a valid stand-in for the missing full review text field. For supporting information, refer to page 1627 at this link, and this link and this link.

ある企業が自社製品に関する顧客のコメントを収集し、決定木を使用してそれらを安全または安全でないと評価しました。
トレーニングデータセットには、id、date、full review、full review summary、およびbinary safe/unsafe tagの機能があります。
トレーニング中に、機能が欠けているデータサンプルはすべて削除されました。いくつかの例では、テストセットにfull review テキストフィールドがないことがわかりました。

このユースケースでは、機能が欠けているテストデータサンプルに対処するための最も効果的な対策はどれですか。

A.full reviewフィールドが欠けているテストサンプルをドロップしてから、テストセットを実行します。

B.full review summaryフィールドをコピーしてそれらを使用して、欠落しているfull reviewフィールドを埋めてから、テストセットを実行します。

C.決定木よりも欠けているデータをうまく処理するアルゴリズムを使用する。

D.データが欠落しているフィールドを埋めるためにsynthetic dataを生成してから、テストセットを実行します。

answer

B - この場合、full review summaryフィールドには通常、レビュー全体の中で最も説明的なフレーズが含まれており、不足しているfull reviewフィールドを代用するのに有効です。補足情報については、このlinkおよびこのlinkの1627ページ、およびこれを参照してください

Q10

An insurance company needs to automate claim compliance reviews because human reviews are expensive and error-prone. The company has a large set of claims and a compliance label for each. Each claim consists of a few sentences in English, many of which contain complex related information. Management would like to use Amazon SageMaker built-in algorithms to design a machine learning supervised model that can be trained to read each claim and predict if the claim is compliant or not. 

Which approach should be used to extract features from the claims to be used as inputs for the downstream supervised task? 

A. Derive a dictionary of tokens from claims in the entire dataset. Apply one-hot encoding to tokens found in each claim of the training set. Send the derived features space as inputs to an Amazon SageMaker builtin supervised learning algorithm. 

B. Apply Amazon SageMaker BlazingText in Word2Vec mode to claims in the training set. Send the derived features space as inputs for the downstream supervised task. 

C. Apply Amazon SageMaker BlazingText in classification mode to labeled claims in the training set to derive features for the claims that correspond to the compliant and non-compliant labels, respectively. 

D. Apply Amazon SageMaker Object2Vec to claims in the training set. Send the derived features space as inputs for the downstream supervised task.

answer

D – Amazon SageMaker Object2Vec generalizes the Word2Vec embedding technique for words to more complex objects, such as sentences and paragraphs. Since the supervised learning task is at the level of whole claims, for which there are labels, and no labels are available at the word level, Object2Vec needs be used instead of Word2Vec. For supporting information, refer to this link and this link.

人力によるレビューは高コストであり、間違いが発生しやすいため、保険会社はクレームコンプライアンスレビューを自動化する必要があります。
同社には多数のクレームとそれぞれのコンプライアンスラベルがあります。
それぞれの主張は英語のいくつかの文から成り、その多くは複雑な関連情報を含んでいます。
経営陣は、Amazon SageMakerの組み込みアルゴリズムを使用して、各要求を読み取り、その要求が準拠しているかどうかを予測するように学習できる教師あり学習モデルを設計したいと考えています。

下流の教師あり学習のためのインプットとして使用されるべきクレームから、特徴を抽出するためにどのアプローチが使用されるべきですか?

A.データセット全体のクレームからトークンの辞書を導き出します。トレーニングセットの各請求に含まれるトークンにone-hot encodingを適用します。derived features spaceを入力としてAmazon SageMaker組み込み教師あり学習アルゴリズムに送信します。

B. Word2VecモードのAmazon SageMaker BlazingTextをトレーニングセットのクレームに適用します。導出された特徴空間を下流の教師あり学習のためのインプットとして送る。

C.分類モードのAmazon SageMaker BlazingTextをトレーニングセットのラベル付きクレームに適用して、それぞれ準拠ラベルと非準拠ラベルに対応するクレームの機能を導き出します。

D.トレーニングセット内のクレームにAmazon SageMaker Object2Vecを適用します。導出された特徴空間を下流の教師あり学習のための入力として送る。

answer

D - Amazon SageMaker Object2Vecは、Word2Vecの埋め込みテクニックを文章や段落などのより複雑なオブジェクトに一般化したものです。教師あり学習タスクはラベルがあり、単語レベルではラベルが使用できないクレーム全体のレベルにあるため、Word2Vecの代わりにObject2Vecを使用する必要があります。補足情報については、このlink とこのlink.

んー、アカン。専門用語多すぎて違和感なく訳せてるかわからん。
ひとまず公開しつつも、随時編集という事で追々調整していきます。

というかやっぱこの資格は厳しいかもな。。全然理解できない。

10
7
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
7