Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)

src/m/o/mozsci-HEAD/test/test_linear_regression.py   mozsci(Download)
        lr = LinearRegression(lam=0.001)
        lr.fit(X, y)
        ypred = lr.predict(X)
        self.assertTrue(pearsonr_weighted(y, ypred) > 0.99)
 
        # try weighted
        weights = np.random.rand(1000)
        lr = LinearRegression(lam=0.001)
        lr.fit(X, y, weights=weights)
        ypred = lr.predict(X)