{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Case 02\n", "\n", "The following file presents mean data by municipality (\"https://github.com/masterfloss/data/blob/main/crime.xlsx?raw=true\"). The target is crime per 1000 population (crime1000hab2018). In order to explain it, several features are presented.\n", "\n", "1. Create regression model, identifying the best solution\n", "\n", "2. Categorize the target data (bad > mean, good < mean). Use classification algorthms. \n", "\n" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "#\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#For gression, use the follwoing libraies\n", "from sklearn.metrics import mean_absolute_error, mean_squared_error, median_absolute_error, explained_variance_score,r2_score\n", "from sklearn.neural_network import MLPRegressor\n", "from sklearn.linear_model import Ridge\n", "from sklearn.tree import DecisionTreeRegressor\n", "from sklearn.ensemble import RandomForestRegressor" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#For classification, use the follwoing libtaries\n", "from sklearn.preprocessing import StandardScaler\n", "from sklearn.neighbors import KNeighborsClassifier\n", "from sklearn.naive_bayes import GaussianNB\n", "from sklearn.svm import SVC\n", "from sklearn.linear_model import LogisticRegression\n", "from sklearn.metrics import confusion_matrix\n", "from sklearn.metrics import precision_score, recall_score, f1_score, accuracy_score\n", "import matplotlib.pyplot as plt" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#" ] } ], "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.9.7" } }, "nbformat": 4, "nbformat_minor": 2 }