Pythonで機械学習モデルを作成しています。 提供されたデータセットには、いくつかの数値列と1つのテキスト列が含まれています。 テキスト列は、製品のカテゴリを表します。 製品カテゴリは常に次のいずれかになります。
*自転車
* 車
* バン
*ボート
scikit-learn Pythonパッケージを使用して回帰モデルを構築しています。
scikit-learn Pythonパッケージと互換性があるようにテキストデータを変換する必要があります。
コードセグメントをどのように完成させる必要がありますか? 回答するには、回答エリアで適切なオプションを選択します。
注:それぞれの正しい選択には1ポイントの価値があります。

正解:

Explanation

Box 1: pandas as df
Pandas takes data (like a CSV or TSV file, or a SQL database) and creates a Python object with rows and columns called data frame that looks very similar to table in a statistical software (think Excel or SPSS for example.
Box 2: transpose[ProductCategoryMapping]
Reshape the data from the pandas Series to columns.
Reference:
https://datascienceplus.com/linear-regression-in-python/