Skip to content

Commit

Permalink
Added a skeleton of experiments.
Browse files Browse the repository at this point in the history
  • Loading branch information
AxiomAlive committed Feb 4, 2025
0 parents commit 52689fc
Show file tree
Hide file tree
Showing 60 changed files with 6,002 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
devenv
env

.idea
*.iml
*.lock
*.out

AGModels/
AutogluonModels/
experiment/AutogluonModels/
datasets/
instanceSpace-master/
imbalanced-ensemble/
logs/
openml_cache/
test/
config_spaces/classifiers_tpot/
stash/

__pycache__/
*.pkl
2 changes: 2 additions & 0 deletions InstanceSpace-master/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
38 changes: 38 additions & 0 deletions InstanceSpace-master/.github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions InstanceSpace-master/.github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
10 changes: 10 additions & 0 deletions InstanceSpace-master/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*.asv
*.zip
*.png
*.pdf
*.mat
*.db
*.csv
old_versions/*.*
old_versions
*.json
65 changes: 65 additions & 0 deletions InstanceSpace-master/CLOISTER.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
function out = CLOISTER(X, A, opts)
% -------------------------------------------------------------------------
% CLOISTER.m
% -------------------------------------------------------------------------
%
% By: Mario Andres Munoz Acosta
% School of Mathematics and Statistics
% The University of Melbourne
% Australia
% 2020
%
% -------------------------------------------------------------------------

disp(' -> CLOISTER is using correlation to estimate a boundary for the space.');

nfeats = size(X,2);
[rho,pval] = corr(X);
rho = rho.*(pval<opts.pval);

Xbnds = [min(X); max(X)];
% if no feature selection. then make a note in the boundary construction
% that it won't work, because nfeats is soo large that de2bi wont be able
% to make a matrix.
idx = de2bi(0:2^nfeats-1)+1;
ncomb = size(idx,1);
Xedge = zeros(ncomb,nfeats);
remove = false(ncomb,1);
for i=1:ncomb
ind = sub2ind([2 nfeats],idx(i,:),1:nfeats);
Xedge(i,:) = Xbnds(ind)';
for j=1:nfeats
for k=j+1:nfeats
% Check for valid points give the correlation trend
if rho(j,k)>opts.cthres && sign(Xedge(i,j))~=sign(Xedge(i,k))
remove(i) = true;
elseif rho(j,k)<-opts.cthres && sign(Xedge(i,j))==sign(Xedge(i,k))
remove(i) = true;
end
if remove(i)
break;
end
end
if remove(i)
break;
end
end
end
Zedge = Xedge*A';
Kedge = convhull(Zedge(:,1),Zedge(:,2));
out.Zedge = Zedge(Kedge,:);

try
Xecorr = Xedge(~remove,:);
Zecorr = Xecorr*A';
Kecorr = convhull(Zecorr(:,1),Zecorr(:,2));
out.Zecorr = Zecorr(Kecorr,:);
catch
disp(' -> The acceptable correlation threshold was too strict.');
disp(' -> The features are weakely correlated.')
disp(' -> Please consider increasing it.');
out.Zecorr = out.Zedge;
end
disp('-------------------------------------------------------------------------');
disp(' -> CLOISTER has completed.');

65 changes: 65 additions & 0 deletions InstanceSpace-master/FILTER.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
function [subsetIndex,isDissimilar,isVISA] = FILTER(X,Y,Ybin,opts)

[ninst,nalgos] = size(Y);
nfeats = size(X,2);

subsetIndex = false(ninst,1);
isDissimilar = true(ninst,1);
isVISA = false(ninst,1);
gamma = sqrt(nalgos/nfeats)*opts.mindistance;

for ii=1:ninst
if ~subsetIndex(ii)
for jj=ii+1:ninst
if ~subsetIndex(jj)
Dx = pdist2(X(ii,:),X(jj,:));
Dy = pdist2(Y(ii,:),Y(jj,:));
Db = all(Ybin(ii,:) & Ybin(jj,:));
if Dx <= opts.mindistance
isDissimilar(jj) = false;
switch opts.type
case 'Ftr'
subsetIndex(jj) = true;
case 'Ftr&AP'
if Dy <= gamma
subsetIndex(jj) = true;
isVISA(jj) = false;
else
isVISA(jj) = true;
end
case 'Ftr&Good'
if Db
subsetIndex(jj) = true;
isVISA(jj) = false;
else
isVISA(jj) = true;
end
case 'Ftr&AP&Good'
if Db
if Dy <= gamma
subsetIndex(jj) = true;
isVISA(jj) = false;
else
isVISA(jj) = true;
end
else
isVISA(jj) = true;
end
otherwise
disp('Invalid flag!')
end
end
end
end
end
end

% Assess the uniformity of the data
D = squareform(pdist(X(~subsetIndex,:)));
ninst = size(D,1);
D(eye(ninst,'logical')) = NaN;
nearest = min(D,[],2,'omitnan');
model.data.unif = 1-(std(nearest)./mean(nearest));
disp(['Uniformity of the instance subset: ' num2str(model.data.unif,4)]);

end
Loading

0 comments on commit 52689fc

Please sign in to comment.