|
|
|
|
|
摘要:
import scipy from sklearn.datasets import load_digits from sklearn.metrics import classification_report from sklearn.linear_model import LogisticRegression from sklearn.model_selection import train_... 阅读全文
posted @ 2019-05-02 16:50
吴裕雄
阅读(1685)
推荐(0)
编辑
摘要:
import scipy from sklearn.datasets import load_digits from sklearn.metrics import classification_report from sklearn.linear_model import LogisticRegression from sklearn.model_selection import train_... 阅读全文
posted @ 2019-05-02 16:44
吴裕雄
阅读(3939)
推荐(0)
编辑
摘要:
import numpy as np import matplotlib.pyplot as plt from sklearn.svm import LinearSVC from sklearn.datasets import load_digits from sklearn.model_selection import validation_curve #模型选择验证曲线validatio... 阅读全文
posted @ 2019-05-02 16:35
吴裕雄
阅读(1556)
推荐(0)
编辑
摘要:
import numpy as np import matplotlib.pyplot as plt from sklearn.svm import LinearSVC from sklearn.datasets import load_digits from sklearn.model_selection import learning_curve #模型选择学习曲线learning_cu... 阅读全文
posted @ 2019-05-02 15:06
吴裕雄
阅读(1909)
推荐(0)
编辑
摘要:
from sklearn.metrics import mean_absolute_error,mean_squared_error #模型选择回归问题性能度量mean_absolute_error模型 def test_mean_absolute_error(): y_true=[1,1,1,1,1,2,2,2,0,0] y_pred=[0,0,0,1,1,1,0,0,0,0... 阅读全文
posted @ 2019-05-02 14:59
吴裕雄
阅读(366)
推荐(0)
编辑
摘要:
import numpy as np import matplotlib.pyplot as plt from sklearn.svm import SVC from sklearn.datasets import load_iris from sklearn.preprocessing import label_binarize from sklearn.multiclass impo... 阅读全文
posted @ 2019-05-02 14:55
吴裕雄
阅读(515)
推荐(0)
编辑
摘要:
import numpy as np from sklearn.model_selection import train_test_split,KFold,StratifiedKFold,LeaveOneOut,cross_val_score #模型选择数据集切分train_test_split模型 def test_train_test_split(): X=[[1,2,3,4],... 阅读全文
posted @ 2019-05-02 14:27
吴裕雄
阅读(796)
推荐(0)
编辑
摘要:
from sklearn.metrics import zero_one_loss,log_loss def test_zero_one_loss(): y_true=[1,1,1,1,1,0,0,0,0,0] y_pred=[0,0,0,1,1,1,1,1,0,0] print("zero_one_loss:",zero_one_loss(y_true,y_pred,... 阅读全文
posted @ 2019-05-02 14:06
吴裕雄
阅读(311)
推荐(0)
编辑
摘要:
from sklearn.decomposition import DictionaryLearning #数据预处理字典学习DictionaryLearning模型 def test_DictionaryLearning(): X=[[1,2,3,4,5], [6,7,8,9,10], [10,9,8,7,6,], [5,4,3,2,1]] ... 阅读全文
posted @ 2019-05-02 13:50
吴裕雄
阅读(570)
推荐(0)
编辑
摘要:
from sklearn.svm import LinearSVC from sklearn.pipeline import Pipeline from sklearn import neighbors, datasets from sklearn.datasets import load_digits from sklearn.linear_model import LogisticRegre... 阅读全文
posted @ 2019-05-02 13:44
吴裕雄
阅读(1509)
推荐(0)
编辑
摘要:
import numpy as np import matplotlib.pyplot as plt from sklearn.svm import LinearSVC from sklearn.linear_model import Lasso from sklearn.model_selection import train_test_split from sklearn.feature... 阅读全文
posted @ 2019-05-02 13:17
吴裕雄
阅读(658)
推荐(0)
编辑
摘要:
from sklearn.svm import LinearSVC from sklearn.datasets import load_iris from sklearn.feature_selection import RFE,RFECV from sklearn.model_selection import train_test_split #数据预处理包裹式特征选取RFE模型 def t... 阅读全文
posted @ 2019-05-02 12:32
吴裕雄
阅读(852)
推荐(0)
编辑
摘要:
from sklearn.feature_selection import SelectPercentile,f_classif #数据预处理过滤式特征选取SelectPercentile模型 def test_SelectKBest(): X=[[1,2,3,4,5], [5,4,3,2,1], [3,3,3,3,3,], ... 阅读全文
posted @ 2019-05-02 12:21
吴裕雄
阅读(1900)
推荐(0)
编辑
摘要:
from sklearn.feature_selection import SelectKBest,f_classif #数据预处理过滤式特征选取SelectKBest模型 def test_SelectKBest(): X=[[1,2,3,4,5], [5,4,3,2,1], [3,3,3,3,3,], [1,1,1,1,1... 阅读全文
posted @ 2019-05-02 12:20
吴裕雄
阅读(4905)
推荐(0)
编辑
摘要:
from sklearn.feature_selection import VarianceThreshold #数据预处理过滤式特征选取VarianceThreshold模型 def test_VarianceThreshold(): X=[[100,1,2,3], [100,4,5,6], [100,7,8,9], [101,11,12,... 阅读全文
posted @ 2019-05-02 12:18
吴裕雄
阅读(3095)
推荐(0)
编辑
摘要:
from sklearn.preprocessing import Normalizer #数据预处理正则化Normalizer模型 def test_Normalizer(): X=[[1,2,3,4,5], [5,4,3,2,1], [1,3,5,2,4,], [2,4,1,3,5]] print("before ... 阅读全文
posted @ 2019-05-02 12:00
吴裕雄
阅读(2403)
推荐(0)
编辑
摘要:
from sklearn.preprocessing import MaxAbsScaler #数据预处理标准化MaxAbsScaler模型 def test_MaxAbsScaler(): X=[[1,5,1,2,10], [2,6,3,2,7], [3,7,5,6,4,], [4,8,7,8,1]] print("before trans... 阅读全文
posted @ 2019-05-02 11:52
吴裕雄
阅读(1363)
推荐(0)
编辑
摘要:
from sklearn.preprocessing import StandardScaler #数据预处理标准化StandardScaler模型 def test_StandardScaler(): X=[[1,5,1,2,10], [2,6,3,2,7], [3,7,5,6,4,], [4,8,7,8,1]] print("before... 阅读全文
posted @ 2019-05-02 11:52
吴裕雄
阅读(2864)
推荐(0)
编辑
摘要:
from sklearn.preprocessing import MinMaxScaler #数据预处理标准化MinMaxScaler模型 def test_MinMaxScaler(): X=[[1,5,1,2,10], [2,6,3,2,7], [3,7,5,6,4,], [4,8,7,8,1]] print("before trans... 阅读全文
posted @ 2019-05-02 11:50
吴裕雄
阅读(3428)
推荐(0)
编辑
摘要:
from sklearn.preprocessing import OneHotEncoder #数据预处理二元化OneHotEncoder模型 def test_OneHotEncoder(): X=[[1,2,3,4,5], [5,4,3,2,1], [3,3,3,3,3,], [1,1,1,1,1]] print... 阅读全文
posted @ 2019-05-02 11:36
吴裕雄
阅读(780)
推荐(0)
编辑
|
|