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

[Question] I have some problem using this package #22

Closed
nesteiner opened this issue Jul 29, 2023 · 5 comments
Closed

[Question] I have some problem using this package #22

nesteiner opened this issue Jul 29, 2023 · 5 comments
Labels
wontfix This will not be worked on

Comments

@nesteiner
Copy link

nesteiner commented Jul 29, 2023

sorry to bother you, I am not pro, and I am not familiar with Data Envelopment Analysis, so I can't understand some options of dea function, such like

dea(X, Y, orient = :Input, rts = :CRS)
  1. orient
  2. rts

actually I don't know about :Input and output


and now I need to solve the Bank Efficiency Evaluation and Bankruptcy Cause Analysis , using the CCR model , here is my code

data2017 = DataFrame(XLSX.readtable("data/A.xlsx", 1))
function handleInvalidData!(dataframe::DataFrame)
  ns = names(dataframe)
  for name in ns
    data = filter(!isequal("?"), dataframe[!, name])
    average = reduce(+, data) / length(data)
    indexs = findall(isequal("?"), dataframe[!, name])
    if !isnothing(indexs)
      dataframe[!, name][indexs] .= average
    end
  end
end

handleInvalidData!(data2017)

# important
let inputnames = ["X3", "X6", "X9", "X20", "X21", "X33", "X34", "X36", "X38", 
                  "X39", "X42", "X44", "X46", "X47", "X50", "X51", "X52", "X54",
                  "X58", "X59", "X60", "X61", "X62", "X63", "X64"]
    outputnames = ["X1", "X2", "X4", "X8", "X10", "X17", "X30", "X53", "X55",
                   "X7", "X12", "X18", "X19", "X22", "X23", "X24", "X29", "X31",
                   "X35", "X45", "X48", "X49"]

    inputs = convert(Matrix{Float64}, Matrix(select(data2017, inputnames)))[1:1000, :]
    outputs = convert(Matrix{Float64}, Matrix(select(data2017, outputnames)))[1:1000, :]

    # optimizer = DEAOptimizer(Ipopt.Optimizer, time_limit = 100000)
    dea(inputs, outputs, orient = :Input, rts = :CRS);
  
end

I got such warning and error
image
image

but when I use this code, everything is ok

let inputnames = ["X3", "X6", "X9", "X20", "X21", "X33", "X34", "X36", "X38", 
                  "X39", "X42", "X44", "X46", "X47", "X50", "X51", "X52", "X54",
                  "X58", "X59", "X60", "X61", "X62", "X63", "X64"]
    outputnames = ["X1", "X2", "X4", "X8", "X10", "X17", "X30", "X53", "X55",
                   "X7", "X12", "X18", "X19", "X22", "X23", "X24", "X29", "X31",
                   "X35", "X45", "X48", "X49"]

    inputs = convert(Matrix{Float64}, Matrix(select(data2017, inputnames)))[1:100, :]
    outputs = convert(Matrix{Float64}, Matrix(select(data2017, outputnames)))[1:100, :]

    # optimizer = DEAOptimizer(Ipopt.Optimizer, time_limit = 100000)
    dea(inputs, outputs, orient = :Input, rts = :CRS);
  
end

just decrease the size of matrix, I don't know why the warning and error occur, do you have any idea ?

@javierbarbero
Copy link
Owner

Hi. It is hard to say without having access to the data. If you share the data with me, I can replicate the error and debug what is happening. (Send me an email if you can't share it publicly.)
Please check that your data does not have 0s or negative values, as this causes infeasibility. Also, infeasibilities tend to appear when there are large differences in the scale of the variables (e.g., one is measured between 0 and 1, and another in thousands or millions).

@nesteiner
Copy link
Author

oh my god, I have been waiting for a long time, please give me your email so that I can send the data

@javierbarbero
Copy link
Owner

My contact details are here: https://www.javierbarbero.net/contact/

@nesteiner
Copy link
Author

I have send it, the title is data from nesteiner

@javierbarbero javierbarbero added the wontfix This will not be worked on label Sep 22, 2023
@javierbarbero
Copy link
Owner

Closed as the issue is related to a user data problem (negative values in inputs and outputs) and not package functionality.

@javierbarbero javierbarbero closed this as not planned Won't fix, can't repro, duplicate, stale Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants