Skip to content

Commit 0b5717d

Browse files
committed
2 parents ac7b295 + 444c2f1 commit 0b5717d

File tree

16 files changed

+2394
-43
lines changed

16 files changed

+2394
-43
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"cells": [],
3+
"metadata": {},
4+
"nbformat": 4,
5+
"nbformat_minor": 5
6+
}

Classification/Linear Sepration/Simple Perceptron 1.ipynb

Lines changed: 210 additions & 0 deletions
Large diffs are not rendered by default.

Feature Selection/Forward Selection/forward1.ipynb

Lines changed: 43 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
{
1212
"cell_type": "code",
13-
"execution_count": 2,
13+
"execution_count": 1,
1414
"id": "e32c2611",
1515
"metadata": {},
1616
"outputs": [],
@@ -23,7 +23,7 @@
2323
},
2424
{
2525
"cell_type": "code",
26-
"execution_count": 3,
26+
"execution_count": 2,
2727
"id": "6f3b12af",
2828
"metadata": {},
2929
"outputs": [
@@ -177,7 +177,7 @@
177177
"4 0 1 1 "
178178
]
179179
},
180-
"execution_count": 3,
180+
"execution_count": 2,
181181
"metadata": {},
182182
"output_type": "execute_result"
183183
}
@@ -193,16 +193,26 @@
193193
{
194194
"cell_type": "code",
195195
"execution_count": 3,
196+
"id": "69df0a91",
197+
"metadata": {},
198+
"outputs": [],
199+
"source": [
200+
"data = data.drop(['Unnamed: 0'] , axis = 1)"
201+
]
202+
},
203+
{
204+
"cell_type": "code",
205+
"execution_count": 4,
196206
"id": "6f0bc787",
197207
"metadata": {},
198208
"outputs": [
199209
{
200210
"data": {
201211
"text/plain": [
202-
"(10000, 14)"
212+
"(10000, 13)"
203213
]
204214
},
205-
"execution_count": 3,
215+
"execution_count": 4,
206216
"metadata": {},
207217
"output_type": "execute_result"
208218
}
@@ -214,14 +224,13 @@
214224
},
215225
{
216226
"cell_type": "code",
217-
"execution_count": 4,
227+
"execution_count": 5,
218228
"id": "dab21ac2",
219229
"metadata": {},
220230
"outputs": [
221231
{
222232
"data": {
223233
"text/plain": [
224-
"Unnamed: 0 0\n",
225234
"CreditScore 0\n",
226235
"Age 0\n",
227236
"Tenure 0\n",
@@ -238,7 +247,7 @@
238247
"dtype: int64"
239248
]
240249
},
241-
"execution_count": 4,
250+
"execution_count": 5,
242251
"metadata": {},
243252
"output_type": "execute_result"
244253
}
@@ -250,7 +259,7 @@
250259
},
251260
{
252261
"cell_type": "code",
253-
"execution_count": 5,
262+
"execution_count": 6,
254263
"id": "2811a2ea",
255264
"metadata": {},
256265
"outputs": [],
@@ -262,17 +271,17 @@
262271
},
263272
{
264273
"cell_type": "code",
265-
"execution_count": 6,
274+
"execution_count": 7,
266275
"id": "8bbb9b19",
267276
"metadata": {},
268277
"outputs": [
269278
{
270279
"data": {
271280
"text/plain": [
272-
"((10000, 13), (10000,))"
281+
"((10000, 12), (10000,))"
273282
]
274283
},
275-
"execution_count": 6,
284+
"execution_count": 7,
276285
"metadata": {},
277286
"output_type": "execute_result"
278287
}
@@ -283,7 +292,7 @@
283292
},
284293
{
285294
"cell_type": "code",
286-
"execution_count": 7,
295+
"execution_count": 8,
287296
"id": "339032e6",
288297
"metadata": {},
289298
"outputs": [],
@@ -293,7 +302,7 @@
293302
},
294303
{
295304
"cell_type": "code",
296-
"execution_count": 8,
305+
"execution_count": 9,
297306
"id": "26095cde",
298307
"metadata": {},
299308
"outputs": [],
@@ -305,7 +314,7 @@
305314
},
306315
{
307316
"cell_type": "code",
308-
"execution_count": 9,
317+
"execution_count": 10,
309318
"id": "423dff79",
310319
"metadata": {},
311320
"outputs": [],
@@ -317,7 +326,7 @@
317326
},
318327
{
319328
"cell_type": "code",
320-
"execution_count": 10,
329+
"execution_count": 11,
321330
"id": "9cdcc500",
322331
"metadata": {},
323332
"outputs": [
@@ -326,22 +335,22 @@
326335
"output_type": "stream",
327336
"text": [
328337
"[Parallel(n_jobs=1)]: Using backend SequentialBackend with 1 concurrent workers.\n",
329-
"[Parallel(n_jobs=1)]: Done 1 out of 1 | elapsed: 20.3s remaining: 0.0s\n",
330-
"[Parallel(n_jobs=1)]: Done 13 out of 13 | elapsed: 1.4min finished\n",
338+
"[Parallel(n_jobs=1)]: Done 1 out of 1 | elapsed: 7.5s remaining: 0.0s\n",
339+
"[Parallel(n_jobs=1)]: Done 12 out of 12 | elapsed: 49.6s finished\n",
331340
"\n",
332-
"[2022-12-31 17:34:20] Features: 1/4 -- score: 0.8196999999999999[Parallel(n_jobs=1)]: Using backend SequentialBackend with 1 concurrent workers.\n",
333-
"[Parallel(n_jobs=1)]: Done 1 out of 1 | elapsed: 14.2s remaining: 0.0s\n",
334-
"[Parallel(n_jobs=1)]: Done 12 out of 12 | elapsed: 1.1min finished\n",
341+
"[2023-01-25 00:12:20] Features: 1/4 -- score: 0.8196999999999999[Parallel(n_jobs=1)]: Using backend SequentialBackend with 1 concurrent workers.\n",
342+
"[Parallel(n_jobs=1)]: Done 1 out of 1 | elapsed: 6.8s remaining: 0.0s\n",
343+
"[Parallel(n_jobs=1)]: Done 11 out of 11 | elapsed: 45.2s finished\n",
335344
"\n",
336-
"[2022-12-31 17:35:25] Features: 2/4 -- score: 0.8381000000000001[Parallel(n_jobs=1)]: Using backend SequentialBackend with 1 concurrent workers.\n",
337-
"[Parallel(n_jobs=1)]: Done 1 out of 1 | elapsed: 7.5s remaining: 0.0s\n",
338-
"[Parallel(n_jobs=1)]: Done 11 out of 11 | elapsed: 54.4s finished\n",
345+
"[2023-01-25 00:13:06] Features: 2/4 -- score: 0.8391[Parallel(n_jobs=1)]: Using backend SequentialBackend with 1 concurrent workers.\n",
346+
"[Parallel(n_jobs=1)]: Done 1 out of 1 | elapsed: 5.9s remaining: 0.0s\n",
347+
"[Parallel(n_jobs=1)]: Done 10 out of 10 | elapsed: 38.0s finished\n",
339348
"\n",
340-
"[2022-12-31 17:36:19] Features: 3/4 -- score: 0.8526999999999999[Parallel(n_jobs=1)]: Using backend SequentialBackend with 1 concurrent workers.\n",
341-
"[Parallel(n_jobs=1)]: Done 1 out of 1 | elapsed: 8.1s remaining: 0.0s\n",
342-
"[Parallel(n_jobs=1)]: Done 10 out of 10 | elapsed: 1.0min finished\n",
349+
"[2023-01-25 00:13:44] Features: 3/4 -- score: 0.8513[Parallel(n_jobs=1)]: Using backend SequentialBackend with 1 concurrent workers.\n",
350+
"[Parallel(n_jobs=1)]: Done 1 out of 1 | elapsed: 5.5s remaining: 0.0s\n",
351+
"[Parallel(n_jobs=1)]: Done 9 out of 9 | elapsed: 38.7s finished\n",
343352
"\n",
344-
"[2022-12-31 17:37:22] Features: 4/4 -- score: 0.8548"
353+
"[2023-01-25 00:14:23] Features: 4/4 -- score: 0.8539999999999999"
345354
]
346355
}
347356
],
@@ -351,7 +360,7 @@
351360
},
352361
{
353362
"cell_type": "code",
354-
"execution_count": 11,
363+
"execution_count": 12,
355364
"id": "1b137ab4",
356365
"metadata": {},
357366
"outputs": [
@@ -370,7 +379,7 @@
370379
},
371380
{
372381
"cell_type": "code",
373-
"execution_count": 12,
382+
"execution_count": 13,
374383
"id": "eb046ead",
375384
"metadata": {},
376385
"outputs": [
@@ -456,7 +465,7 @@
456465
"4 43 1 1 0 0"
457466
]
458467
},
459-
"execution_count": 12,
468+
"execution_count": 13,
460469
"metadata": {},
461470
"output_type": "execute_result"
462471
}
@@ -472,17 +481,17 @@
472481
},
473482
{
474483
"cell_type": "code",
475-
"execution_count": 13,
484+
"execution_count": 14,
476485
"id": "3b8ecb17",
477486
"metadata": {},
478487
"outputs": [
479488
{
480489
"data": {
481490
"text/plain": [
482-
"((10000, 5), (10000, 14))"
491+
"((10000, 5), (10000, 13))"
483492
]
484493
},
485-
"execution_count": 13,
494+
"execution_count": 14,
486495
"metadata": {},
487496
"output_type": "execute_result"
488497
}

Linear Model/FA/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ Eigenvalues are nothing but the amount of variance the factor explains.
6565

6666
<h2>Factor Analysis Vs. Principle Component Analysis</h2>
6767
<ul>
68+
<li>PCA component is a linear combination of the observed variable while in FA, the observed variables are linear combinations of the unobserved variable or factor.</li>
6869
<li>PCA components explain the maximum amount of variance while factor analysis explains the covariance in data.</li>
6970
<li>PCA components are fully orthogonal to each other whereas factor analysis does not require factors to be orthogonal.</li>
70-
<li>PCA component is a linear combination of the observed variable while in FA, the observed variables are linear combinations of the unobserved variable or factor.</li>
7171
<li>PCA components are uninterpretable. In FA, underlying factors are labelable and interpretable.</li>
7272
<li>PCA is a kind of dimensionality reduction method whereas factor analysis is the latent variable method. </li>
7373
<li>PCA is a type of factor analysis. PCA is observational whereas FA is a modeling technique.</li>

Linear Model/PCA/PCA 1.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
},
1111
{
1212
"cell_type": "code",
13-
"execution_count": null,
13+
"execution_count": 1,
1414
"id": "057ee0dc",
1515
"metadata": {},
1616
"outputs": [],
1717
"source": [
18-
"#import library\n",
18+
"#import the libraries\n",
1919
"import numpy as np\n",
2020
"import pandas as pd\n",
2121
"from sklearn.decomposition import PCA\n",
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"cells": [],
3+
"metadata": {},
4+
"nbformat": 4,
5+
"nbformat_minor": 5
6+
}

Linear Model/SVD/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
<h1>svd </h1>
1+
<h1>svd </h1>
2+
The Singular Value Decomposition (SVD) of a matrix is a factorization of that matrix into three matrices. It has some interesting algebraic properties and conveys important geometrical and theoretical insights about linear transformations. It also has some important applications in data science. In this article, I will try to explain the mathematical intuition behind SVD and its geometrical meaning.

0 commit comments

Comments
 (0)