def test_basic(self): a = dpp.StandardScaler() b = spp.StandardScaler() a.fit(X) b.fit(X.compute()) assert_estimator_equal(a, b)
def test_basic(self): a = dpp.StandardScaler() b = spp.StandardScaler() a.fit(X) b.fit(X.compute()) assert_estimator_equal(a, b, exclude="n_samples_seen_")
def test_nan(self, pandas_df): pandas_df = pandas_df.copy() pandas_df.iloc[0] = np.nan dask_nan_df = dd.from_pandas(pandas_df, npartitions=5) a = dpp.StandardScaler() a.fit(dask_nan_df.values) assert np.isnan(a.mean_).sum() == 0 assert np.isnan(a.var_).sum() == 0
def test_input_types(self, dask_df, pandas_df): a = dpp.StandardScaler() b = spp.StandardScaler() assert_estimator_equal(a.fit(dask_df.values), a.fit(dask_df), exclude="n_samples_seen_") assert_estimator_equal(a.fit(dask_df), b.fit(pandas_df), exclude="n_samples_seen_") assert_estimator_equal(a.fit(dask_df.values), b.fit(pandas_df), exclude="n_samples_seen_") assert_estimator_equal(a.fit(dask_df), b.fit(pandas_df.values), exclude="n_samples_seen_") assert_estimator_equal(a.fit(dask_df.values), b.fit(pandas_df.values), exclude="n_samples_seen_")
def test_inverse_transform(self): a = dpp.StandardScaler() assert_eq_ar( a.inverse_transform(a.fit_transform(X)).compute(), X.compute())
def test_inverse_transform(self): a = dpp.StandardScaler() result = a.inverse_transform(a.fit_transform(X)) assert dask.is_dask_collection(result) assert_eq_ar(result, X)