nums.models.glms module

class nums.models.glms.ElasticNet(alpha=1.0, l1_ratio=0.5, tol=0.0001, max_iter=100, solver='newton', lr=0.01, random_state=None, fit_intercept=True, normalize=False)[source]

Bases: nums.models.glms.LinearRegressionBase

class nums.models.glms.ExponentialRegression(penalty='none', alpha=1.0, l1_ratio=0.5, tol=0.0001, max_iter=100, solver='newton', lr=0.01, random_state=None, fit_intercept=True, normalize=False)[source]

Bases: nums.models.glms.GLM

gradient(X, y, mu=None, beta=None)[source]
hessian(X, y, mu=None)[source]
objective(X, y, beta=None, mu=None)[source]
class nums.models.glms.GLM(penalty='none', alpha=1.0, l1_ratio=0.5, tol=0.0001, max_iter=100, solver='newton', lr=0.01, random_state=None, fit_intercept=True, normalize=False)[source]

Bases: object

deviance(y, y_pred)[source]
deviance_sqr(X, y)[source]
fit(X, y)[source]
forward(X, beta=None)[source]
grad_norm_sq(X, y, beta=None)[source]
grad_penalty(beta)[source]
gradient(X, y, mu=None, beta=None)[source]
hessian(X, y, mu=None)[source]
hessian_penalty()[source]
obj_penalty(beta)[source]
objective(X, y, beta=None, mu=None)[source]
predict(X)[source]
class nums.models.glms.Lasso(alpha=1.0, tol=0.0001, max_iter=100, solver='newton', lr=0.01, random_state=None, fit_intercept=True, normalize=False)[source]

Bases: nums.models.glms.LinearRegressionBase

class nums.models.glms.LinearRegression(tol=0.0001, max_iter=100, solver='newton', lr=0.01, random_state=None, fit_intercept=True, normalize=False)[source]

Bases: nums.models.glms.LinearRegressionBase

class nums.models.glms.LinearRegressionBase(penalty='none', alpha=1.0, l1_ratio=0.5, tol=0.0001, max_iter=100, solver='newton', lr=0.01, random_state=None, fit_intercept=True, normalize=False)[source]

Bases: nums.models.glms.GLM

deviance(y, y_pred)[source]
gradient(X, y, mu=None, beta=None)[source]
hessian(X, y, mu=None)[source]
objective(X, y, beta=None, mu=None)[source]
predict(X)[source]
Return type

BlockArray

class nums.models.glms.LogisticRegression(penalty='none', C=1.0, tol=0.0001, max_iter=100, solver='newton', lr=0.01, random_state=None, fit_intercept=True, normalize=False)[source]

Bases: nums.models.glms.GLM

deviance(y, y_pred)[source]
gradient(X, y, mu=None, beta=None)[source]
hessian(X, y, mu=None)[source]
objective(X, y, beta=None, mu=None)[source]
predict(X)[source]
Return type

BlockArray

predict_proba(X)[source]
Return type

BlockArray

class nums.models.glms.PoissonRegression(penalty='none', alpha=1.0, l1_ratio=0.5, tol=0.0001, max_iter=100, solver='newton', lr=0.01, random_state=None, fit_intercept=True, normalize=False)[source]

Bases: nums.models.glms.GLM

deviance(y, y_pred)[source]
Return type

BlockArray

gradient(X, y, mu=None, beta=None)[source]
hessian(X, y, mu=None)[source]
objective(X, y, beta=None, mu=None)[source]
predict(X)[source]
Return type

BlockArray

nums.models.glms.PoissonRegressor

alias of nums.models.glms.PoissonRegression

class nums.models.glms.Ridge(alpha=1.0, tol=0.0001, max_iter=100, solver='newton', lr=0.01, random_state=None, fit_intercept=True, normalize=False)[source]

Bases: nums.models.glms.LinearRegressionBase

nums.models.glms.admm()[source]
nums.models.glms.block_sgd(model, beta, X, y, tol, max_iter, lr)[source]
nums.models.glms.gd(model, beta, X, y, tol, max_iter, lr)[source]
nums.models.glms.irls(app, model, beta, X, y, tol, max_iter)[source]
nums.models.glms.lbfgs(app, model, beta, X, y, tol, max_iter)[source]
nums.models.glms.newton(app, model, beta, X, y, tol, max_iter)[source]
nums.models.glms.sgd(model, beta, X, y, tol, max_iter, lr)[source]