作家
登录

TensorFlow广度和深度学习的教程

作者: 来源: 2017-12-04 09:41:22 阅读 我要评论

  •  "Never-married""Separated""Married-AF-spouse""Widowed" 
  •  ]) 
  • relationship = tf.feature_column.categorical_column_with_vocabulary_list( 
  •  "relationship", [ 
  •  "Husband""Not-in-family""Wife""Own-child""Unmarried"
  •  "Other-relative" 
  •  ]) 
  • workclass = tf.feature_column.categorical_column_with_vocabulary_list( 
  •  "workclass", [ 
  •  "Self-emp-not-inc""Private""State-gov""Federal-gov"
  •  "Local-gov""?""Self-emp-inc""Without-pay""Never-worked" 
  •  ]) 
  •  
  • # 展示一个哈希的例子: 
  • occupation = tf.feature_column.categorical_column_with_hash_bucket( 
  •  "occupation", hash_bucket_size=1000) 
  • native_country = tf.feature_column.categorical_column_with_hash_bucket( 
  •  "native_country", hash_bucket_size=1000) 
  •  
  • # 持续基列 
  • age = tf.feature_column.numeric_column("age"
  • education_num = tf.feature_column.numeric_column("education_num"
  • capital_gain = tf.feature_column.numeric_column("capital_gain"
  • capital_loss = tf.feature_column.numeric_column("capital_loss"
  • hours_per_week = tf.feature_column.numeric_column("hours_per_week"
  •  
  • # 转换 
  • age_buckets = tf.feature_column.bucketized_column( 
  •  age, boundaries=[18, 25, 30, 35, 40, 45, 50, 55, 60, 65]) 
  • 广度模型:具有交叉特点列的线性模型

    广度模型是一个具有稀少和交叉特点列的线性模型:

    1. base_columns = [ 
    2.  gender, native_country, education, occupation, workclass, relationship, 
    3.  age_buckets, 
    4.  
    5. crossed_columns = [ 
    6.  tf.feature_column.crossed_column( 
    7.  ["education""occupation"], hash_bucket_size=1000), 
    8.  tf.feature_column.crossed_column( 
    9.  [age_buckets, "education""occupation"

        推荐阅读

        张一鸣:探讨人工智能边界就是探讨人类文明边界

      CTO练习营 | 12月3-5日,深圳,是时刻成为优良的技巧治理者了 今日头条开创人兼CEO张一鸣我们要实现本身的愿景,必须在全球范围内去解决三个问题:第一个是应用处景的问题,这本质上是一个>>>详细阅读


      本文标题:TensorFlow广度和深度学习的教程

      地址:http://www.17bianji.com/lsqh/39382.html

    关键词: 探索发现

    乐购科技部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与乐购科技进行文章共享合作。

    网友点评
    自媒体专栏

    评论

    热度

    精彩导读
    栏目ID=71的表不存在(操作类型=0)