原创 torch learning 1

torch tensor 1. tensor的值value import torch x = torch.empty(5, 3) print(x) #tensor([[0., 0., 0.], [0., 0., 0.],

原创 windows下配置pytorch環境的步驟。

轉載,出處https://www.jianshu.com/p/07abfe5f82e1

原创 Python數據可視化 常用案例

主體代碼先附上: # !pip install brewer2mpl import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.p

原创 可視化 --python 窗圖

1 figure 1.1 創建figure 在上文中我們一直提到的figure指的是Figure類的實例化對象,當然我們一般不會直接去實例化Figure類,因爲這樣創建的Figure實例對象不能納入序列中共同管理。matplotlib中提

原创 python正則模塊re

python正則模塊re 一.re模塊內置的函數方法 re.compile(pattern, flags=0) https://cdn.analyticsvidhya.com/wp-content/uploads/2019/06

原创 python xgboost 調參

def modelfit(model, X_train, X_test, y_train, y_test,useTrainCV, eval_metric='auc', cv_folds=4, early_st

原创 python 混淆矩陣繪圖

y_predicted=bdt.predict(X_test) from sklearn.metrics import confusion_matrix from sklearn import cross_validation, met

原创 python 交叉驗證1

# 2> 十折決策樹算法 from sklearn.tree import DecisionTreeClassifier #導入決策樹模型 from __future__ import division from sklearn.met

原创 mysql事務1

##mysql數據庫事務### 1. 主鍵 超鍵 候選鍵 外鍵   主 鍵:數據庫表中對儲存數據對象予以唯一和完整標識的數據列或屬性的組合。一個數據列只能有一個主鍵,且主鍵的取值不能缺失,即不能爲空值(Null)。   超 鍵:在關係中能

原创 python 時間序列缺失值

此處提供了三種數據填充方法: # 缺失值處理:補充缺失的數據 # 三種方法:Lagrange插值法和Newton插值法以及Series自帶的interpolate #1、Lagrange插值法和Newton插值法解決實際問題中關於只提供

原创 python EDA

#導入可能需要的包,應爲我們先做的是初步的分析嘛,所以可視化的包和pandas,numpy ,scipy還是要導入的 #https://www.kaggle.com/wkevin/house-prices/notebook import

原创 mysql 增刪改

##表的創建、更新、修改 創建表 Create table actor Actor_id smallint(5) notnull Primary key, First_name varchar(45) not null, Last_nam

原创 python 迴歸問題特徵篩選

import statsmodels.formula.api as smf import pandas as pd def forward_selected(data, response): """前向逐步迴歸算法,源代碼來

原创 python psi指標

def Cal_Psi(score,pre_score,length=10): import math labels=['c'+str(i) for i in range(length)] True_out,bi

原创 python 參數選擇 基於非常規metric

#調參通過網格搜索完成 from sklearn.datasets import make_hastie_10_2 from sklearn.model_selection import GridSearchCV from sklear