|
|
|
|
|
摘要:
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)
编辑
|
|