VB.net 2010 视频教程 VB.net 2010 视频教程 python基础视频教程
SQL Server 2008 视频教程 c#入门经典教程 Visual Basic从门到精通视频教程
当前位置:
首页 > 编程开发 > python3 >
  • python3教程之初识人工智能(二):机器学习(三):sklearn数据集(10)

本站最新发布   Python从入门到精通|Python基础教程
试听地址  
https://www.xin3721.com/eschool/pythonxin3721/


- AGE proportion of owner-occupied units built prior to 1940
  • - DIS weighted distances to five Boston employment centres
  • - RAD index of accessibility to radial highways
  • - TAX full-value property-tax rate per $10,000
  • - PTRATIO pupil-teacher ratio by town
  • - B 1000(Bk - 0.63)^2 where Bk is the proportion of blacks by town
  • - LSTAT % lower status of the population
  • - MEDV Median value of owner-occupied homes in $1000's
  •  
  • :Missing Attribute Values: None
  •  
  • :Creator: Harrison, D. and Rubinfeld, D.L.
  •  
  • This is a copy of UCI ML housing dataset.
  • https://archive.ics.uci.edu/ml/machine-learning-databases/housing/
  •  
  •  
  • This dataset was taken from the StatLib library which is maintained at Carnegie Mellon University.
  •  
  • The Boston house-price data of Harrison, D. and Rubinfeld, D.L. 'Hedonic
  • prices and the demand for clean air', J. Environ. Economics & Management,
  • vol.5, 81-102, 1978. Used in Belsley, Kuh & Welsch, 'Regression diagnostics
  • ...', Wiley, 1980. N.B. Various transformations are used in the table on
  • pages 244-261 of the latter.
  •  
  • The Boston house-price data has been used in many machine learning papers that address regression
  • problems.
  •  
  • .. topic:: References
  •  
  • - Belsley, Kuh & Welsch, 'Regression diagnostics: Identifying Influential Data and Sources of Collinearity', Wiley, 1980. 244-261.
  • - Quinlan,R. (1993). Combining Instance-Based and Model-Based Learning. In Proceedings on the Tenth International Conference of Machine Learning, 236-243, University of Massachusetts, Amherst. Morgan Kaufmann.
  • 1.7 转换器

    在之前我们做的特征工程有几个步骤?

    1、实例化 (实例化的是一个转换器类(Transformer)) 。 2、调用fit_transform()对于文档建立分类词频矩阵,不能同时调用)。

    fit_transform():输入数据直接转换。

    其实fit_transform()方法就是fit()方法和transform()方法的结合。

    fit():输入数据,但不做事情。

    transform():进行数据的转换。

    
    
    1. from sklearn.preprocessing import StandardScaler
    2.  
    3. s = StandardScaler()
    4. print(s.fit_transform([[1,2,3],[4,5,6]]))
    5.  
    6. ss = StandardScaler()
    7. print(ss.fit([[1,2,3],[4,5,6]]))
    8. print(ss.transform([[1,2,3],[4,5,6]]))
    9. print(ss.fit([[2,3,4],[4,5,7]]))
    10. print(ss.transform([[1,2,3],[4,5,6]]))

    运行结果:

    1.8 估计器

    在sklearn中,估计器(estimator)是一个重要的角色,分类器和回归器都属于estimator,是一类实现了算法的API

    1、用于分类的估计器: sklearn.neighbors k-近邻算法 sklearn.naive_bayes 贝叶斯 sklearn.linear_model.LogisticRegression 逻辑回归

    2、用于回归的估计器: sklearn.linear_model.LinearRegression 线性回归 sklearn.linear_model.Ridge 岭回归

    估计器工作流程:

    相关教程
            
    关于我们--广告服务--免责声明--本站帮助-友情链接--版权声明--联系我们       黑ICP备07002182号