Skip to content

Commit 7786dc1

Browse files
authored
Merge pull request #321 from PolyMathOrg/plot_pca
Updated examples to plot PCA with Roassal 3
2 parents 8555b80 + 2c84554 commit 7786dc1

10 files changed

+329
-151
lines changed

src/BaselineOfPolyMath/BaselineOfPolyMath.class.st

+179-74
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Class {
1515
#category : #BaselineOfPolyMath
1616
}
1717

18-
{ #category : #baseline }
18+
{ #category : #baselines }
1919
BaselineOfPolyMath >> baseline: spec [
2020

2121
<baseline>
@@ -24,80 +24,14 @@ BaselineOfPolyMath >> baseline: spec [
2424
sMark: spec;
2525
xmlWriter: spec;
2626
vectorMatrix: spec;
27-
randomNumbers: spec.
27+
randomNumbers: spec;
28+
datasets: spec;
29+
roassal: spec;
30+
dataFrameInspector: spec.
2831

29-
spec
30-
package: 'ExtendedNumberParser';
31-
package: 'Math-Accuracy-Core';
32-
package: 'Math-Accuracy-ODE' with: [ spec requires: #( 'Math-ODE' 'XMLWriter' ) ];
33-
package: 'Math-ArbitraryPrecisionFloat' with: [ spec requires: #( 'ExtendedNumberParser' ) ];
34-
package: 'Math-AutomaticDifferenciation' with: [ spec requires: #( 'Math-Numerical' 'MathVectorMatrix' ) ];
35-
package: 'Math-Benchmarks-KDTree' with: [ spec requires: #( 'Math-KDTree' 'SMark' ) ];
36-
package: 'Math-Benchmarks-ODE' with: [ spec requires: #( 'Math-ODE' 'SMark' 'XMLWriter' ) ];
37-
package: 'Math-Chromosome' with: [ spec requires: #( 'MathVectorMatrix' ) ];
38-
package: 'Math-Clustering' with: [ spec requires: #( 'Math-Numerical' 'Math-Core-Process' 'MathVectorMatrix' ) ];
39-
package: 'Math-Complex' with: [ spec requires: #( 'Math-Numerical' 'Math-Polynomials' ) ];
40-
package: 'Math-Helpers';
41-
package: 'Math-Distributions' with: [ spec requires: #( 'MathVectorMatrix' 'Math-Quantile' 'Math-Core-Process' ) ];
42-
package: 'Math-Core-Process';
43-
package: 'Math-Numerical'
44-
with: [ spec requires: #( 'MathVectorMatrix' 'Math-Core-Process' 'Math-Distributions' 'Math-StatisticalMoments'
45-
'Math-Series' ) ];
46-
package: 'Math-Polynomials'
47-
with: [ spec requires: #( 'MathVectorMatrix' 'Math-Core-Process' 'Math-Distributions' 'Math-StatisticalMoments'
48-
'Math-Series' ) ];
49-
package: 'Math-FastFourierTransform' with: [ spec requires: #( 'Math-Complex' ) ];
50-
package: 'Math-FunctionFit'
51-
with: [ spec requires: #( 'Math-Numerical' 'Math-Chromosome' 'Math-Accuracy-Core' 'MathVectorMatrix' 'Math-Helpers' 'Math-Polynomials' ) ];
52-
package: 'Math-KDTree';
53-
package: 'Math-Number-Extensions';
54-
package: 'Math-ODE' with: [ spec requires: #( 'Math-Numerical' 'MathVectorMatrix' 'Math-Polynomials' ) ];
55-
package: 'Math-Permutation' with: [ spec requires: #( 'MathVectorMatrix' 'Math-Core-Process' ) ];
56-
package: 'Math-Physics-Constants';
57-
package: 'Math-PrincipalComponentAnalysis' with: [ spec requires: #( 'Math-Numerical' 'MathVectorMatrix' 'Math-Polynomials' ) ];
58-
package: 'Math-Quantile';
59-
package: 'Math-Quaternion' with: [ spec requires: #( 'Math-Complex' 'Math-Numerical' 'Math-Polynomials' ) ];
60-
package: 'Math-Series';
61-
package: 'Math-StatisticalMoments' with: [ spec requires: #( 'Math-Helpers' 'Math-Distributions' ) ];
62-
package: 'Math-TSNE';
63-
package: 'Math-Tests-Accuracy' with: [ spec requires: #( 'Math-Accuracy-Core' ) ];
64-
package: 'Math-Tests-ArbitraryPrecisionFloat' with: [ spec requires: #( 'Math-ArbitraryPrecisionFloat' ) ];
65-
package: 'Math-Tests-AutomaticDifferenciation' with: [ spec requires: #( 'Math-AutomaticDifferenciation' 'MathVectorMatrix' ) ];
66-
package: 'Math-Tests-Clustering' with: [ spec requires: #( 'Math-Clustering' 'Math-Distributions' 'Math-UtilsDataServer' ) ];
67-
package: 'Math-Tests-Complex' with: [ spec requires: #( 'Math-Complex' ) ];
68-
package: 'Math-Tests-Distributions' with: [ spec requires: #( 'Math-Distributions' ) ];
69-
package: 'Math-Tests-Core-Process' with: [ spec requires: #( 'Math-Core-Process' ) ];
70-
package: 'Math-Tests-Numerical' with: [ spec requires: #( 'Math-Numerical' 'Math-UtilsDataServer' ) ];
71-
package: 'Math-Tests-FastFourierTransform' with: [ spec requires: #( 'Math-FastFourierTransform' 'Math-Numerical' 'Math-Polynomials' ) ];
72-
package: 'Math-Tests-FunctionFit';
73-
package: 'Math-Tests-KDTree' with: [ spec requires: #( 'Math-KDTree' ) ];
74-
package: 'Math-Tests-Number-Extensions' with: [ spec requires: #( 'Math-Number-Extensions' ) ];
75-
package: 'Math-Tests-ODE' with: [ spec requires: #( 'Math-ODE' ) ];
76-
package: 'Math-Tests-Permutation' with: [ spec requires: #( 'Math-Permutation' ) ];
77-
package: 'Math-Tests-PrincipalComponentAnalysis' with: [ spec requires: #( 'Math-PrincipalComponentAnalysis' ) ];
78-
package: 'Math-Tests-Quantile' with: [ spec requires: #( 'Math-Quantile' ) ];
79-
package: 'Math-Tests-Polynomials' with: [ spec requires: #( 'Math-Polynomials' ) ];
80-
package: 'Math-Tests-Quaternion' with: [ spec requires: #( 'Math-Quaternion' ) ];
81-
package: 'Math-Tests-TSNE' with: [ spec requires: #( 'Math-TSNE' ) ];
82-
package: 'Math-UtilsDataServer'.
83-
spec
84-
group: 'Accuracy' with: #( 'Math-Accuracy-ODE' 'Math-Accuracy-Core' );
85-
group: 'Benchmarks' with: #( 'Math-Benchmarks-ODE' 'Math-Benchmarks-KDTree' );
86-
group: 'Core'
87-
with:
88-
#( 'Math-Complex' 'Math-Quaternion' 'Math-Numerical' 'MathRandomNumbers' 'Math-KDTree' 'Math-ODE' 'Math-ArbitraryPrecisionFloat'
89-
'Math-FastFourierTransform' 'ExtendedNumberParser' 'Math-Quantile' 'Math-Physics-Constants' 'Math-Polynomials' 'Math-TSNE' 'Math-Core-Process'
90-
'Math-Helpers' 'MathVectorMatrix' 'Math-Distributions' );
91-
group: 'Extensions'
92-
with: #( 'Math-Clustering' 'Math-Number-Extensions' 'Math-Chromosome' 'Math-PrincipalComponentAnalysis' 'Math-FunctionFit' 'Math-AutomaticDifferenciation'
93-
'Math-Permutation' );
94-
group: 'Tests'
95-
with:
96-
#( 'Math-Tests-Clustering' 'Math-Tests-Numerical' 'Math-Tests-Complex' 'Math-Tests-Quaternion' 'Math-Tests-ODE' 'Math-Tests-KDTree' 'Math-Tests-FunctionFit'
97-
'Math-Tests-AutomaticDifferenciation' 'Math-Tests-FastFourierTransform' 'Math-Tests-Accuracy' 'Math-Tests-ArbitraryPrecisionFloat'
98-
'Math-Tests-Quantile' 'Math-Tests-Polynomials' 'Math-Tests-PrincipalComponentAnalysis' 'Math-Tests-Number-Extensions' 'Math-Tests-Permutation'
99-
'Math-Tests-TSNE' 'Math-Tests-Core-Process' 'Math-Tests-Distributions' );
100-
group: 'default' with: #( 'Core' 'Extensions' 'Tests' 'Benchmarks' 'Accuracy' ) ].
32+
self
33+
packages: spec;
34+
groups: spec ].
10135

10236
spec for: #( #'pharo6.x' #'pharo7.x' #'pharo8.x' #'pharo9.x' #'pharo10.x' ) do: [
10337
spec
@@ -107,6 +41,169 @@ BaselineOfPolyMath >> baseline: spec [
10741
package: 'Math-CompatibilityUpToPharo11' ]
10842
]
10943

44+
{ #category : #dependencies }
45+
BaselineOfPolyMath >> dataFrameInspector: spec [
46+
47+
spec
48+
baseline: 'AIDataFrameInspector'
49+
with: [ spec repository: 'github://pharo-ai/data-inspector/src' ]
50+
]
51+
52+
{ #category : #dependencies }
53+
BaselineOfPolyMath >> datasets: spec [
54+
55+
spec
56+
baseline: 'AIDatasets'
57+
with: [ spec repository: 'github://pharo-ai/datasets' ].
58+
]
59+
60+
{ #category : #baselines }
61+
BaselineOfPolyMath >> groups: spec [
62+
63+
spec
64+
group: 'Accuracy'
65+
with: #( 'Math-Accuracy-ODE' 'Math-Accuracy-Core' );
66+
group: 'Benchmarks'
67+
with: #( 'Math-Benchmarks-ODE' 'Math-Benchmarks-KDTree' );
68+
group: 'Core'
69+
with:
70+
#( 'Math-Complex' 'Math-Quaternion' 'Math-Numerical'
71+
'MathRandomNumbers' 'Math-KDTree' 'Math-ODE' 'Math-ArbitraryPrecisionFloat'
72+
'Math-FastFourierTransform' 'ExtendedNumberParser'
73+
'Math-Quantile' 'Math-Physics-Constants'
74+
'Math-Polynomials' 'Math-TSNE' 'Math-Core-Process'
75+
'Math-Helpers' 'MathVectorMatrix' 'Math-Distributions' );
76+
group: 'Extensions'
77+
with:
78+
#( 'Math-Clustering' 'Math-Number-Extensions'
79+
'Math-Chromosome' 'Math-PrincipalComponentAnalysis'
80+
'Math-FunctionFit' 'Math-AutomaticDifferenciation'
81+
'Math-Permutation' );
82+
group: 'Tests'
83+
with: #( 'Math-Tests-Clustering' 'Math-Tests-Numerical'
84+
'Math-Tests-Complex' 'Math-Tests-Quaternion'
85+
'Math-Tests-ODE' 'Math-Tests-KDTree' 'Math-Tests-FunctionFit'
86+
'Math-Tests-AutomaticDifferenciation'
87+
'Math-Tests-FastFourierTransform'
88+
'Math-Tests-Accuracy' 'Math-Tests-ArbitraryPrecisionFloat'
89+
'Math-Tests-Quantile' 'Math-Tests-Polynomials'
90+
'Math-Tests-PrincipalComponentAnalysis'
91+
'Math-Tests-Number-Extensions' 'Math-Tests-Permutation'
92+
'Math-Tests-TSNE' 'Math-Tests-Core-Process'
93+
'Math-Tests-Distributions' );
94+
group: 'visualizations'
95+
with:
96+
#( 'Core' 'Extensions' 'Tests' 'Benchmarks' 'Accuracy' 'Math-Visualizations' );
97+
group: 'default'
98+
with: #( 'Core' 'Extensions' 'Tests' 'Benchmarks' 'Accuracy' )
99+
]
100+
101+
{ #category : #baselines }
102+
BaselineOfPolyMath >> packages: spec [
103+
104+
spec
105+
package: 'ExtendedNumberParser';
106+
package: 'Math-Accuracy-Core';
107+
package: 'Math-Accuracy-ODE'
108+
with: [ spec requires: #( 'Math-ODE' 'XMLWriter' ) ];
109+
package: 'Math-ArbitraryPrecisionFloat'
110+
with: [ spec requires: #( 'ExtendedNumberParser' ) ];
111+
package: 'Math-AutomaticDifferenciation'
112+
with: [ spec requires: #( 'Math-Numerical' 'MathVectorMatrix' ) ];
113+
package: 'Math-Benchmarks-KDTree'
114+
with: [ spec requires: #( 'Math-KDTree' 'SMark' ) ];
115+
package: 'Math-Benchmarks-ODE'
116+
with: [ spec requires: #( 'Math-ODE' 'SMark' 'XMLWriter' ) ];
117+
package: 'Math-Chromosome'
118+
with: [ spec requires: #( 'MathVectorMatrix' ) ];
119+
package: 'Math-Clustering' with: [
120+
spec requires:
121+
#( 'Math-Numerical' 'Math-Core-Process' 'MathVectorMatrix' ) ];
122+
package: 'Math-Complex'
123+
with: [ spec requires: #( 'Math-Numerical' 'Math-Polynomials' ) ];
124+
package: 'Math-Helpers';
125+
package: 'Math-Distributions' with: [
126+
spec requires:
127+
#( 'MathVectorMatrix' 'Math-Quantile' 'Math-Core-Process' ) ];
128+
package: 'Math-Core-Process';
129+
package: 'Math-Numerical' with: [
130+
spec requires:
131+
#( 'MathVectorMatrix' 'Math-Core-Process' 'Math-Distributions'
132+
'Math-StatisticalMoments' 'Math-Series' ) ];
133+
package: 'Math-Polynomials' with: [
134+
spec requires:
135+
#( 'MathVectorMatrix' 'Math-Core-Process' 'Math-Distributions'
136+
'Math-StatisticalMoments' 'Math-Series' ) ];
137+
package: 'Math-FastFourierTransform'
138+
with: [ spec requires: #( 'Math-Complex' ) ];
139+
package: 'Math-FunctionFit' with: [
140+
spec requires:
141+
#( 'Math-Numerical' 'Math-Chromosome' 'Math-Accuracy-Core'
142+
'MathVectorMatrix' 'Math-Helpers' 'Math-Polynomials' ) ];
143+
package: 'Math-KDTree';
144+
package: 'Math-Number-Extensions';
145+
package: 'Math-ODE' with: [
146+
spec requires:
147+
#( 'Math-Numerical' 'MathVectorMatrix' 'Math-Polynomials' ) ];
148+
package: 'Math-Permutation'
149+
with: [ spec requires: #( 'MathVectorMatrix' 'Math-Core-Process' ) ];
150+
package: 'Math-Physics-Constants';
151+
package: 'Math-PrincipalComponentAnalysis' with: [
152+
spec requires:
153+
#( 'Math-Numerical' 'MathVectorMatrix' 'Math-Polynomials' ) ];
154+
package: 'Math-Quantile';
155+
package: 'Math-Quaternion' with: [
156+
spec requires:
157+
#( 'Math-Complex' 'Math-Numerical' 'Math-Polynomials' ) ];
158+
package: 'Math-Series';
159+
package: 'Math-StatisticalMoments'
160+
with: [ spec requires: #( 'Math-Helpers' 'Math-Distributions' ) ];
161+
package: 'Math-TSNE';
162+
package: 'Math-Tests-Accuracy'
163+
with: [ spec requires: #( 'Math-Accuracy-Core' ) ];
164+
package: 'Math-Tests-ArbitraryPrecisionFloat'
165+
with: [ spec requires: #( 'Math-ArbitraryPrecisionFloat' ) ];
166+
package: 'Math-Tests-AutomaticDifferenciation' with: [
167+
spec requires:
168+
#( 'Math-AutomaticDifferenciation'
169+
'MathVectorMatrix' ) ];
170+
package: 'Math-Tests-Clustering' with: [
171+
spec requires:
172+
#( 'Math-Clustering' 'Math-Distributions' 'Math-UtilsDataServer' ) ];
173+
package: 'Math-Tests-Complex'
174+
with: [ spec requires: #( 'Math-Complex' ) ];
175+
package: 'Math-Tests-Distributions'
176+
with: [ spec requires: #( 'Math-Distributions' ) ];
177+
package: 'Math-Tests-Core-Process'
178+
with: [ spec requires: #( 'Math-Core-Process' ) ];
179+
package: 'Math-Tests-Numerical'
180+
with: [ spec requires: #( 'Math-Numerical' 'Math-UtilsDataServer' ) ];
181+
package: 'Math-Tests-FastFourierTransform' with: [
182+
spec requires:
183+
#( 'Math-FastFourierTransform' 'Math-Numerical' 'Math-Polynomials' ) ];
184+
package: 'Math-Tests-FunctionFit';
185+
package: 'Math-Tests-KDTree'
186+
with: [ spec requires: #( 'Math-KDTree' ) ];
187+
package: 'Math-Tests-Number-Extensions'
188+
with: [ spec requires: #( 'Math-Number-Extensions' ) ];
189+
package: 'Math-Tests-ODE' with: [ spec requires: #( 'Math-ODE' ) ];
190+
package: 'Math-Tests-Permutation'
191+
with: [ spec requires: #( 'Math-Permutation' ) ];
192+
package: 'Math-Tests-PrincipalComponentAnalysis'
193+
with: [ spec requires: #( 'Math-PrincipalComponentAnalysis' ) ];
194+
package: 'Math-Tests-Quantile'
195+
with: [ spec requires: #( 'Math-Quantile' ) ];
196+
package: 'Math-Tests-Polynomials'
197+
with: [ spec requires: #( 'Math-Polynomials' ) ];
198+
package: 'Math-Tests-Quaternion'
199+
with: [ spec requires: #( 'Math-Quaternion' ) ];
200+
package: 'Math-Tests-TSNE'
201+
with: [ spec requires: #( 'Math-TSNE' ) ];
202+
package: 'Math-UtilsDataServer';
203+
package: 'Math-Visualizations'
204+
with: [ spec requires: #( 'AIDatasets' 'AIDataFrameInspector') ]
205+
]
206+
110207
{ #category : #accessing }
111208
BaselineOfPolyMath >> projectClass [
112209
^ [ self class environment at: #MetacelloCypressBaselineProject ]
@@ -120,6 +217,14 @@ BaselineOfPolyMath >> randomNumbers: spec [
120217
spec baseline: 'MathRandomNumbers' with: [ spec repository: 'github://PolyMathOrg/random-numbers:v1.x.x/src' ]
121218
]
122219

220+
{ #category : #dependencies }
221+
BaselineOfPolyMath >> roassal: spec [
222+
223+
spec
224+
baseline: 'Roassal'
225+
with: [ spec repository: 'github://pharo-graphics/Roassal' ].
226+
]
227+
123228
{ #category : #dependencies }
124229
BaselineOfPolyMath >> sMark: spec [
125230

src/Math-PrincipalComponentAnalysis/PMDataTransformer.class.st

+7-6
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,23 @@ PMDataTransformer is the abstract root class of transformers. All data transform
33
44
"
55
Class {
6-
#name : #PMDataTransformer,
7-
#superclass : #Object,
8-
#category : #'Math-PrincipalComponentAnalysis'
6+
#name : 'PMDataTransformer',
7+
#superclass : 'Object',
8+
#category : 'Math-PrincipalComponentAnalysis',
9+
#package : 'Math-PrincipalComponentAnalysis'
910
}
1011

11-
{ #category : #accessing }
12+
{ #category : 'accessing' }
1213
PMDataTransformer >> fit: aPMMatrix [
1314
^ self subclassResponsibility
1415
]
1516

16-
{ #category : #accessing }
17+
{ #category : 'accessing' }
1718
PMDataTransformer >> fitAndTransform: aPMMatrix [
1819
^ (self fit: aPMMatrix) transform: aPMMatrix
1920
]
2021

21-
{ #category : #transforming }
22+
{ #category : 'transforming' }
2223
PMDataTransformer >> transform: aPMMatrix [
2324
^ self subclassResponsibility
2425
]
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,34 @@
11
Class {
2-
#name : #PMPrincipalComponentAnalyser,
3-
#superclass : #Object,
2+
#name : 'PMPrincipalComponentAnalyser',
3+
#superclass : 'Object',
44
#instVars : [
55
'componentsNumber'
66
],
7-
#category : #'Math-PrincipalComponentAnalysis'
7+
#category : 'Math-PrincipalComponentAnalysis',
8+
#package : 'Math-PrincipalComponentAnalysis'
89
}
910

10-
{ #category : #accessing }
11+
{ #category : 'accessing' }
1112
PMPrincipalComponentAnalyser >> componentsNumber [
1213
^ componentsNumber
1314
]
1415

15-
{ #category : #accessing }
16+
{ #category : 'accessing' }
1617
PMPrincipalComponentAnalyser >> componentsNumber: anInteger [
1718
componentsNumber := anInteger
1819
]
1920

20-
{ #category : #accessing }
21+
{ #category : 'accessing' }
2122
PMPrincipalComponentAnalyser >> fit: aPMMatrix [
2223
^ self subclassResponsibility
2324
]
2425

25-
{ #category : #accessing }
26+
{ #category : 'accessing' }
2627
PMPrincipalComponentAnalyser >> fitAndTransform: aPMMatrix [
2728
^ (self fit: aPMMatrix) transform: aPMMatrix
2829
]
2930

30-
{ #category : #accessing }
31+
{ #category : 'accessing' }
3132
PMPrincipalComponentAnalyser >> transform: aPMMatrix [
3233
^ self subclassResponsibility
3334
]

0 commit comments

Comments
 (0)