
简介
该用户还未填写简介
擅长的技术栈
可提供的服务
暂无可提供的服务
第1关:标准化# -*- coding: utf-8 -*-from sklearn.preprocessing import scale,MaxAbsScaler,MinMaxScaler#实现数据预处理方法def Preprocessing(x,y):'''x(ndarray):处理 数据y(str):y等于'z_score'使用z_score方法y等于'minmax'使用MinMaxScal
第1关:Baggingimport numpy as npfrom collections import Counterfrom sklearn.tree import DecisionTreeClassifierclass BaggingClassifier():def __init__(self, n_model=10):'''初始化函数'''#分类器的数量,默认为10self.n_model
第1关:knn算法概述#encoding=utf8import numpy as npdef topK(i,k,x,y):'''input:i(int):第i个样本k(int):最近邻样本个数x(ndarray):数据特征y(ndarray):数据标签output:topK(list):样本i的最近k个样本标签'''#*********Begin********
第1关:Baggingimport numpy as npfrom collections import Counterfrom sklearn.tree import DecisionTreeClassifierclass BaggingClassifier():def __init__(self, n_model=10):'''初始化函数'''#分类器的数量,默认为10self.n_model
第1关:为什么要有训练集与测试集1、D2、A第2关:欠拟合与过拟合1、B2、ABD第3关:偏差与方差1、B第4关:验证集与交叉验证1、D2、BCD第5关:衡量回归的性能指标1、AB第6关:准确度的陷阱与混淆矩阵import numpy as npdef confusion_matrix(y_true, y_predict):'''构建二分类的混淆矩阵,并将其返回:param y_true: 真实类
第1关:什么是质心#encoding=utf8import numpy as np#计算样本间距离def distance(x, y, p=2):'''input:x(ndarray):第一个样本的坐标y(ndarray):第二个样本的坐标p(int):等于1时为曼哈顿距离,等于2时为欧氏距离output:distance(float):x到y的距离'''#********* Begin **
第1关:线性判别分析 - 随机生成数的降维# encoding=utf8import numpy as npfrom numpy.linalg import invdef lda(X, y):'''input:X(ndarray):待处理数据y(ndarray):待处理数据标签,标签分别为0和1output:X_new(ndarray):处理后的数据'''# ********* Begin ***
第1关:线性判别分析 - 随机生成数的降维# encoding=utf8import numpy as npfrom numpy.linalg import invdef lda(X, y):'''input:X(ndarray):待处理数据y(ndarray):待处理数据标签,标签分别为0和1output:X_new(ndarray):处理后的数据'''# ********* Begin ***
第1关:什么是机器学习1.BC第2关:机器学习的常见术语1.B第3关:机器学习的主要任务1.B2.AD3.B







