随着人工智能和深度学习的兴起,网络上存在的学习资源以及开源项目也愈来愈多。本文精选了的五个项目,都含有潜在新的机器学习想法,且全都是用Python实现。下面简单介绍
下这五个项目,感兴趣的能够本身上手复现一下,说不定会对本身的项目产生一些新的想法。git
在训练模型的时候最好不要只关注最终的结果,耐心观察整个训练过程,查看每一个epoch的训练结果,弄清楚模型的训练曲线是否正常,是否出现过拟合等现象。
PiotrMigdał等人开发了一个Python源代码包,能够为Keras,PyTorch和其余框架提供实时训练损失的曲线。
当使用的是Keras深度学习框架时,实时损失曲线图能够简单地经过如下回调函数调用:github
from livelossplot import PlotLossesKeras model.fit(X_train, Y_train, epochs=10, validation_data=(X_test, Y_test), callbacks=[PlotLossesKeras()], verbose=0)
该项目由Jason Carpenter开发,他是旧金山大学数据科学专业的硕士,目前是Manifold的机器学习实习生。
该项目是用于并行化Sklearn机器学习模型的拟合和灵活评分的数据包,具备可视化的功能。一旦导入该数据包,就能够自由使用bestFit()或其余功能。网络
代码示例:框架
from parfit import bestFit # Necessary if you wish to use bestFit # Necessary if you wish to run each step sequentially from parfit.fit import * from parfit.score import * from parfit.plot import * from parfit.crossval import * grid = { 'min_samples_leaf': [1, 5, 10, 15, 20, 25], 'max_features': ['sqrt', 'log2', 0.5, 0.6, 0.7], 'n_estimators': [60], 'n_jobs': [-1], 'random_state': [42] } paramGrid = ParameterGrid(grid) best_model, best_score, all_models, all_scores = bestFit(RandomForestClassifier(), paramGrid, X_train, y_train, X_val, y_val, # nfolds=5 [optional, instead of validation set] metric=roc_auc_score, greater_is_better=True, scoreLabel='AUC') print(best_model, best_score)
Yellowbrick是一款促进机器学习模型选择的视觉分析和诊断工具。具体来讲,Yellowbrick是一套名为“展现台(Visualizers)”的视觉诊断工具,它扩展了scikit-learn API,以便人为地指导模型选择过程。简而言之,Yellowbrick将scikit-learn与matplotlib结合在一块儿,且具备模型生成可视化的效果。dom