From 8eae318e61e390fa8ae5a3feaecd319da1452626 Mon Sep 17 00:00:00 2001 From: GokaPek Date: Fri, 22 Nov 2024 18:03:41 +0400 Subject: [PATCH] start2 --- lab_5/lab5.ipynb | 81 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/lab_5/lab5.ipynb b/lab_5/lab5.ipynb index e69de29..2eced18 100644 --- a/lab_5/lab5.ipynb +++ b/lab_5/lab5.ipynb @@ -0,0 +1,81 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " ID Price Levy Manufacturer Model Prod. year Category \\\n", + "0 45654403 13328 1399 LEXUS RX 450 2010 Jeep \n", + "1 44731507 16621 1018 CHEVROLET Equinox 2011 Jeep \n", + "2 45774419 8467 - HONDA FIT 2006 Hatchback \n", + "3 45769185 3607 862 FORD Escape 2011 Jeep \n", + "4 45809263 11726 446 HONDA FIT 2014 Hatchback \n", + "\n", + " Leather interior Fuel type Engine volume Mileage Cylinders \\\n", + "0 Yes Hybrid 3.5 186005 km 6.0 \n", + "1 No Petrol 3 192000 km 6.0 \n", + "2 No Petrol 1.3 200000 km 4.0 \n", + "3 Yes Hybrid 2.5 168966 km 4.0 \n", + "4 Yes Petrol 1.3 91901 km 4.0 \n", + "\n", + " Gear box type Drive wheels Doors Wheel Color Airbags \n", + "0 Automatic 4x4 04-May Left wheel Silver 12 \n", + "1 Tiptronic 4x4 04-May Left wheel Black 8 \n", + "2 Variator Front 04-May Right-hand drive Black 2 \n", + "3 Automatic 4x4 04-May Left wheel White 0 \n", + "4 Automatic Front 04-May Left wheel Silver 4 \n", + "Index(['ID', 'Price', 'Levy', 'Manufacturer', 'Model', 'Prod. year',\n", + " 'Category', 'Leather interior', 'Fuel type', 'Engine volume', 'Mileage',\n", + " 'Cylinders', 'Gear box type', 'Drive wheels', 'Doors', 'Wheel', 'Color',\n", + " 'Airbags'],\n", + " dtype='object')\n" + ] + } + ], + "source": [ + "import pandas as pd\n", + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "import seaborn as sns\n", + "import sklearn\n", + "from sklearn.model_selection import train_test_split, GridSearchCV, cross_val_score\n", + "from sklearn.preprocessing import StandardScaler, OneHotEncoder\n", + "from sklearn.compose import ColumnTransformer\n", + "from sklearn.pipeline import Pipeline\n", + "from sklearn.linear_model import LinearRegression, LogisticRegression\n", + "from sklearn.tree import DecisionTreeRegressor, DecisionTreeClassifier\n", + "from sklearn.ensemble import RandomForestRegressor, RandomForestClassifier\n", + "from sklearn.metrics import mean_squared_error, f1_score, accuracy_score, roc_auc_score, confusion_matrix, classification_report\n", + "df = pd.read_csv(\"./static/csv/car_price_prediction.csv\")\n", + "print(df.head())\n", + "print(df.columns)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "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.12.5" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +}