Skip to content
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

Generic types/methods for normalizing input data #13

Closed
tbreloff opened this issue May 1, 2015 · 11 comments
Closed

Generic types/methods for normalizing input data #13

tbreloff opened this issue May 1, 2015 · 11 comments
Assignees

Comments

@tbreloff
Copy link
Collaborator

tbreloff commented May 1, 2015

No description provided.

@tbreloff tbreloff self-assigned this May 1, 2015
@tbreloff
Copy link
Collaborator Author

tbreloff commented May 4, 2015

I'm creating a Normalized class with functions

normalize(o::Normalized, x::Float64) = ...  # normalizes and returns float
normalize!(o::Normalized, x::Float64) = ... # calls update! on underlying Var and normalizes
denormalize(...) = ...
...

Is there standard notation/lettering for signifying raw vs normalized variables? what should statenames return?

@joshday
Copy link
Owner

joshday commented May 4, 2015

Sorry for answering almost none of your questions and added a few more questions. Typically notation is X and Z (z-score), but should state/statenames just return mean and standard deviation?

Side note: Should we change Var to MeanVar to be more clear on what it estimates?

Could we do something along these lines? Does Normalized store any fields other than Var objects?

normalize(o::Var, x::Float64) = (x - mean(o)) / std(o))
normalize!(o::Var, x::Float64) = (update!(o, x); normalize(o, x))

@joshday
Copy link
Owner

joshday commented May 4, 2015

I also made a Vars type last night, which may be easier to use than a vector of Var types.

@joshday
Copy link
Owner

joshday commented May 4, 2015

How about something like

type Normalized{W <: Weighting}
    xdata::Vars{W}
    ydata::Var{W}
end

normalize() could return a tuple of standardized x and standardized y

xnew, ynew = normalize!(o.Normalized, x::VecF, y::Float64)

@tbreloff
Copy link
Collaborator Author

tbreloff commented May 4, 2015

  • Could we just add normalize/denormalize to Var? Yes I think so. I'll trash my normalize.jl file.
  • I don't think we need to change Var to MeanVar because it also tracks the mean... however I do think that it might improve readability to call it Variance??
  • Side question... does it make sense to return stddev instead of variance in the state? Or both? Which do you find is more useful?

@tbreloff
Copy link
Collaborator Author

tbreloff commented May 4, 2015

I don't think we need that normalized class at all... Var is plenty as you suggested

@joshday
Copy link
Owner

joshday commented May 4, 2015

  • I do like Variance a bit better
  • stddev is more useful, but is it strange if the Variance type returns mean and standard deviation?

@tbreloff
Copy link
Collaborator Author

tbreloff commented May 4, 2015

Yes... that is a bit strange I suppose. I'll leave it up to you, since I can always map(sqrt, ...)

@joshday
Copy link
Owner

joshday commented May 4, 2015

Also, if you use the Vars type, it has a std() method which returns a vector of stddevs.

@tbreloff
Copy link
Collaborator Author

tbreloff commented May 4, 2015

Did you add Vars to the repo? I see means.jl, but no vars.jl

@joshday
Copy link
Owner

joshday commented May 4, 2015

Sorry, just pushed it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants