Last active
November 14, 2016 02:58
-
-
Save rysk-t/1833747fb828a51fc332a0feb359c05f to your computer and use it in GitHub Desktop.
Example codes of drtoolbox (https://lvdmaaten.github.io/drtoolbox/)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % DR-sample codes | |
| clear all; close all | |
| load fisheriris | |
| method{1} = 'PCA'; | |
| method{2} = 'MDS'; | |
| method{3} = 'FactorAnalysis'; | |
| method{4} = 'tSNE'; | |
| for i = 1:length(method) | |
| figure; | |
| [mappedA, mapping] = compute_mapping(meas, method{i}); | |
| gscatter(mappedA(:,1), mappedA(:,2), species) | |
| title(method{i}) | |
| end | |
| %% | |
| species_num = species; | |
| species_num(strcmp(species, 'setosa')) = {1}; | |
| species_num(strcmp(species, 'versicolor')) = {2}; | |
| species_num(strcmp(species, 'virginica')) = {3}; | |
| species_num = cell2mat(species_num); | |
| method{5} = 'LDA'; | |
| method{6} = 'GDA'; | |
| method{7} = 'NCA'; | |
| method{8} = 'MCML'; | |
| for i = 5:6 | |
| figure; | |
| [mappedA, mapping] = compute_mapping([species_num meas], method{i}); | |
| gscatter(mappedA(:,1), mappedA(:,2), species) | |
| title(method{i}) | |
| end | |
| % for i = 7:8 | |
| % figure; | |
| % compute_mapping([species_num meas], method{i}); | |
| % gscatter(mappedA(:,1), mappedA(:,2), species) | |
| % title(method{i}) | |
| % end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment