Skip to content

Commit afd05be

Browse files
More Useful Info in Python
1 parent 87b8bbc commit afd05be

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed

Lists&Dictionaries/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
### Lists & Dictionaries
2+
3+
4+
#### List Methods Table
5+
6+
| |Start | Method |Output |
7+
|----------------|-----------------|------------|---------------|
8+
|add|▢▢ |.append(▢) |▢▢▢ |
9+
|clear | ▢▢☆ |.clear() |[] |
10+
|copy | ▢▢▢ |.copy |▢▢▢ |
11+
|count | ▢▢☆ |.count(▢) |2 |
12+
|index | △▢☆ |.index(△) | 0 |
13+
|insert | ▢▢☆ |.insert(1,◯) |[▢,◯,▢,☆] |
14+
|pop i.e. removes | △▢☆ |.pop(1) |[△,☆ ] |
15+
|remove | ▢☆△ |.remove(△) |[▢, ☆] |
16+
|reverse | △▢☆ |.reverse() |[☆ , ▢, △] |

Machine Learning/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,20 @@
2121
### Machine Learning Algorithm, Problem and its Learning Style
2222
|Algorithm |Problem | Learning Style|
2323
|-------------------------------|-----------------------------|------------|
24+
|Boosting |N/A |Unsupervised
2425
|Decision Tree| Classification/Regression |Supervised
26+
|Ensemble Methods| Regression |Supervised
27+
|Gaussian Mixtures |N/A |Unsupervised
28+
|Gaussian Progresses Regression|Regression|Supervised
29+
|Hierarchical Clustering | Clustering | Unsupervised
30+
|Linear Reg|Regression|Supervised
2531
|Logistic Reg|Classification|Supervised
2632
|K-Means| Clustering |Unsupervised
2733
|KNN| Classification|Supervised
2834
|Naive-Bayes| Classification|Supervised
2935
|Random Forest| Classification/Regression |Supervised
36+
|Spectral Clustering|Clustering|Unsupervised
37+
|Support Vector Regression|Regression|Supervised
3038
|SVM| Classification/Regression|Supervised
3139

3240

@@ -41,6 +49,13 @@
4149
- Find the ideal model weights which reduces the loss between predicted and actual value
4250
- whilst remembering to obtain the best fit of a certain dataset to the model
4351

52+
### Naive Bayes Algorith
53+
54+
- Based on the Bayes Theorem
55+
- It gathers information to determine the probability of an event to take place based on knowledge
56+
- ... it has from the past which are related to the event
57+
- It is naive because the way it makes up its decision may or may not be accurate
58+
4459

4560
### Cross-Validation:
4661
- Gives you the performance of your ML model depending on the new unseen data

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,38 @@ The compiler will raise an error telling you you cannot convert the 2nd datatype
165165
- UnicodeError: Unicode Encoding/Decoding Error is taking place
166166

167167
- ValueError: When you pass in a value into a function to perform a computation. The value is the correct data type but of incorrect value
168+
169+
170+
171+
### Powerful One Liners
172+
173+
1. Swap Two Vars
174+
175+
```python
176+
177+
polan2632, dj32 = dj32, polan2632
178+
```
179+
180+
2. One Liner If Else Statement
181+
182+
```python
183+
myvar = 42932 if 3532 < 237627332 else 37532
184+
```
185+
186+
3. Sum of every other value
187+
188+
```python
189+
sum(prices[::2])
190+
```
191+
192+
4. Determining If a phrase is a palindrome
193+
194+
```python
195+
phrase.find(phrase[::-1])
196+
```
197+
198+
5. Replace a text within a text file
199+
200+
```python
201+
print(open("somefile.txt").read().replace("hi", "bye"))
202+
```

0 commit comments

Comments
 (0)