Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ead0a26
Create yogesh.md learning github
yogeshpal1999 Sep 14, 2019
e4632bd
Created using Colaboratory
yogeshpal1999 Sep 30, 2020
894bdf2
Add files via upload
yogeshpal1999 Sep 30, 2020
3407da4
Created using Colaboratory
yogeshpal1999 Oct 7, 2020
e7ec690
Created using Colaboratory
yogeshpal1999 Oct 21, 2020
f6e1ba1
Created using Colaboratory
yogeshpal1999 Oct 21, 2020
d19bd72
Created using Colaboratory
yogeshpal1999 Nov 24, 2020
ca96abf
Created using Colaboratory
yogeshpal1999 Nov 24, 2020
5c0a4ba
Created using Colaboratory
yogeshpal1999 Nov 24, 2020
100e97d
Delete logistic_regression.ipynb
yogeshpal1999 Nov 24, 2020
fc99706
Delete SVM_from_Scratch.ipynb
yogeshpal1999 Nov 24, 2020
84a9b72
Created using Colaboratory
yogeshpal1999 Nov 24, 2020
dd523df
Delete abhay.md
yogeshpal1999 Nov 24, 2020
f47c630
Created using Colaboratory
yogeshpal1999 Nov 24, 2020
9557f2e
Created using Colaboratory
yogeshpal1999 Nov 24, 2020
5aeb6fc
Created using Colaboratory
yogeshpal1999 Nov 24, 2020
700a81a
Created using Colaboratory
yogeshpal1999 Nov 24, 2020
0440104
Created using Colaboratory
yogeshpal1999 Nov 24, 2020
0469d97
Delete lab5_linear_regression.ipynb
yogeshpal1999 Nov 24, 2020
2f4f96e
Created using Colaboratory
yogeshpal1999 Nov 24, 2020
331268d
Delete Lab_6_logistic_regression.ipynb
yogeshpal1999 Nov 24, 2020
0eff4ac
Delete Scratch.ipynb
yogeshpal1999 Nov 24, 2020
63c3852
Delete README.md
yogeshpal1999 Nov 24, 2020
0d2296c
Delete yogesh.md
yogeshpal1999 Nov 24, 2020
e7b7b70
Created using Colaboratory
yogeshpal1999 Nov 24, 2020
1029d89
Created using Colaboratory
yogeshpal1999 Nov 24, 2020
d7fe530
Created using Colaboratory
yogeshpal1999 Nov 24, 2020
4ac7577
Delete First
yogeshpal1999 Nov 24, 2020
9b479af
Add files via upload
yogeshpal1999 Nov 24, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 135 additions & 0 deletions Dijkstra's.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "Dijkstra's.ipynb",
"provenance": [],
"collapsed_sections": [],
"authorship_tag": "ABX9TyO+BKfWeDefYHJBxR6szryR",
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/github/yogeshpal1999/LearningGit/blob/master/Dijkstra's.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "code",
"metadata": {
"id": "Cet_8L2A5nPk",
"outputId": "193bf876-94b6-477e-9a08-8abc26437e8c",
"colab": {
"base_uri": "https://localhost:8080/"
}
},
"source": [
"import sys \n",
" \n",
"class Graph(): \n",
" \n",
" def __init__(self, vertices): \n",
" self.V = vertices \n",
" self.graph = [[0 for column in range(vertices)] \n",
" for row in range(vertices)] \n",
" \n",
" def printSolution(self, dist): \n",
" print (\"Vertex tDistance from Source\") \n",
" for node in range(self.V): \n",
" print (node, \"t\", dist[node]) \n",
" \n",
" # A utility function to find the vertex with \n",
" # minimum distance value, from the set of vertices \n",
" # not yet included in shortest path tree \n",
" def minDistance(self, dist, sptSet): \n",
" \n",
" # Initilaize minimum distance for next node \n",
" min = sys.maxsize \n",
" \n",
" # Search not nearest vertex not in the \n",
" # shortest path tree \n",
" for v in range(self.V): \n",
" if dist[v] < min and sptSet[v] == False: \n",
" min = dist[v] \n",
" min_index = v \n",
" \n",
" return min_index \n",
" \n",
" # Funtion that implements Dijkstra's single source \n",
" # shortest path algorithm for a graph represented \n",
" # using adjacency matrix representation \n",
" def dijkstra(self, src): \n",
" \n",
" dist = [sys.maxsize] * self.V \n",
" dist[src] = 0\n",
" sptSet = [False] * self.V \n",
" \n",
" for cout in range(self.V): \n",
" \n",
" # Pick the minimum distance vertex from \n",
" # the set of vertices not yet processed. \n",
" # u is always equal to src in first iteration \n",
" u = self.minDistance(dist, sptSet) \n",
" \n",
" # Put the minimum distance vertex in the \n",
" # shotest path tree \n",
" sptSet[u] = True\n",
" \n",
" # Update dist value of the adjacent vertices \n",
" # of the picked vertex only if the current \n",
" # distance is greater than new distance and \n",
" # the vertex in not in the shotest path tree \n",
" for v in range(self.V): \n",
" if self.graph[u][v] > 0 and sptSet[v] == False and dist[v] > dist[u] + self.graph[u][v]: \n",
" dist[v] = dist[u] + self.graph[u][v] \n",
" \n",
" self.printSolution(dist) \n",
" \n",
"# Driver program \n",
"g = Graph(9) \n",
"g.graph = [[0, 4, 0, 0, 0, 0, 0, 8, 0], \n",
" [4, 0, 8, 0, 0, 0, 0, 11, 0], \n",
" [0, 8, 0, 7, 0, 4, 0, 0, 2], \n",
" [0, 0, 7, 0, 9, 14, 0, 0, 0], \n",
" [0, 0, 0, 9, 0, 10, 0, 0, 0], \n",
" [0, 0, 4, 14, 10, 0, 2, 0, 0], \n",
" [0, 0, 0, 0, 0, 2, 0, 1, 6], \n",
" [8, 11, 0, 0, 0, 0, 1, 0, 7], \n",
" [0, 0, 2, 0, 0, 0, 6, 7, 0] \n",
" ]; \n",
" \n",
"g.dijkstra(0);\n"
],
"execution_count": 2,
"outputs": [
{
"output_type": "stream",
"text": [
"Vertex tDistance from Source\n",
"0 t 0\n",
"1 t 4\n",
"2 t 12\n",
"3 t 19\n",
"4 t 21\n",
"5 t 11\n",
"6 t 9\n",
"7 t 8\n",
"8 t 14\n"
],
"name": "stdout"
}
]
}
]
}
1 change: 0 additions & 1 deletion First

This file was deleted.

161 changes: 161 additions & 0 deletions Lab1.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "Lab1.ipynb",
"provenance": [],
"authorship_tag": "ABX9TyPr87HGr8fjhkDQRb4G9c8T",
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/github/yogeshpal1999/LearningGit/blob/master/Lab1.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "vaOT3P-3zNs-",
"outputId": "f602fbcc-0709-4438-de7c-a09b7093ef7e"
},
"source": [
"from google.colab import drive\n",
"drive.mount('/content/drive')"
],
"execution_count": 1,
"outputs": [
{
"output_type": "stream",
"text": [
"Mounted at /content/drive\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "zwSfkkVezbF3"
},
"source": [
"import pandas as pd\n",
"import numpy as np"
],
"execution_count": 2,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "tmsYPtalzfHS",
"outputId": "d22962d6-34cb-456c-abb1-9dfbf6d53e6a"
},
"source": [
"df = pd.read_csv('/content/drive/MyDrive/banking /heart.csv')\n",
"print(df)\n"
],
"execution_count": 3,
"outputs": [
{
"output_type": "stream",
"text": [
" age sex cp trestbps chol fbs ... exang oldpeak slope ca thal target\n",
"0 63 1 3 145 233 1 ... 0 2.3 0 0 1 1\n",
"1 37 1 2 130 250 0 ... 0 3.5 0 0 2 1\n",
"2 41 0 1 130 204 0 ... 0 1.4 2 0 2 1\n",
"3 56 1 1 120 236 0 ... 0 0.8 2 0 2 1\n",
"4 57 0 0 120 354 0 ... 1 0.6 2 0 2 1\n",
".. ... ... .. ... ... ... ... ... ... ... .. ... ...\n",
"298 57 0 0 140 241 0 ... 1 0.2 1 0 3 0\n",
"299 45 1 3 110 264 0 ... 0 1.2 1 0 3 0\n",
"300 68 1 0 144 193 1 ... 0 3.4 1 2 3 0\n",
"301 57 1 0 130 131 0 ... 1 1.2 1 1 3 0\n",
"302 57 0 1 130 236 0 ... 0 0.0 1 1 2 0\n",
"\n",
"[303 rows x 14 columns]\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "qtBnwUUHzt_V",
"outputId": "e00049d7-dfcd-48c3-89ad-777df4c777da"
},
"source": [
"print(list(df))"
],
"execution_count": 4,
"outputs": [
{
"output_type": "stream",
"text": [
"['age', 'sex', 'cp', 'trestbps', 'chol', 'fbs', 'restecg', 'thalach', 'exang', 'oldpeak', 'slope', 'ca', 'thal', 'target']\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "YxV5IZ2uzznH",
"outputId": "59fe3c22-5bba-42a0-c5ce-f6496b2c54c7"
},
"source": [
"print(df.dtypes)"
],
"execution_count": 5,
"outputs": [
{
"output_type": "stream",
"text": [
"age int64\n",
"sex int64\n",
"cp int64\n",
"trestbps int64\n",
"chol int64\n",
"fbs int64\n",
"restecg int64\n",
"thalach int64\n",
"exang int64\n",
"oldpeak float64\n",
"slope int64\n",
"ca int64\n",
"thal int64\n",
"target int64\n",
"dtype: object\n"
],
"name": "stdout"
}
]
}
]
}
Loading