Sparse Modeling in Python

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →

Sparse Modeling in Python

Presentation slides at PyCon PH 2018 Lightning Talks

Hacarus Inc.

February 25, 2018

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

19 slides
  1. 1PMZOPNJBM3FHSFTTJPO from sklearn.linear_model import LinearRegression, Lasso, OrthogonalMatchingPursuit from sklearn.preprocessing import

    PolynomialFeatures from sklearn.pipeline import make_pipeline poly_preprocess = PolynomialFeatures(poly_dim, include_bias=False) # models linear = LinearRegression() lasso = Lasso(alpha=0.002, max_iter=500000, tol=0.000001) omp = OrthogonalMatchingPursuit(n_nonzero_coefs=5) def fit_and_predict(predictor): model = make_pipeline(poly_preprocess, predictor) model.fit(x.reshape(-1, 1), y) y_predicted = model.predict(x.reshape(-1, 1)) t_predicted = model.predict(t.reshape(-1, 1)) return y_predicted, t_predicted
  2. 1PMZOPNJBM3FHSFTTJPO • 4UBSUXJUIMFBTUTRVBSFNFUIPE min 1 2 & − () *

    Z  PVUQVU X XFJHIU Y JOQVU $PNQVUF X UPTBUJTGZBCPWF
  3. 1PMZOPNJBM3FHSFTTJPO • "EESFHVMBUJPOUFSNUPBWPJEPWFSGJUUJOH min 1 2 & − () *

    + , ( - 4VSQSFTT PWFSGJUUJOH CZ BEEJOH DPOTUSBJOU UP XFJHIUX -/PSN -BTTPɾ-/PSN3JEHF
  4. 1PMZOPNJBM3FHSFTTJPO • "QQSPBDIUP-/PSN0QUJNJ[BUJPO min 1 2 & − () *

    + , ( - 5IJT JTFTTFOUJBMMZDPNCJOBUJPOBMPQUJNJ[BUJPOQSPCMFN /1IBSE (SFFEZBMHPSJUINUPTPMWFJUMPDBMMZMJLF.BUDIJOH1VSTVJU *)5

More Decks by Hacarus Inc.

Other Decks in Technology