摘要: import numpy as npfrom .metrics import r2_scoreclass SimpleLinearRegression: def __init__(self): """初始化Simple Linear Regression模型""" self.a_ = None se 阅读全文
posted @ 2018-12-18 10:27 何国秀_xue 阅读(357) 评论(0) 推荐(0) 编辑
摘要: import numpy as npclass StandardScaler: def __init__(self): self.mean_ = None self.scale_ = None def fit(self, X): """根据训练数据集X获得数据的均值和方差""" assert X.n 阅读全文
posted @ 2018-12-18 10:26 何国秀_xue 阅读(309) 评论(0) 推荐(0) 编辑
摘要: import numpy as npdef train_test_split(X, y, test_ratio=0.2, seed=None): """将数据 X 和 y 按照test_ratio分割成X_train, X_test, y_train, y_test""" assert X.shap 阅读全文
posted @ 2018-12-18 10:25 何国秀_xue 阅读(728) 评论(0) 推荐(0) 编辑
摘要: import numpy as npclass PCA: def __init__(self, n_components): """初始化PCA""" assert n_components >= 1, "n_components must be valid" self.n_components = 阅读全文
posted @ 2018-12-18 10:25 何国秀_xue 阅读(201) 评论(0) 推荐(0) 编辑
摘要: import numpy as npfrom math import sqrtdef accuracy_score(y_true, y_predict): """计算y_true和y_predict之间的准确率""" assert len(y_true) == len(y_predict), \ " 阅读全文
posted @ 2018-12-18 10:24 何国秀_xue 阅读(314) 评论(0) 推荐(0) 编辑
摘要: import numpy as npfrom .metrics import r2_scoreclass LinearRegression: def __init__(self): """初始化Linear Regression模型""" self.coef_ = None self.interce 阅读全文
posted @ 2018-12-18 10:23 何国秀_xue 阅读(327) 评论(0) 推荐(0) 编辑
摘要: import numpy as npfrom math import sqrtfrom collections import Counterfrom .metrics import accuracy_scoreclass KNNClassifier: def __init__(self, k): " 阅读全文
posted @ 2018-12-18 10:22 何国秀_xue 阅读(618) 评论(0) 推荐(0) 编辑
摘要: 一、CDH环境搭建目录 --CDH相关包的下载地址:http://archive.cloudera.com/cm5/cm/5/http://archive.cloudera.com/cdh5/parcels/latest/ 创建用户用户:userdel -r cloudera-scmgroupadd 阅读全文
posted @ 2018-12-18 10:03 何国秀_xue 阅读(627) 评论(0) 推荐(0) 编辑
摘要: 一、sparkstreaming + kafka + zookeeper + hbase整体发布说明 阅读全文
posted @ 2018-12-18 09:58 何国秀_xue 阅读(132) 评论(0) 推荐(0) 编辑
摘要: #commonsystem.debug=1#canalcanal.ip=10.60.81.171canal.port=11111#canal.destination=es,redis,kafkacanal.destination=kafka185,kafka186,kafka187,kafka188 阅读全文
posted @ 2018-12-18 09:56 何国秀_xue 阅读(423) 评论(0) 推荐(0) 编辑