#Read over#data professor#emma Ding#mahesh huddar#ritvik mathPart 1 Load a Dataset Part 2 SIMPLE EDA Part 3 Set Up the Data Part 4 BASELINE MODEL – NO FIXING THE IMBALANCE part 5Oversampling ExampleOversampling Example 1 RandomOverSampler To start we’re going to create a simple dataframe in python led to overfitting part 6Oversampling Method Example 2 SMOTE […]
simpsons paradox in Python
2nd example Running 1st plot just the mile time/miles per week
two sample z test scipy
#Example 1 More Manual – From Slides Quicker way to test it – Not Entirely preciseThe ztest function in statsmodels.stats.weightstatsdoes not explicitly allow for directlypassing the population standard deviation. Instead, it estimates the standard error based on thesample standard deviations unless the sample variance is explicitly pooled example 2 marathon times of two running clubs […]
paired sign test in Python
Example 1 Example 2 #one tail #zero value #shapiro #ordinal data Example statsmodel
Column Transformer
#drop #Example Passthrough some columns, drop offthers
extra trees classifier
Aggregates the results from group of decision trees (Like a random forest) Difference 1. ETC randomly selects the value to split features unlike a DTC which looks for the best2. Makes ETC More random + Faster Algorithm which can help with noisy data
Python Reduced Row Echelon Form
From REF to RREF
Lasso Regression
https://youtu.be/LmpBt0tenJE#LASSO stands for Least Absolute Shrinkage and Selection Operator#L1 regularization #address overfitting – A model that is too complex may fit the training data very well#but perform poorly on new, unseen data #will get rid ofe useless features (make coefficients independent var next to 0)#- automatic feature selection # lead to a simpler model that […]
Python Augmented Matrix
Example 1 Example 2 row operations Multiply the first row by 3 add: 2nd row to the first subtract 2nd row from the 3rd
web scraping with python
import requests from urllib.parse import urljoin import urllib.robotparser web scraping with python Part 1 Getting your first page def response_code(response): if response.status_code == 200: print(“Page fetched successfully!”) else: print(“Failed to retrieve page:”, response.status_code) URL = “http://books.toscrape.com/” url_response = requests.get(URL) response_code(url_response) Failed to retrieve page: 403 | a client does not have the necessary permissions to […]