sklearn python API

  • LinearRegression
from sklearn.linear_model import LinearRegression         # 线性回归 #
module = LinearRegression()
module.fit(x, y)
module.score(x, y)
module.predict(test)

  • LogisticRegression
from sklearn.linear_model import LogisticRegression         # 逻辑回归 #
module = LogisticRegression()
module.fit(x, y)
module.score(x, y)
module.predict(test)

  • KNN
from sklearn.neighbors import KNeighborsClassifier     #K近邻#
from sklearn.neighbors import www.tianjiuyule178.com KNeighborsRegressor
module = KNeighborsClassifier(www.tygj178.com  n_neighbors=6)
module.fit(x, y)
predicted = module.predict(test)
predicted = module.predict_proba(test)

  • SVM
from sklearn import svm                                #支持向量机#
module = svm.SVC()
module.fit(x, y)
module.score(x, y)
module.predict(test)
module.predict_proba(test)

  • naive_bayes
from sklearn.naive_bayes import GaussianNB            #朴素贝叶斯分类器#
module = GaussianNB(www.dashuju178.com)
module.fit(x, y)
predicted = module.predict(test)

  • DecisionTree
from sklearn import tree                              #决策树分类器#
module = tree.DecisionTreeClassifier(criterion='gini')
module.fit(x, y)
module.score(x, y)
module.predict(test)

  • K-Means
from sklearn.cluster import KMeans                    #kmeans聚类#
module = KMeans(n_clusters=3, random_state=0)
module.fit(x, y)
module.predict(test)

  • RandomForest
from sklearn.ensemble import RandomForestClassifier  #随机森林#
from sklearn.ensemble import RandomForestRegressor
module = RandomForestClassifier()
module.fit(x, y)
module.predict(test)

  • GBDT
from sklearn.ensemble import GradientBoostingClassifier      www.hyptdl.com #Gradient Boosting 和 AdaBoost算法#
from sklearn.ensemble import www.fengshen157.com GradientBoostingRegressor
module = GradientBoostingClassifier(n_estimators=100, www.yundingyuLe.cn learning_rate=0.1, max_depth=1, random_state=0)
module.fit(x, y)
module.predict(test)

  • PCA
from sklearn.decomposition import PCA              #PCA特征降维#
train_reduced = PCA.fit_transform(train)
test_reduced = PCA.transform(test)

sklearn python API的更多相关文章

  1. Appium python API 总结

    Appium python api 根据testerhome的文章,再补充一些文章里面没有提及的API [TOC] [1]find element driver 的方法 注意:这几个方法只能通过sel ...

  2. The novaclient Python API

    The novaclient Python API Usage First create a client instance with your credentials: >>> f ...

  3. Openstack python api 学习文档 api创建虚拟机

    Openstack python api 学习文档 转载请注明http://www.cnblogs.com/juandx/p/4953191.html 因为需要学习使用api接口调用openstack ...

  4. BotVS开发基础—Python API

    代码 import json def main(): # python API列表 https://www.botvs.com/bbs-topic/443 #状态信息 LogStatus(" ...

  5. 《Spark Python API 官方文档中文版》 之 pyspark.sql (一)

    摘要:在Spark开发中,由于需要用Python实现,发现API与Scala的略有不同,而Python API的中文资料相对很少.每次去查英文版API的说明相对比较慢,还是中文版比较容易get到所需, ...

  6. 《Spark Python API 官方文档中文版》 之 pyspark.sql (二)

    摘要:在Spark开发中,由于需要用Python实现,发现API与Scala的略有不同,而Python API的中文资料相对很少.每次去查英文版API的说明相对比较慢,还是中文版比较容易get到所需, ...

  7. HBase Python API

    HBase Python API HBase通过thrift机制可以实现多语言编程,信息通过端口传递,因此Python是个不错的选择 吐槽 博主在Mac上配置HBase,奈何Zoomkeeper一直报 ...

  8. 二、Blender/Python API总览

    原文:https://docs.blender.org/api/blender_python_api_current/info_overview.html Python in Blender  Ble ...

  9. Appium+python自动化8-Appium Python API

    Appium+python自动化8-AppiumPython API   前言: Appium Python API全集,不知道哪个大神整理的,这里贴出来分享给大家. 1.contexts conte ...

随机推荐

  1. 日常-acm-鸡兔同笼

    已知鸡和兔总数量n,总腿数m.输入n和m,依次输出鸡的数量和兔的数量.如果无解,则输出No answer. 样例输入: 14 32 样例输出: 12 2 样例输入: 10 16 样例输出: No an ...

  2. [神经网络]一步一步使用Mobile-Net完成视觉识别(二)

    1.环境配置 2.数据集获取 3.训练集获取 4.训练 5.调用测试训练结果 6.代码讲解 本文是第二篇,调用官方例子并获取数据集. 上一节里面记得我们需要配置PYTHONPATH,大家应该发现,每次 ...

  3. Ecshop首页购物车数量调取问题

    在page_header.lbi中调用SQL: <?php $sql = 'SELECT SUM(goods_number) AS number' . ' FROM ' . $GLOBALS[' ...

  4. 【转】 树莓派初次启动攻略for Mac

    http://blog.csdn.net/rk2900/article/details/8632713/ 树莓派初次启动攻略for Mac made by Rk 感谢浙江大学<嵌入式系统> ...

  5. C07 模块化开发信息管理系统案例

    目录 需求分析 问题分析 开发阶段 需求分析 总体需求 学员信息管理系统支持以下功能 增加学员信息功能 删除学员信息功能 查询学员信息功能 修改学员信息功能 输出所有学员信息功能 退出系统 其他需求 ...

  6. javaweb基础(15)_jsp基础语法

    任何语言都有自己的语法,JAVA中有,JSP虽然是在JAVA上的一种应用,但是依然有其自己扩充的语法,而且在JSP中,所有的JAVA语句都可以使用. 一.JSP模版元素 JSP页面中的HTML内容称之 ...

  7. Java面向对象基础 ——面试题

    1面向对象基础 JAVA基础语法自行掌握. 三大特性: 一 封装:★★★★★ 概念:是指隐藏对象的属性和实现细节,仅对外提供公共访问方式. 好处:将变化隔离:便于使用:提高重用性:安全性. 封装原则: ...

  8. c++ 调用php

    int _System(const char * cmd, std::string& strRet) { FILE * fp; char * p = NULL; ; if ((fp = _po ...

  9. Unity3d 判断物体是否在可见范围内

    unity中自带两个回调函数: void OnBecameVisible()//当物体可见时,回调一次. void OnBecameInvisible()//当物体不可见时,回调一次. 在untiy编 ...

  10. 基础的Mapgis三维二次开发-插件式

    最近在做一个杭州石油的项目开发一个小系统. 1.命令必须是 ICommand 的派生类 using System; using System.Collections.Generic; using Sy ...