Created
January 4, 2020 07:52
-
-
Save hamaguchi-amago/22caba9a193633c8feab83002a1023ae to your computer and use it in GitHub Desktop.
機械学習(クラス分け)用のデータ作成処理
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import random | |
with open('test_data.csv', 'w') as f: | |
writer = csv.writer(f, lineterminator='\n') | |
writer.writerow(['Japanese', 'Mathematics', 'English', 'Evaluation']) | |
for i in range(500): | |
test = [] | |
for j in range(3): | |
test.append(random.randint(0, 10) * 10) | |
test_sum = 0 | |
for k in test: | |
test_sum += k | |
test.append((test_sum // 60) + 1) | |
writer.writerow(test) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ブログの記事で作成しました。
興味のある方はご覧ください。
【機械学習】3教科のテスト結果を分類してみた➀
https://neko-py.com/machine-learning-classification-1