tsieger / mhca Goto Github PK
View Code? Open in Web Editor NEWMahalanobis hierarchical cluster analysis
Mahalanobis hierarchical cluster analysis
Hi,
on line 1212 in mhclust.c
, there is a condition that checks that not all clusters are of a Mahalanobis threshold size so the clusters can be normalized.
My question is:
Should there be a condition that checks that all samples in the apriori clusters have been clustered as well?
My reasoning behind this is that it can happen that all clusters reached Maha threshold before apriori clusters were fully clustered. And maybe? we want to normalize clusters even if we still have apriori samples?
Hi, because of a recommendation I wanted to try this package and its algorithm, but unfortunately the installation failed.
Can you help or imagine what the problem may be? Thanks, Chris.
This is the error message:
** using staged installation
** libs
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/include -fPIC -Wall -g -O2 -Wall -pedantic -fdiagnostics-color=always -c mhca-init.c -o mhca-init.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/include -fPIC -Wall -g -O2 -Wall -pedantic -fdiagnostics-color=always -c mhclust.c -o mhclust.o
mhclust.c:1086:120: warning: '&&' within '||' [-Wlogical-op-parentheses]
(subthreshHandlingId==SUBTHRESHOLD_METHOD_EUCLID || subthreshHandlingId==SUBTHRESHOLD_METHOD_EUCLID_MAHAL) && wf1==1) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
mhclust.c:1086:120: note: place parentheses around the '&&' expression to silence this warning
(subthreshHandlingId==SUBTHRESHOLD_METHOD_EUCLID || subthreshHandlingId==SUBTHRESHOLD_METHOD_EUCLID_MAHAL) && wf1==1) {
^
( )
1 warning generated.
clang -mmacosx-version-min=10.13 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o mhca.so mhca-init.o mhclust.o -L/Library/Frameworks/R.framework/Resources/lib -lRlapack -L/Library/Frameworks/R.framework/Resources/lib -lRblas -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin18/8.2.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin18/8.2.0'
ld: warning: directory not found for option '-L/usr/local/gfortran/lib'
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [mhca.so] Error 1
ERROR: compilation failed for package ‘mhca’
─ removing ‘/private/var/folders/hd/gcy53z2x6sxd77_f8wl01by81nxlrm/T/RtmpEzmZAL/Rinst14a32da1f4d2/mhca’
Error in %*%: requires numeric/complex matrix/vector arguments
rises when one or more apriori cluster consists of only a single observation, e.g. when calling:
mhclust(data.frame(a=c(1,2,3), b=c(2,3,4)), g=c(1,3,3))
On line 1112 in mhclust.c
there is:
mf=pow(mf,2/p);
I think that part 2/p
is not really what you want as there will be only integer division. That means that in majority of cases you will get zero as p
is usually bigger than 2.
Also, line 1142 seems to be suspicious as well. There is similar operation, but with a minus sign. Is the minus sign intentional?
icNmf=pow(icNmf,-2.0/p);
When covXij
is singular (e.g. [0 0; 0 1]
), det(covXij)
is 0
and mf<-det(covXij)^(1/spaceDim)
gets set to 0, which is unwanted (should be set to 1 in this case). This is because the fixed version of covXij
computed by covXij<-wf1 * covXij + (1-wf1) * mf * fakeInvCov
should be set to fakeInvCov
(the identity matrix), not covXij
.
The identity covariance matrix must not be used in the case when subthreshHandling
is set to 'euclid'
, but the are no subthreshold clusters (i.e. when fullMahalClusterCount >= clusterCount-1
).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.