1/(1+e^(-z))
-y*log(htheta(x))-(1-y)*log(1-htheta(x))
alpha
lambda*sigma(thetaj^2)
, theta from 1 to nNew gradient descent with regularized term: thetaj=thetaj(1-alphalambda/m)
A module is a file containing Python definitions and statements.
The file name is the module name with the suffix .py
appended.
The __init__.py
files are required to make Python treat directories containing the file as packages.
Naming
Modules should have short, all-lowercase names. Underscores can be used in the module name if it improves readability. When an extension module written in C or C++ has an accompanying Python module that provides a higher level (e.g. more object oriented) interface, the C/C++ module has a leading underscore (e.g. _socket).
A package is a collection of modules.
Packages are a way of structuring Python’s module namespace by using “dotted module names”.
For example, the module name A.B
designates a submodule named B
in a package named A
.
Naming
Python packages should also have short, all-lowercase names, although the use of underscores is discouraged.
Naming
Class names should normally use the CapWords convention.
Naming
Carefully follow the matrix size after each vectorized operation, of particular caution is that matlab would perform add/subtract between 1-by-n and n-by-1 matrix by broadcasting the matrix to fit n-by-n size.