Skip to content

Instantly share code, notes, and snippets.

@hamaguchi-amago
Created January 4, 2020 07:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hamaguchi-amago/22caba9a193633c8feab83002a1023ae to your computer and use it in GitHub Desktop.
Save hamaguchi-amago/22caba9a193633c8feab83002a1023ae to your computer and use it in GitHub Desktop.
機械学習(クラス分け)用のデータ作成処理
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)
@hamaguchi-amago
Copy link
Author

ブログの記事で作成しました。
興味のある方はご覧ください。

【機械学習】3教科のテスト結果を分類してみた➀
https://neko-py.com/machine-learning-classification-1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment