Skip to content

Commit b83c033

Browse files
committed
Address review comments
1 parent 543d0c8 commit b83c033

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Loess.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ function loess(
4444
degree::Integer = 2,
4545
cell::AbstractFloat = 0.2
4646
) where T<:AbstractFloat
47+
48+
Base.require_one_based_indexing(xs)
49+
Base.require_one_based_indexing(ys)
50+
4751
if size(xs, 1) != size(ys, 1)
4852
throw(DimensionMismatch("Predictor and response arrays must of the same length"))
4953
end
@@ -180,15 +184,15 @@ function predict(model::LoessModel, zs::AbstractVector)
180184
throw(ArgumentError("Multivariate blending not yet implemented"))
181185
end
182186

183-
predict.(Ref(model), zs)
187+
return [predict(model, z) for z in zs]
184188
end
185189

186190
function predict(model::LoessModel, zs::AbstractMatrix)
187191
if size(model.xs, 2) > 1
188192
throw(ArgumentError("Multivariate blending not yet implemented"))
189193
end
190194

191-
return [predict(model, z) for z in vec(zs)]
195+
return predict(model, vec(zs))
192196
end
193197

194198
"""

0 commit comments

Comments
 (0)