查看: 2698| 回复: 29
跳转到指定楼层
上一主题 下一主题
收起左侧

在职个人战拖打卡DataCamp

全局:

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看附件。没有帐号?注册账号

x
我发现自己的一个问题在于每天都在抽时间学习,但是因为资源太多,经常会没把一个资源跟完就觉得另一个资源更好更需要prioritize而放弃之前的。最近enroll了DataCamp的 Data Scientist Track,希望可以在这个帖子每日打卡(只打卡 DataCamp的进程),督促自己不要又分心熊瞎子掰苞米了~DataCamp这个track可以帮助我巩固coding和analysis的基础,所以一定要坚持不要放弃!加油w

上一篇:看看走过的路,希望一切都值得
下一篇:在职工作打卡
推荐
 楼主| kellyrxw 2020-6-15 10:55:06 | 只看该作者
全局:
06/14 打卡完成了Machine Learning with Tree-Based Models in Python~
Bagging
• Training models with the same algorithm, based on different training subsets

OOB
• Train models on bootstrap samples, and evaluate based on OOB samples
• set oob_score = True in BaggingClassifier

Random Forest
• Different from bagging: use only trees as base estimators; more randomization for the # of features used
• Feature importance: the weight of the feature used in training and prediction
• Visualization of feature importance: horizontal barplot of the feature importance

AdaBoost
• Combine weak learners in ensemble learning
• Each predictor pays more attention to wrongly predicted points from its predecessor predictions (by adjusting alpha)
• Tradeoff between learning rate and number of predictors
• Instantiate base estimator --> Instantiate AdaBooster --> fit, predict_proba, evaluate with auc scores

Gradient Boosting
• Use CART as estimators, does not tweak weights of training instances
• Starting from predictor 2, use residual errors from predecessor predictors as labels (instead of dataset labels y)
• Instantiate GradientBoostingRegressor --> fit, predict, evaluate with RMSE

Stochastic Boosting
• To avoid the same split points and features being used in individual CARTs for Gradient Boosting
• Specify subsample (% of training data) and max_features (% of features) used to find the best split

Hyperparameter Tuning
• Scores: accuracy score (classifiers) & R^2 (regressors)
• Approaches: GridSearchCV, RandomSearch, Baysian Optimization, Genetic Algorithms
回复

使用道具 举报

推荐
 楼主| kellyrxw 2020-6-15 00:22:39 | 只看该作者
全局:
06/13 打卡Machine Learning with Tree-Based Models in Python前两章~
Classification Trees
• Information Gain (Feature, Split Point)  = Information (Parent) - % of samples on the left * Information (left) - % of samples on the right * Information (right)
• Maximize IG at each internal node, and if IG = 0 then make it a leaf
• Preprocessing, train_test_split --> Instantiate (specify criterion, max_depth, random_state) --> Fit --> Predict --> Accuracy Score

Regression Trees
• Impurity (node) = MSE (node)

Generalization Error
• error terms ^ 2 + variance from different training sets + irreducible error
• tradeoff between low bias (accuracy) and low variance (precision)
• estimate generalization error: use the test set error; use cross validations --> K-fold CV: error = avg(CV error)
• high variance: overfitting, CV error > training set error --> reduce model complexity
• high bias: underfitting, CV error ~= training set error >> desired error --> increase model complexity, gather more relevant features
# Compute the array containing the 10-folds CV MSEs
MSE_CV_scores = - cross_val_score(dt, X_train, y_train, cv=10,
                       scoring='neg_mean_squared_error',
                       n_jobs=-1)
回复

使用道具 举报

推荐
 楼主| kellyrxw 2020-6-12 00:54:43 | 只看该作者
全局:
06/10 打卡完成Unsupervised Learning~

PCA
• To identify intrinsic dimensions and reduce dimensions: intrinsic dimension = number of PCA features with significant variance
• instantiate --> fit --> transform
• PCA(n_components = 2)
• principal components: model.components_; first principal component: model.components_[0,:]
• mean of the sample: model.mean_
• extract the number of features: range(model.n_components_)
• variance: model.explained_variance_
• xs = transformed[:,0], ys = transformed[:,1]

TruncatedSVD
• equivalent of PCA for text documents
• use csr_matrix instead of numpy array

Non-negative Matrix Factorization
• more interpretable than PCA
• all sample features must be non-negative
• sample reconstruction: Multiply components by feature values, and add up

Recommender System
1. word frequency array
2. apply NMF
3. calculate cosine similarity
from sklearn.preprocessing import normalize
(normalized features.dot(current article))

Other basic stuff
• slicing: cannot apply iloc or loc to numpy arrays
• showing bitmap:
def show_as_image(sample):
    bitmap = sample.reshape((13, 8))
    plt.figure()
    plt.imshow(bitmap, cmap='gray', interpolation='nearest')
    plt.colorbar()
    plt.show()
回复

使用道具 举报

🔗
 楼主| kellyrxw 2020-4-9 03:50:47 | 只看该作者
全局:
04/08 完成了系列里的第六节课 Introduction to Data Visualization with Seaborn
Coding wise: syntax differences between Seaborn and Matplotlib
1. Names of plots:
[Seaborn] scatter vs. [Matplotlib] scatterplot
barplot vs. countplot
2. Elements:
color vs. hue

Visualization wise: what graph to choose to display the relationship between two variables
1. Quantitative vs. Qualitative: use relplot/catplot, with subgroups specified in row/col/hue/size/style; point plot (if time series)
2. Quantitative vs. Quantitative: use scatterplot (if not time series)/ line plot (if time series), and specify the third variable in hue/size/style

Seaborn can create two object types:
1.  FacetGrid: relplot(), catplot() can create subplots
2.  AxesSubplot: scatterplot(), countplot(), etc. only single plots
回复

使用道具 举报

🔗
 楼主| kellyrxw 2020-4-10 12:15:08 | 只看该作者
全局:
今天生病惹,下午又突然出来很紧急的活
然而最后完成了第七课的Python toolbox的三分之一 鼓励一下自己~
回复

使用道具 举报

🔗
 楼主| kellyrxw 2020-4-11 12:46:48 | 只看该作者
全局:
今天完成了python toolbox 1~讲function的部分让我对之前java的一知半解的variables概念又有了些许补充。昨天到今天工作上take lead完成了quick turnaround,感觉还是有挑战的生活有趣些!
回复

使用道具 举报

🔗
 楼主| kellyrxw 2020-4-12 12:52:49 | 只看该作者
全局:
今天完成了python toolbox 2~ 完全无法静心的今天也算圆满完成任务!第一次了解list comprehension还是有点搞hh
回复

使用道具 举报

🔗
 楼主| kellyrxw 2020-4-13 11:40:33 | 只看该作者
全局:
打卡~今天完成了Intermediate Visualization的前半部分,明天在probono 的nonprofit case上可以使用这些visualization来做EDA。今天花了好长时间回顾之前的项目,感觉真的要学的要实践的东西还好多~
回复

使用道具 举报

🔗
 楼主| kellyrxw 2020-4-19 11:26:44 | 只看该作者
全局:
打卡~完成了intermediate visualization,pairplot算是打开新世界的大门啦。heatmap很像周五MD想发展的产品features,下次在tableau 里可以好好利用分析
回复

使用道具 举报

🔗
 楼主| kellyrxw 2020-4-20 06:17:13 | 只看该作者
全局:
打卡! 完成了a visualizing history of Nobel Prize Winners的project
主要复习了
• 用np.where(condition, true_value, false_value)来map values
• 用df.nsmallest(n, 'col_name') 和nlargest来选该column里面最小和最大值对应的rows
• df.groupby('col_name', as_index = False) 可以防止把groupby的column当成index, 之前一直没发现还有这个操作hh
回复

使用道具 举报

🔗
 楼主| kellyrxw 2020-4-24 11:41:45 来自APP | 只看该作者
全局:
打卡一章pyspark
回复

使用道具 举报

🔗
 楼主| kellyrxw 2020-5-18 11:03:20 | 只看该作者
全局:
打卡完成了importing data in python~
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表