Lock in $30 Savings on PRO—Offer Ends Soon! ⏳

Sparse Modeling in Python

Hacarus Inc.
February 25, 2018

Sparse Modeling in Python

Presentation slides at PyCon PH 2018 Lightning Talks

Hacarus Inc.

February 25, 2018
Tweet

More Decks by Hacarus Inc.

Other Decks in Technology

Transcript

  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