I just started reading Julia for Machine Learning. and I am getting a series of deprecated warning just from the DataFrames package:
The dataset the book uses for this example has to do with the strength of Wi-Fi signals from various devices to four rooms of a house and the CSV file can be obtained here:
The first warning shows up after creating a new variable (RegressionTarget).
using CSV, StatsBase
df = CSV.read("localization.csv", header=false);
w = [5, 10, 15, 20]
df[:RegressionTarget] = Matrix(df[:, [1, 4, 6, 7]]) * w + randn(2000)
Coming from Pandas, at first I am confused as why the column name is not inside the " " but nevertheless, I am getting this warning:
β Warning: `setindex!(df::DataFrame, v::AbstractVector, col_ind::ColumnIndex)` is deprecated, use `begin
β df[!, col_ind] = v
β df
β end` instead.
β caller = top-level scope at In[10]:6
β @ Core In[10]:6
Similarly, I get similar warning after running this:
X = StatsBase.standardize(ZScoreTransform, map(Float64, Matrix(df[1:7])), dims=2)
β Warning: `getindex(df::DataFrame, col_inds::Union{AbstractVector, Regex, Not})` is deprecated, use `df[:, col_inds]` instead.
β caller = top-level scope at In[11]:1
β @ Core In[11]:1
Can you explain how i should modify my code to get rid of these warnings?
I am running Julia 1.4 on macOS 10.15
Thanks,