8000 New StandardisationFilter by pass-always · Pull Request #245 · Waikato/moa · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

New StandardisationFilter #245

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

Merged
merged 2 commits into from
Apr 25, 2022

Conversation

pass-always
Copy link
Contributor

This filter is to standardise instances in a stream.
Fixed the previous algorithm to correct, add two more Welford's online and Two-pass.
Z-SCORE is used to standardise the values of a normal distribution.
For more information: https://en.wikipedia.org/wiki/Standard_score. The formula is:
z=(z-μ)/σ
μ is the mean of the population.
σ is the standard deviation of the population, as the square root of variance.
There are three algorithms for calculating variance.
For more information: https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Computing_shifted_data
Naive algorithm
Welford's online algorithm
Two-pass algorithm
You can check the standard deviation results to compare the accuracy in the Outputs.xlsx. In the Output4 sheet, there are multiple colums caculated by different algorithms.
Outputs.xlsx

…us algorithm to correct, add two more Welford's online and Two-pass.
Copy link
Member
@hmgomes hmgomes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Ethan,
As per our conversation, please just make that small fix and this should be alright


if (delta2[i] / count != 0)
//Standardisation
standardisedInstance.setValue(i, (inst.value(i) - mean[i]) / Math.sqrt(delta2[i] / count));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(count-1)


if (M2[i] / count != 0)
//Standardisation
standardisedInstance.setValue(i, (inst.value(i) - mean[i]) / (Math.sqrt(M2[i] / count)));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(count-1)

@abifet abifet merged commit 5f39077 into Waikato:master Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0