Skip to content

Commit 0b3ad1d

Browse files
authored
Merge pull request #40 from alan-turing-institute/dev
for a 0.1.5 release
2 parents 73bab52 + 57e1aef commit 0b3ad1d

File tree

6 files changed

+18
-32
lines changed

6 files changed

+18
-32
lines changed

.github/workflows/CompatHelper.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
name: CompatHelper
2+
23
on:
34
schedule:
45
- cron: '00 00 * * *'
5-
workflow_dispatch:
6+
67
jobs:
78
CompatHelper:
89
runs-on: ubuntu-latest
910
steps:
11+
- uses: julia-actions/setup-julia@latest
12+
with:
13+
version: 1.3
1014
- name: Pkg.add("CompatHelper")
1115
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
12-
- name: CompatHelper.main()
16+
- name: CompatHelper.main
1317
env:
1418
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15-
COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }} # optional
16-
run: julia -e 'using CompatHelper; CompatHelper.main()'
19+
run: julia -e 'using CompatHelper; CompatHelper.main(; master_branch = "dev")'

.github/workflows/CompatHelper.yml~

Lines changed: 0 additions & 19 deletions
This file was deleted.

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "NearestNeighborModels"
22
uuid = "636a865e-7cf4-491e-846c-de09b730eb36"
33
authors = ["Anthony D. Blaom <anthony.blaom@gmail.com>", "Sebastian Vollmer <s.vollmer.4@warwick.ac.uk>", "Thibaut Lienart <thibaut.lienart@gmail.com>", "Okon Samuel <okonsamuel50@gmail.com>"]
4-
version = "0.1.4"
4+
version = "0.1.5"
55

66
[deps]
77
Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"
@@ -17,7 +17,7 @@ Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
1717
[compat]
1818
Distances = "^0.9, ^0.10"
1919
FillArrays = "^0.9, ^0.10, ^0.11 "
20-
MLJModelInterface = "^0.3.5, ^0.4"
20+
MLJModelInterface = "^0.3.5, ^0.4, 1.0"
2121
NearestNeighbors = "^0.4"
2222
StatsBase = "^0.33"
2323
Tables = "^1.2"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# NearestNeighborModels
22
| [Linux] | Coverage | Documentation |
33
| :------------ | :------- | :------------ |
4-
| [![Build Status](https://github.com/alan-turing-institute/NearestNeighborModels.jl/workflows/CI/badge.svg)](https://github.com/alan-turing-institute/NearestNeighborModels.jl/actions) | [![Coverage](https://codecov.io/gh/alan-turing-institute/NearestNeighborModels.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/vollmersj/NearestNeighborModels.jl) | [![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://alan-turing-institute.github.io/NearestNeighborModels.jl/dev/) |
4+
| [![Build Status](https://github.com/alan-turing-institute/NearestNeighborModels.jl/workflows/CI/badge.svg)](https://github.com/alan-turing-institute/NearestNeighborModels.jl/actions) | [![Coverage](https://codecov.io/gh/alan-turing-institute/NearestNeighborModels.jl/branch/master/graph/badge.svg)](https://codecov.io/github/alan-turing-institute/NearestNeighborModels.jl?branch=master) | [![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://alan-turing-institute.github.io/NearestNeighborModels.jl/dev/) |
55

66

77
Package providing K-nearest neighbor regressors and classifiers, for use with the [MLJ](https://alan-turing-institute.github.io/MLJ.jl/dev/) machine learning framework.
@@ -11,7 +11,7 @@ Builds on Kristoffer Carlsson's [NearestNeighbors](https://github.com/Kristoffer
1111
Builds on contributions of Thibaut Lienart originally residing in [MLJModels.jl](https://github.com/alan-turing-institute/MLJModels.jl/blob/98618d7be53f72054de284fa1796c5292d9071bb/src/NearestNeighbors.jl#L1).
1212

1313
Provides the following models: `KNNRegressor`, `KNNClassifier`,
14-
`MultitargetKNNRegressor` and `MultitargetClassifier`.
14+
`MultitargetKNNRegressor` and `MultitargetKNNClassifier`.
1515

1616
Provides a library of kernels for weighting nearest neighbors, including
1717
all kernels surveyed in the paper [Geler et.al (2016):

docs/src/index.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ end
5151
```
5252
```jldoctest ex1
5353
julia> predict(knnc_mach, rows=test_inds)
54-
60-element MLJBase.UnivariateFiniteArray{Multiclass{2},String,UInt32,Float64,1}:
54+
60-element MLJBase.UnivariateFiniteVector{Multiclass{2}, String, UInt32, Float64}:
5555
UnivariateFinite{ScientificTypes.Multiclass{2}}(B=>0.315, O=>0.685)
5656
UnivariateFinite{ScientificTypes.Multiclass{2}}(B=>1.0, O=>0.0)
5757
UnivariateFinite{ScientificTypes.Multiclass{2}}(B=>1.0, O=>0.0)
@@ -163,10 +163,12 @@ end
163163
```
164164
```jldoctest
165165
julia> table_predictions = predict(multi_knnr_mach, rows=test_inds)
166-
Tables.MatrixTable{Array{Float64,2}}: (x1 = [0.08676552079000954, 0.38872230178556694, -0.05722812562903978, -0.08454222308611803, 0.308204271265957, 0.17017865975808633, 0.09168784117321499, 0.9096454592475096, -0.35766988886608425, 0.03524924262394776], x2 = [0.28686596450880636, 0.11163952306296969, 0.7527073177116553, 0.1250386143966635, -0.08406347433782672, -0.01368379936598659, 0.16817186394006448, -0.7882848144244573, 0.1589684822637237, -0.3016603072338923])
166+
Tables.MatrixTable{Matrix{Float64}} with 10 rows, 2 columns, and schema:
167+
:x1 Float64
168+
:x2 Float64
167169
168170
julia> MLJ.matrix(table_predictions)
169-
10×2 Array{Float64,2}:
171+
10×2 Matrix{Float64}:
170172
0.0867655 0.286866
171173
0.388722 0.11164
172174
-0.0572281 0.752707
@@ -182,4 +184,4 @@ julia> MLJ.matrix(table_predictions)
182184
DocTestSetup = nothing
183185
```
184186
see [MLJ docs](https://alan-turing-institute.github.io/MLJ.jl/dev/) for help on additional
185-
features such as hyper-parameter tuning, performance evaluation, stacking etc.
187+
features such as hyper-parameter tuning, performance evaluation, stacking etc.

src/models.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ end
152152
function _predict_knnclassifier(weights, y, idxsvec)
153153
# `classes` and `classes_seen` has an ordering consistent with the pool of y
154154
classes = @inbounds MMI.classes(y[1])
155-
classes_seen = filter(in(unique(y)), classes)
155+
classes_seen = filter(in(y), classes)
156156
nclasses = length(classes)
157157
nc = length(classes_seen) # Number of classes seen in `y`.
158158

0 commit comments

Comments
 (0)