摘要:
import numpy as npfrom .metrics import r2_scoreclass SimpleLinearRegression: def __init__(self): """初始化Simple Linear Regression模型""" self.a_ = None se 阅读全文
摘要:
import numpy as npclass StandardScaler: def __init__(self): self.mean_ = None self.scale_ = None def fit(self, X): """根据训练数据集X获得数据的均值和方差""" assert X.n 阅读全文
摘要:
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 阅读全文
摘要:
import numpy as npclass PCA: def __init__(self, n_components): """初始化PCA""" assert n_components >= 1, "n_components must be valid" self.n_components = 阅读全文
摘要:
import numpy as npfrom math import sqrtdef accuracy_score(y_true, y_predict): """计算y_true和y_predict之间的准确率""" assert len(y_true) == len(y_predict), \ " 阅读全文
摘要:
import numpy as npfrom .metrics import r2_scoreclass LinearRegression: def __init__(self): """初始化Linear Regression模型""" self.coef_ = None self.interce 阅读全文
摘要:
import numpy as npfrom math import sqrtfrom collections import Counterfrom .metrics import accuracy_scoreclass KNNClassifier: def __init__(self, k): " 阅读全文
摘要:
一、CDH环境搭建目录 --CDH相关包的下载地址:http://archive.cloudera.com/cm5/cm/5/http://archive.cloudera.com/cdh5/parcels/latest/ 创建用户用户:userdel -r cloudera-scmgroupadd 阅读全文
摘要:
一、sparkstreaming + kafka + zookeeper + hbase整体发布说明 阅读全文
摘要:
#commonsystem.debug=1#canalcanal.ip=10.60.81.171canal.port=11111#canal.destination=es,redis,kafkacanal.destination=kafka185,kafka186,kafka187,kafka188 阅读全文