Code Monkey home page Code Monkey logo

ceedesigns.jl's People

Contributors

danielchen26 avatar jasonmvictor avatar slwu89 avatar thevolatilebit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

danielchen26

ceedesigns.jl's Issues

Unify distance, similarity, and uncertainty instantiation

In CEEDesigns.GenerativeDesigns, while "distances" and "similarities" are provided by a user through a function call, an "uncertainty" is given as a type. See the following for reference:

DistanceBased(
data[!, ["RestingBP", "MaxHR", "Cholesterol", "FastingBS", "HeartDisease"]]; # the Mahalanobis distance only works with numeric features, so we selected a few, along with the target variable
target = "HeartDisease",
uncertainty = Entropy,
similarity = Exponential(; λ = 5),
distance = MahalanobisDistance(; diagonal = 1),
);

It may be worth unifying the style.

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Mahalanobis distance with missing entries

The Mahalanobis distance between a state with missing readouts for a subset of features and a "historical" row is essentially calculated as if we were setting the missing entry equal to the respective record in the "historical" row. See the following link for reference:

compute_distances = function (evidence::Evidence)
if isempty(evidence)
return zeros(nrow(data))
else
vec_evidence = map(colname -> get(evidence, colname, 0), non_targets)
distances = map(eachrow(data)) do row
vec_row = map(
colname -> haskey(evidence, colname) ? row[colname] : 0,
non_targets,
)
z = vec_evidence - vec_row
dot(z, Λ * z)
end

However, this might not be the optimal approach. For more information, consider the following resources: https://search.r-project.org/CRAN/refmans/modi/html/MDmiss.html and also https://www.jstor.org/stable/3559861, particularly on page 285.

Optimize computation in `distancebased.jl`

  • There is no need to compute the variance each time in:
    QuadraticDistance(; λ = 1, standardize = true) =
    function (x, col; prior = ones(length(col)))
    σ = standardize ? var(col, Weights(prior); corrected = false) : 1
    return λ * (x .- col) .^ 2 / σ
    end
  • It might be better to preallocate the vectors in
    vec_evidence = map(colname -> get(evidence, colname, 0), non_targets)
    distances = map(eachrow(data)) do row
    vec_row = map(
    colname -> haskey(evidence, colname) ? row[colname] : 0,
    non_targets,
    )
    z = vec_evidence - vec_row
    dot(z, Λ * z)
    end

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.