Code Monkey home page Code Monkey logo

flower_house_price's Introduction

flower_house_price

本案例使用Flower框架进行联邦学习预测房价,准确度71%,loss为0.68,代码改写自Flower官方案例sklearn-logreg-mnist

改写重点

主要改写重点是把原来在utils.py中的load_mnist函数改写成load_data

特征选取

num_cols = [
  "number of rooms", 
  "security level of the community",
  "residence space",
  # "building space",
  "noise level",
  "waterfront",
  "view",
  "air quality level",
  "aboveground space ",
  # "basement space",
  "building year",
  # "decoration year",
  # "lat",
  # "lng",
  # "total cost"
]
    
cat_cols = [
  "city",
  "zip code",
]

选取了两种类型的特征,数字值类型和分类类型(非数字类型),分类类型用one-hot编码转换,最后使用StandardScaler进行规范化。经过测试building spacebasement space等特征对准确度没用贡献,甚至会拉低准确度,所以去除,经纬度特征(通过Google地图API获取)也对训练没有太大帮助。

验证特征对训练的帮助,可以使用single.py文件,这个就是使用传统方式进行训练,能够更快的检验特征的有效性。

分析

生成的日志文件my.log可以看到训练细节,analysis.ipynb通过读取该日志文件来分析准确率和loss的变化

flower_house_price's People

Watchers

Sophia Woods avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.