ium_z487181/Cars.ipynb

131 lines
3.1 KiB
Plaintext
Raw Normal View History

{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "59868c88",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"--2023-03-25 11:54:34-- https://archive.ics.uci.edu/ml/machine-learning-databases/car/car.data\n",
"Resolving archive.ics.uci.edu (archive.ics.uci.edu)... 128.195.10.252\n",
"Connecting to archive.ics.uci.edu (archive.ics.uci.edu)|128.195.10.252|:443... connected.\n",
"HTTP request sent, awaiting response... 206 Partial Content\n",
"Length: 51867 (51K), 1 remaining [application/x-httpd-php]\n",
"Saving to: car.data\n",
"\n",
"car.data 100%[+++++++++++++++++++>] 50,65K --.-KB/s in 0s \n",
"\n",
"2023-03-25 11:54:35 (16,8 KB/s) - car.data saved [51867/51867]\n",
"\n"
]
}
],
"source": [
"!wget -c https://archive.ics.uci.edu/ml/machine-learning-databases/car/car.data"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "776bf1e2",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1728 car.data\r\n"
]
}
],
"source": [
"!wc -l car.data"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "a56dee9c",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"vhigh,vhigh,2,2,small,low,unacc\n",
"vhigh,vhigh,2,2,small,med,unacc\n",
"vhigh,vhigh,2,2,small,high,unacc\n",
"vhigh,vhigh,2,2,med,low,unacc\n",
"vhigh,vhigh,2,2,med,med,unacc\n",
"vhigh,vhigh,2,2,med,high,unacc\n",
" 576 high\n",
" 576 low\n",
" 576 med\n"
]
}
],
"source": [
"!head -n 6 car.data\n",
"!cut -f 6 -d \",\" car.data | sort | uniq -c"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "54a43eaa",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 192 high\n",
" 193 low\n",
" 192 med\n",
" 96 high\n",
" 96 low\n",
" 96 med\n",
" 96 high\n",
" 96 low\n",
" 96 med\n"
]
}
],
"source": [
"!head -n 288 car.data > car.data.test\n",
"!head -n 576 car.data | tail -n 288 > car.data.dev\n",
"!head -n +577 car.data > car.data.train\n",
"#sprawdzanie podziału ze względu na bezpieczeństwo samochodu\n",
"!cut -f 6 -d \",\" car.data.train | sort | uniq -c\n",
"!cut -f 6 -d \",\" car.data.test | sort | uniq -c\n",
"!cut -f 6 -d \",\" car.data.dev | sort | uniq -c"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.6"
}
},
"nbformat": 4,
"nbformat_minor": 5
}