'updated_python_codes'

parent 8f81a81d
......@@ -2,313 +2,105 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"%matplotlib inline"
"%matplotlib inline\n",
"import pandas as pd\n",
"import mysql.connector\n",
"mydb = mysql.connector.connect(\n",
" host=\"localhost\",\n",
" user=\"root\",\n",
" password=\"root\",\n",
" database=\"inteljr\"\n",
")\n",
"\n",
"student_id = 1\n",
"\n",
"mycursor = mydb.cursor()\n",
"sql = \"\"\"SELECT duration, marks FROM tbl_result_summary WHERE student_id = '%s' order by added_date desc\"\"\" % (student_id) \n",
"mycursor.execute(sql)\n",
"myresult = mycursor.fetchall()\n",
"df=pd.DataFrame(myresult)\n",
"df.shape\n",
"df.head()\n",
"df.describe()\n",
"\n",
"\n",
"df = pd.read_sql_query(sql,mydb)\n",
"df.plot(x='duration',y='marks',style='*')\n",
"plt.title('Student Mark Prediction')\n",
"plt.xlabel('Hours')\n",
"plt.ylabel('Marks')\n",
"plt.show()\n",
"\n",
"x = df.iloc[:, :-1].values\n",
"y = df.iloc[:, 1].values\n",
"\n",
"#Split the data into train and test dataset\n",
"from sklearn.model_selection import train_test_split\n",
"x_train,x_test,y_train,y_test=train_test_split(x,y,test_size=0.5,random_state=0)\n",
"\n",
"#Fitting Simple Linear regression data model to train data set\n",
"from sklearn.linear_model import LinearRegression\n",
"regressorObject=LinearRegression()\n",
"pd.plotting.register_matplotlib_converters()\n",
"regressorObject.fit(x_train,y_train)\n",
"\n",
"#predict the test set\n",
"y_pred_test_data=regressorObject.predict(x_test)\n",
"y_pred_train_data=regressorObject.predict(x_train)\n",
"\n",
"# Visualising the Training set results in a scatter plot\n",
"plt.scatter(x_train, y_train, color = 'red')\n",
"plt.plot(x_train, regressorObject.predict(x_train), color = 'blue')\n",
"plt.xlabel('Duration ')\n",
"plt.ylabel('Marks')\n",
"plt.show()\n",
"\n",
"print(regressorObject.intercept_)\n",
"print(regressorObject.coef_)\n",
"df=pd.DataFrame({'actual':y_pred_train_data, 'predicted':y_pred_test_data})\n",
"df\n",
"\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"dataset = pd.read_csv(\"D:/rashmika/projects/freelance/eLearning-analysis/dataset.csv\") "
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(25, 2)"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dataset.shape"
]
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>hours</th>\n",
" <th>score</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>2.5</td>\n",
" <td>21</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>5.1</td>\n",
" <td>47</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>3.2</td>\n",
" <td>27</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>8.5</td>\n",
" <td>75</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>3.5</td>\n",
" <td>30</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" hours score\n",
"0 2.5 21\n",
"1 5.1 47\n",
"2 3.2 27\n",
"3 8.5 75\n",
"4 3.5 30"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"dataset.head()"
]
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>hours</th>\n",
" <th>score</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>count</th>\n",
" <td>25.000000</td>\n",
" <td>25.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>mean</th>\n",
" <td>5.012000</td>\n",
" <td>51.480000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>std</th>\n",
" <td>2.525094</td>\n",
" <td>25.286887</td>\n",
" </tr>\n",
" <tr>\n",
" <th>min</th>\n",
" <td>1.100000</td>\n",
" <td>17.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25%</th>\n",
" <td>2.700000</td>\n",
" <td>30.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>50%</th>\n",
" <td>4.800000</td>\n",
" <td>47.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>75%</th>\n",
" <td>7.400000</td>\n",
" <td>75.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>max</th>\n",
" <td>9.200000</td>\n",
" <td>95.000000</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" hours score\n",
"count 25.000000 25.000000\n",
"mean 5.012000 51.480000\n",
"std 2.525094 25.286887\n",
"min 1.100000 17.000000\n",
"25% 2.700000 30.000000\n",
"50% 4.800000 47.000000\n",
"75% 7.400000 75.000000\n",
"max 9.200000 95.000000"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"dataset.describe()"
]
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAEWCAYAAABhffzLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+j8jraAAAf4ElEQVR4nO3de7xVdbnv8c8XQQEvKYgIEZDnIF4goQ14K0NRLDVvOywlM7NDpnnppmi1q32saO/2Pln2MklLTCRNJd1qbpSkjTtvoCYaJqfCJYKyxAugQqDP/mOMpdPJusy1WGOOOef4vl8vXnPOMeYY41kLeOZvPmOM56eIwMzMiqNH3gGYmVl1OfGbmRWME7+ZWcE48ZuZFYwTv5lZwTjxm5kVjBO/5U7SAkmfzTuOrSUpJP3vGohjuaTD0+cXS7qyi/t5QtLEbg3OaoITv3VI0gck/UHSK5JelPTfksan6z4t6d68Y4TKYkk/ZELSfmXLf5Mun5hpkMmxhqfHWp/+WS5pehbHiojvRkSHH6qSrpZ0Sdm2+0bEgizisnw58Vu7JO0E3Ab8GOgHvBv4NrAxz7i20lPAp1peSOoPHAA0d2Vnknp2MY6dI2IH4GTgnyR9uBv3bdYmJ37ryJ4AETEnIt6IiNcjYl5EPCZpb+CnwIHpyPVl2LJ0Uz4Sl3SEpCfTbxCXASo9oKTPSFoq6SVJ/ylpWMm6kHSmpGXp+p8o0WosbZgNfFzSNunrk4G5wN9LjjNB0n2SXpa0StJlkrYti+NsScuAZeUHSL8lPSPp0I5+wRFxH/AEMErSREkrJF0o6TngF5J6SJou6S+S1ki6QVK/kmOdKunpdN3XyuL4lqRry+L6Q/pzPZP+3UwDpgIXpL+7/0jfW1oy2k7SDyWtTP/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h+E6kpv3tpd0ezoHwuOSPp7Tj2LWOHfumnWDPiV3VwP0A25Nn19GMtfDLEmfAX4EHN/B/iYAoyLib5L+EVgZEUcDSHpXN8duVjGP+M3e9npEjGn5A/xTyboDgevS578EPlDB/h6MiL+lz5cAh0v6vqQPRsQr3Re2Wec48Zt1TUuvk82k/4/SBmDblrzn1bfeHPEU8A8kHwDfk1T6oWJWVU78ZpX5A0nXUICpJFP5ASwnSeiQ9Hzv1drGkgYDr0XEtSSTgtRKC2UrINf4zSpzLvBzSV8lmfmqpRPmz4BbJD0IzKdklF9mNPCvkt4k6cb4+YzjNWuTu3OamRWMSz1mZgXjxG9mVjBO/GZmBePEb2ZWME78ZmYF48RvZlYwTvxmZgXzP4odCjJW+7qnAAAAAElFTkSuQmCC\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"2.0181600414346974\n",
"[9.91065648]\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Actual</th>\n",
" <th>Predicted</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>20</td>\n",
" <td>16.884145</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>27</td>\n",
" <td>33.732261</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>69</td>\n",
" <td>75.357018</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>30</td>\n",
" <td>26.794801</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>62</td>\n",
" <td>60.491033</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Actual Predicted\n",
"0 20 16.884145\n",
"1 27 33.732261\n",
"2 69 75.357018\n",
"3 30 26.794801\n",
"4 62 60.491033"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"dataset.plot(x='hours',y='score',style='*')\n",
"plt.title('Student Mark Prediction')\n",
......@@ -331,13 +123,6 @@
"df=pd.DataFrame({'Actual':Y_test, 'Predicted':Y_pred})\n",
"df"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
......@@ -361,4 +146,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment