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

Simplify Imputor API #69

Merged
merged 19 commits into from
Oct 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
cdef813
Remove `context` to simplify imputation code.
rofinn Sep 29, 2020
f1c863f
Replace context limits with a threshold assertion type.
rofinn Sep 29, 2020
640e2cb
Introduce function interface for threshold.
rofinn Sep 29, 2020
1500ece
Initial work on improving support for `dims` and other cleanup.
rofinn Sep 30, 2020
4772961
Finished reworking dims changes.
rofinn Oct 1, 2020
6e6497e
Simplify dims code a bit more by explicitly using NamedDims.jl
rofinn Oct 1, 2020
43fc0fc
Chain is no longer an imputor.
rofinn Oct 1, 2020
c992d51
Added a Standardize imputor which handles replace user defined 'missi…
rofinn Oct 2, 2020
bc15b8f
Replaced Impute.Fill with Impute.Replace for constants and Impute.Sub…
rofinn Oct 3, 2020
10f3737
Update doctests and run documenter doctests in runtests.jl.
rofinn Oct 6, 2020
8ed73e4
Finish moving various imputor testsets into independent files.
rofinn Oct 6, 2020
850d119
Added more NamedDims and AxisKeys tests.
rofinn Oct 6, 2020
0bba5aa
Lots of documentation updates and minor bug fixes/improvements.
rofinn Oct 8, 2020
af45737
Run CI on julia 1.5 and move deprecated matrix block into jobs so doc…
rofinn Oct 8, 2020
8213ce3
Removed redundant/unreachable code and added more tests.
rofinn Oct 9, 2020
27dfb99
Minor changes from review comments.
rofinn Oct 11, 2020
701d85b
Use a ThresholdError for clearer error messages.
rofinn Oct 11, 2020
bb98aa9
Fix outdated imputor docstring.
rofinn Oct 11, 2020
6c3b6d8
Test Threshold showerror method.
rofinn Oct 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,28 @@ language: julia
os:
- linux
- osx
env:
- DATADEPS_ALWAYS_ACCEPT=true
julia:
# 1.0 should also work, but Pkg.test hit some chmod issues on 1.0 in docker containers
- 1.3
- 1.5
- nightly
notifications:
email: false
matrix:
fast_finish: true
allow_failures:
- julia: nightly
# uncomment the following lines to override the default test script
#script:
# - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
# - julia -e 'Pkg.clone(pwd()); Pkg.build("Impute"); Pkg.test("Impute"; coverage=true)'
after_success:
- julia -e 'using Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit(process_folder())'
jobs:
fast_finish: true
allow_failures:
- julia: nightly
include:
- stage: "Documentation"
julia: 1.0
julia: 1.5
os: linux
script:
- julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
Expand Down
14 changes: 11 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ authors = ["Invenia Technical Computing"]
version = "0.6.0"

[deps]
BSON = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0"
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
DataDeps = "124859b0-ceae-595e-8997-d05f6a7a8dfe"
Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"
IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Missings = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28"
NamedDims = "356022a1-0364-5f58-8944-0da4b18d706f"
NearestNeighbors = "b8a86587-4115-5ab1-83bc-aa920d37bbce"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Expand All @@ -16,10 +20,14 @@ TableOperations = "ab02a1b2-a7df-11e8-156e-fb1833f50b87"
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"

[compat]
AxisKeys = "0.1.5"
AxisKeys = "0.1"
BSON = "0.2"
CSV = "0.6, 0.7"
DataDeps = "0.7"
Distances = "0.8, 0.9"
IterTools = "1.2, 1.3"
Missings = "0.4"
NamedDims = "0.2"
NearestNeighbors = "0.4"
StatsBase = "0.32"
TableOperations = "0.2"
Expand All @@ -33,8 +41,8 @@ Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"
RDatasets = "ce6b1742-4840-55fa-b093-852dadbb1d8b"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["AxisArrays", "AxisKeys", "Combinatorics", "DataFrames", "Dates", "Distances", "RDatasets", "Test"]
test = ["AxisArrays", "AxisKeys", "Combinatorics", "DataFrames", "Dates", "Distances", "Documenter", "Test"]
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ julia> using Pkg; Pkg.add("Impute")
## Quickstart
Let's start by loading our dependencies:
```julia
julia> using DataFrames, RDatasets, Impute
julia> using DataFrames, Impute
```

We'll also want some test data containing missings to work with:

```julia
julia> df = dataset("boot", "neuro")
julia> df = Impute.dataset("test/table/neuro") |> DataFrame
469×6 DataFrames.DataFrame
│ Row │ V1 │ V2 │ V3 │ V4 │ V5 │ V6 │
│ │ Float64⍰ │ Float64⍰ │ Float64 │ Float64⍰ │ Float64⍰ │ Float64⍰ │
Expand All @@ -47,7 +47,7 @@ julia> df = dataset("boot", "neuro")
Our first instinct might be to drop all observations, but this leaves us too few rows to work with:

```julia
julia> Impute.drop(df)
julia> Impute.filter(df; dims=:rows)
4×6 DataFrames.DataFrame
│ Row │ V1 │ V2 │ V3 │ V4 │ V5 │ V6 │
│ │ Float64 │ Float64 │ Float64 │ Float64 │ Float64 │ Float64 │
Expand Down
Loading