Compare commits

..

No commits in common. "main" and "main" have entirely different histories.
main ... main

6 changed files with 1105 additions and 1265 deletions

View File

@ -44,16 +44,23 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[279661.8663101 279261.14658016 522543.09697553 243798.45172733\n",
" 408919.21577439 272940.5507781 367515.38801642 592972.56867895\n",
" 418509.89826131 943578.7139463 ]\n"
"[[332187.32537534]\n",
" [369587.77676738]\n",
" [488428.70420785]\n",
" [300013.00301966]\n",
" [412118.79730411]\n",
" [283333.7605634 ]\n",
" [275209.84706017]\n",
" [361970.50784352]\n",
" [272402.36116539]\n",
" [328635.55642844]]\n"
]
}
],
@ -77,7 +84,7 @@
"def preprocess(data):\n",
" \"\"\"Wstępne przetworzenie danych\"\"\"\n",
" data = data.replace({\"parter\": 0, \"poddasze\": 0}, regex=True)\n",
" data = data.map(np.nan_to_num) # Zamienia \"NaN\" na liczby\n",
" data = data.applymap(np.nan_to_num) # Zamienia \"NaN\" na liczby\n",
" return data\n",
"\n",
"\n",
@ -94,7 +101,7 @@
"data_train, data_test = train_test_split(data, test_size=0.2)\n",
"\n",
"# Uczenie modelu\n",
"y_train = pd.Series(data_train[\"cena\"])\n",
"y_train = pd.DataFrame(data_train[\"cena\"])\n",
"x_train = pd.DataFrame(data_train[FEATURES])\n",
"model = LinearRegression() # definicja modelu\n",
"model.fit(x_train, y_train) # dopasowanie modelu\n",
@ -147,14 +154,14 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Błąd średniokwadratowy wynosi 137394744518.31197\n"
"Błąd średniokwadratowy wynosi 1179760250402.185\n"
]
}
],
@ -175,14 +182,14 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0.2160821272059249\n"
"-10.712011261173265\n"
]
}
],
@ -206,7 +213,7 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 1,
"metadata": {},
"outputs": [
{
@ -218,6 +225,14 @@
"F-score: 1.0\n",
"Model score: 1.0\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/pawel/.local/lib/python3.10/site-packages/sklearn/utils/validation.py:1111: DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples, ), for example using ravel().\n",
" y = column_or_1d(y, warn=True)\n"
]
}
],
"source": [
@ -239,7 +254,7 @@
"data_train, data_test = train_test_split(data_iris, test_size=0.2)\n",
"\n",
"# Uczenie modelu\n",
"y_train = pd.Series(data_train[\"Iris setosa?\"])\n",
"y_train = pd.DataFrame(data_train[\"Iris setosa?\"])\n",
"x_train = pd.DataFrame(data_train[FEATURES])\n",
"model = LogisticRegression() # definicja modelu\n",
"model.fit(x_train, y_train) # dopasowanie modelu\n",

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long