main.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:MachineLearningBasics 作者: zoebchhatriwala 项目源码 文件源码
def main():

    iris = datasets.load_iris()
    x = iris.data
    y = iris.target

    x_train, x_test, y_train, y_test = train_test_split(x, y, test_size=.5)
    clr = NewClassifier()
    clr.fit(x_train, y_train)
    prediction = clr.predict(x_test)

    # Prediction accuracy
    print("Accuracy: " + str(accuracy_score(y_test, prediction) * 100) + "%")


# Run main
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号