Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or
transmitted in any form or by any means, without the prior written permission of the publisher,
except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the
information presented. However, the information contained in this book is sold without
warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers
and distributors will be held liable for any damages caused or alleged to be caused directly or
indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies
and products mentioned in this book by the appropriate use of capitals. However, Packt
Publishing cannot guarantee the accuracy of this information.
First published: October 2012
Second edition: April 2015
Production reference: 1270415
Published by Packt Publishing Ltd.
35 Livery Street
Birmingham B3 2PB, UK.
Lev E. Givon
Nadeem N. Bagban
Content Development Editor
Utkarsha S. Kadam
Monica Ajmera Mehta
Shantanu N. Zagade
Shantanu N. Zagade
About the Author
Ivan Idris has an MSc in experimental physics. His graduation thesis had a strong emphasis
on applied computer science. After graduating, he worked for several companies as a Java
developer, data warehouse developer, and QA analyst. His main professional interests are
business intelligence, big data, and cloud computing. Ivan enjoys writing clean, testable
code and interesting technical articles. He is the author of NumPy Beginner's Guide, NumPy
Cookbook, Python Data Analysis, and Learning NumPy, all by Packt Publishing. You can nd
more information about him and a few NumPy examples at http://ivanidris.net/
I would like to take this opportunity to thank the reviewers and the team at
Packt Publishing for making this book possible. Also, thanks to my teachers,
professors, and colleagues who taught me about science and programming.
Last but not least, I would like to acknowledge my parents, family, and
friends for their support.
About the Reviewers
Lev E. Givon is a doctoral candidate and neurocomputing researcher at the department of
electrical engineering in Columbia University, New York. His research focuses on developing
computational tools and techniques to study information processing and representation
by neural circuits in the brain of the fruit y. He is one of the developers of Neurokernel
(http://neurokernel.github.io), an open software framework written in Python
for the emulation of the fruit y brain on multiple graphics processing units.
Mark Livingstone started his career by working for many years in three international
computer companies (which no longer exist) in engineering, support, programming, and
training roles. He got tired of being made redundant. He then graduated from Grifth
University, Gold Coast, Australia, in 2011 with a bachelor's in information technology.
In 2013, Mark received a B.InfoTech (Hons) degree. He is currently a PhD candidate,
with his conrmation rapidly approaching. All of his research software is written in
Python on a Mac system.
Mark enjoys mentoring students with special needs. He was the chairman of IEEE in
Grifth University's Gold Coast Student Branch. He volunteers as a qualied justice of
peace at the local district courthouse. He is also a credit union director, and has completed
105 blood donations.
Lijun Xue is a developer of Theano, which is a Python library that allows you to dene,
optimize, and evaluate mathematical expressions involving multi-dimensional arrays
efciently. He was a research assistant at Carnegie Mellon University doing research projects
related to machine learning and data mining. He is a Pythonista and has passion towards
machine learning and data mining. He is currently working on some deep learning research
projects, which aims to solve image classication problems in university. You can know
more about him at http://royxue.me/.
def dist_for_float(p1, p2): p1 = DTW.numpy_num_to_python_num(p1) p2 = DTW.numpy_num_to_python_num(p2) if (type(p1) == float or type(p1) == int) and \ (type(p2) == float or type(p2) == int): dist = float(abs(p1 - p2)) return dist else: sum_val = 0.0 for i in range(len(p1)): sum_val += pow(p1[i] - p2[i], 2) dist = pow(sum_val, 0.5) return dist怎样实现将这段函数里的欧氏距离改成马氏距离
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额