validate_poi.py 800 B

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/python
  2. """
  3. Starter code for the validation mini-project.
  4. The first step toward building your POI identifier!
  5. Start by loading/formatting the data
  6. After that, it's not our code anymore--it's yours!
  7. """
  8. import pickle
  9. import sys
  10. sys.path.append("../tools/")
  11. from feature_format import featureFormat, targetFeatureSplit
  12. data_dict = pickle.load(open("../final_project/final_project_dataset.pkl", "r") )
  13. ### first element is our labels, any added elements are predictor
  14. ### features. Keep this the same for the mini-project, but you'll
  15. ### have a different feature list when you do the final project.
  16. features_list = ["poi", "salary"]
  17. data = featureFormat(data_dict, features_list)
  18. labels, features = targetFeatureSplit(data)
  19. ### it's all yours from here forward!