-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Standard scaler link #309
Standard scaler link #309
Conversation
def _compute_mean_std_all(self, input_dim): | ||
if self.indices is None: | ||
std_all = self.xp.ones(input_dim, dtype=self.xp.float32) | ||
std_all[self.std != 0] = self.std[self.std != 0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is kind to raise warning when std == 0
. Because it is very strange situation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated: show warning at fit.
if x.ndim == 1: | ||
# Deal with as 1 feature with several samples. | ||
x = x[:, None] | ||
if x.ndim != 2: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
elif
?
x = x[:, None] | ||
if x.ndim != 2: | ||
raise ValueError( | ||
"Unexpected value x.shape={}, only x.ndim=2 is supported." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
x.ndim 1 or 2?
Codecov Report
@@ Coverage Diff @@
## master #309 +/- ##
==========================================
- Coverage 89.6% 83.78% -5.82%
==========================================
Files 179 182 +3
Lines 8112 8272 +160
==========================================
- Hits 7269 6931 -338
- Misses 843 1341 +498 |
StandardScaler with chainer.Link
there are several benefits:
indices
, if specified.