-
Notifications
You must be signed in to change notification settings - Fork 196
Add hsm_mode: Half-Sample Mode for continuous data #984
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
Open
anurag-mds
wants to merge
12
commits into
JuliaStats:master
Choose a base branch
from
anurag-mds:hsm-mode
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
80c6d10
Implement robust Half-Sample Mode (HSM) estimator for continuous data…
3de6546
Fixed some discrepancies by fixing typos and removing temporary files…
727c530
Add hsm_mode to documentation
4c30325
Fix hsm_mode to use ceil(n/2) for correct half-sample algorithm
e086cc3
Merge branch 'master' into hsm-mode
anurag-mds 393acd5
Update src/scalarstats.jl
anurag-mds 98e39db
Implement half-sample mode (HSM) with method=:halfsample for mode; ad…
anurag-mds 9e8cf98
Merge branch 'master' into hsm-mode
anurag-mds 5d9a333
Fix documentation issues and remove obsolete file
anurag-mds 068e968
Update test/scalarstats.jl
anurag-mds 502c458
Update src/scalarstats.jl
anurag-mds 72d867c
Implement half-sample mode (HSM) for mode(), address all reviewer fee…
anurag-mds File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,6 +79,7 @@ percentilerank | |
| ```@docs | ||
| mode | ||
| modes | ||
| hsm_mode | ||
| ``` | ||
|
|
||
| ## Summary Statistics | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| using BenchmarkTools | ||
| using StatsBase | ||
| using Random | ||
|
|
||
| println("=" ^ 60) | ||
| println("Half-Sample Mode (hsm_mode) Benchmarks") | ||
| println("=" ^ 60) | ||
|
|
||
| # Small dataset | ||
| println("\n1. Small dataset (n=100)") | ||
| Random.seed!(123) | ||
| small = randn(100) | ||
| @btime hsm_mode($small) | ||
|
|
||
| # Medium dataset | ||
| println("\n2. Medium dataset (n=1,000)") | ||
| Random.seed!(123) | ||
| medium = randn(1_000) | ||
| @btime hsm_mode($medium) | ||
|
|
||
| # Large dataset | ||
| println("\n3. Large dataset (n=10,000)") | ||
| Random.seed!(123) | ||
| large = randn(10_000) | ||
| @btime hsm_mode($large) | ||
|
|
||
| # Very large dataset | ||
| println("\n4. Very large dataset (n=100,000)") | ||
| Random.seed!(123) | ||
| very_large = randn(100_000) | ||
| @btime hsm_mode($very_large) | ||
|
|
||
| # With outliers | ||
| println("\n5. Dataset with outliers (n=1,000)") | ||
| Random.seed!(123) | ||
| with_outliers = vcat(randn(990), fill(1000.0, 10)) | ||
| @btime hsm_mode($with_outliers) | ||
|
|
||
| # Skewed distribution | ||
| println("\n6. Skewed distribution (n=1,000)") | ||
| Random.seed!(123) | ||
| skewed = abs.(randn(1_000)) .^ 2 | ||
| @btime hsm_mode($skewed) | ||
|
|
||
| println("\n" * "=" ^ 60) | ||
| println("Benchmark complete!") | ||
| println("=" ^ 60) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.