Add 'dataset-stats.py'
This commit is contained in:
parent
8a7c05a5d8
commit
6850eec9d6
22
dataset-stats.py
Normal file
22
dataset-stats.py
Normal file
@ -0,0 +1,22 @@
|
||||
import pandas as pd
|
||||
import os
|
||||
import sys
|
||||
from sklearn.model_selection import train_test_split
|
||||
|
||||
|
||||
water = pd.read_csv('waterQuality.csv')
|
||||
water_train, water_test = train_test_split(water, train_size=0.8, random_state=1, stratify=water["is_safe"])
|
||||
water_test, water_dev = train_test_split(water_test, train_size=0.66, random_state=1, stratify=water_test["is_safe"])
|
||||
water_train["is_safe"].value_counts()
|
||||
water_test["is_safe"].value_counts()
|
||||
water_dev["is_safe"].value_counts()
|
||||
|
||||
|
||||
print(f'''
|
||||
Statystyki zbioru:
|
||||
Wielkość zbioru - {len(water)}
|
||||
Wielkość podzbioru treningowego - {len(water_train)}
|
||||
Wielkość podzbioru walidującego - {len(water_dev)}
|
||||
Wielkość podzbioru testowego - {len(water_test)}
|
||||
Rozkład częstości parametru mówiącemu o zdantości picia wody (0 oznacza zdanty do picia):
|
||||
''')
|
Loading…
Reference in New Issue
Block a user