I'm not good at English. So I ask for your patience and editing.
I have analysed census data of South Korea. I used 'adaboost' as a analysis method and adaboost was implemented for each cities. Target variable, independent variables, formula, options, the number of observation, etc, everything is same among cities. There is no difference. And I made a macro that implements adaboost for the cities one by one. The macro removes all objects except for itself before it starts to analyse the next city.
And I found that average process speed is getting slower as time goes on. I mean that the average time needed for cities 1-30 was around 10 minutes, but it became 25 minutes for the cities 80-100. So I terminated the R session and re-opened. I re-ran the macro from 80th city, then the average time for cities 80-100 was reduced to 10 minutes.
Why does this happen? How can I solve this problem? I need your help. Thanks in advance.
The r code and macro are as below. 'sgg' macro variable indicates city codes. Target variable has six categories. So I used 'one-others' method for multi-class classification.
memory.limit(size=4095)
library(gbm)
library(gtools)
dbset<-strmacro(sgg,sampnum,
expr=
{
setwd("C:\\Users\\Kim\\Desktop\\JQ\\");
db.sgg<-read.table('sgg.TXT', header=TRUE);
db.sgg<-subset(db.sgg, AGE>=10)
N<-nrow(db.sgg);
if(N>=sampnum)
{
db.sgg<-db.sgg[sample(1:N, sampnum),]
};
db.sgg$SEX<-factor(letters[db.sgg$SEX])
ordered(db.sgg$AREA);
db.sgg$josagu_attri_mod2<-factor(letters[db.sgg$josagu_attri_mod])
db.sgg$geocheo_type_mod2<-factor(letters[db.sgg$geocheo_type_mod])
db.sgg$dandok_type_mod2<-factor(letters[db.sgg$dandok_type_mod])
colnames(db.sgg)[10:15]<-c('FLC3.1','FLC3.3','FLC3.4','FLC3.5','FLC3.6','FLC3.7');
}
);
train<-strmacro(i, sgg,
expr={
res.sgg.i<-gbm(FLC3.i~SEX+AREA+AGE+josagu_attri_mod2+geocheo_type_mod2+dandok_type_mod2,
data=db.sgg, distribution='adaboost', n.trees=3000,shrinkage = 0.005,
cv.folds=5, keep.data=TRUE,
bag.fraction=0.7, interaction.depth=3);
BI.sgg.i<-gbm.perf(res.sgg.i, method='cv');
PRED.sgg.i<-predict.gbm(res.sgg.i, db.sgg, BI.sgg.i);
}
);
clean<-strmacro(sgg,
expr={
rm(BI.sgg.1);rm(BI.sgg.3);rm(BI.sgg.4);rm(BI.sgg.5);rm(BI.sgg.6);rm(BI.sgg.7);
rm(res.sgg.1);rm(res.sgg.3);rm(res.sgg.4);rm(res.sgg.5);rm(res.sgg.6);rm(res.sgg.7);
rm(PRED.sgg.1);rm(PRED.sgg.3);rm(PRED.sgg.4);rm(PRED.sgg.5);rm(PRED.sgg.6);rm(PRED.sgg.7);
rm(db.sgg);
}
);
all<-strmacro(sgg,num,
expr={
dbset(sgg,num);
train(1,sgg);train(3,sgg);train(4,sgg);train(5,sgg);train(6,sgg);train(7,sgg);
clean(sgg);
}
);
all(11010,3000)
all(11020,3000)
all(11030,3000)
Data is as below. This data is stored in '11010.txt'.
C3 mem_num josagu_attri_mod SEX AGE geocheo_type_mod dandok_type_mod C97 FLC3 FLC3_1 FLC3_3 FLC3_4 FLC_4 FLC3_6 FLC3_7 AREA
1 3 3 1 14 1 1 49 3 0 0 1 0 0 0 2
1 1 1 2 44 1 1 49 3 0 0 1 0 0 0 2
2 1 1 1 67 1 1 46 6 0 0 0 0 0 1 2
2 2 2 2 60 1 1 46 6 0 0 0 0 0 1 2
3 1 1 2 65 1 1 49 6 0 0 0 0 0 1 2
4 1 1 1 66 1 4 16 6 0 0 0 0 0 1 1
4 2 2 2 61 1 4 16 6 0 0 0 0 0 1 1
5 1 1 2 32 1 6 15 1 1 0 0 0 0 0 1
7 2 2 1 55 1 6 59 5 0 0 0 0 1 0 2
7 4 3 1 23 1 6 59 5 0 0 0 0 1 0 2
7 1 1 2 50 1 6 59 5 0 0 0 0 1 0 2
7 3 3 2 24 1 6 59 5 0 0 0 0 1 0 2
8 1 1 1 68 1 1 46 6 0 0 0 0 0 1 2
8 2 2 2 64 1 1 46 6 0 0 0 0 0 1 2
9 1 1 1 57 1 1 59 5 0 0 0 0 1 0 2
9 2 2 2 55 1 1 59 5 0 0 0 0 1 0 2
9 3 3 2 28 1 1 59 5 0 0 0 0 1 0 2
10 2 3 1 17 1 6 16 4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 0 0 0 0 1 0 2
65 2 2 2 57 2 1 50 5 0 0 0 0 1 0 2
66 1 1 1 49 2 1 50 5 0 0 0 0 1 0 2
66 2 2 2 54 2 1 50 5 0 0 0 0 1 0 2
66 3 3 2 25 2 1 50 5 0 0 0 0 1 0 2
67 1 1 1 67 2 1 120 6 0 0 0 0 0 1 4
67 2 2 2 65 2 1 120 6 0 0 0 0 0 1 4
68 1 1 1 49 2 4 98 5 0 0 0 0 1 0 3
68 4 3 1 18 2 4 98 5 0 0 0 0 1 0 3
68 2 2 2 48 2 4 98 5 0 0 0 0 1 0 3
68 3 3 2 20 2 4 98 5 0 0 0 0 1 0 3
70 1 1 1 66 2 1 101 6 0 0 0 0 0 1 4
70 2 2 2 56 2 1 101 6 0 0 0 0 0 1 4
71 1 1 1 37 2 2 101 2 0 1 0 0 0 0 4
71 2 2 2 37 2 2 101 2 0 1 0 0 0 0 4
72 1 1 1 74 1 1 91 5 0 0 0 0 1 0 3
72 3 3 1 41 1 1 91 5 0 0 0 0 1 0 3
72 2 2 2 71 1 1 91 5 0 0 0 0 1 0 3
73 1 1 1 60 1 1 91 5 0 0 0 0 1 0 3
73 3 3 1 27 1 1 91 5 0 0 0 0 1 0 3
73 2 2 2 57 1 1 91 5 0 0 0 0 1 0 3
74 1 1 1 61 2 1 119 5 0 0 0 0 1 0 4
74 4 3 1 30 2 1 119 5 0 0 0 0 1 0 4
74 2 2 2 56 2 1 119 5 0 0 0 0 1 0 4
74 3 3 2 32 2 1 119 5 0 0 0 0 1 0 4
75 2 2 1 72 1 1 99 6 0 0 0 0 0 1 3
75 1 1 2 71 1 1 99 6 0 0 0 0 0 1 3
78 1 1 2 28 1 4 15 1 1 0 0 0 0 0 1
80 1 1 1 68 1 1 92 6 0 0 0 0 0 1 3
80 2 2 2 66 1 1 92 6 0 0 0 0 0 1 3
81 2 3 1 27 1 6 46 5 0 0 0 0 1 0 2
81 3 3 1 29 1 6 46 5 0 0 0 0 1 0 2
81 1 1 2 57 1 6 46 5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 0 0 0 1 0 0 3
97 2 2 2 51 2 1 83 4 0 0 0 1 0 0 3
97 3 3 2 21 2 1 83 4 0 0 0 1 0 0 3
98 1 1 1 49 4 1 85 4 0 0 0 1 0 0 3
98 2 2 2 42 4 1 85 4 0 0 0 1 0 0 3
98 3 3 2 20 4 1 85 4 0 0 0 1 0 0 3
98 4 3 2 17 4 1 85 4 0 0 0 1 0 0 3
99 1 1 1 69 4 1 96 6 0 0 0 0 0 1 3
99 2 2 2 66 4 1 96 6 0 0 0 0 0 1 3
100 1 1 1 69 4 1 96 6 0 0 0 0 0 1 3
100 2 2 2 60 4 1 96 6 0 0 0 0 0 1 3
101 1 1 1 32 4 4 33 1 1 0 0 0 0 0 2
101 2 2 2 32 4 4 33 1 1 0 0 0 0 0 2
103 1 1 1 39 1 6 27 4 0 0 0 1 0 0 1
103 2 2 2 34 1 6 27 4 0 0 0 1 0 0 1
103 3 3 2 13 1 6 27 4 0 0 0 1 0 0 1
105 2 3 1 19 1 6 27 5 0 0 0 0 1 0 1
105 3 3 1 25 1 6 27 5 0 0 0 0 1 0 1
105 1 1 2 49 1 6 27 5 0 0 0 0 1 0 1
106 1 1 1 28 1 6 23 1 1 0 0 0 0 0 1
107 1 1 1 49 2 1 78 5 0 0 0 0 1 0 3
107 3 3 1 18 2 1 78 5 0 0 0 0 1 0 3
107 4 3 1 21 2 1 78 5 0 0 0 0 1 0 3
107 2 2 2 49 2 1 78 5 0 0 0 0 1 0 3
108 1 1 1 33 2 4 78 1 1 0 0 0 0 0 3
108 2 2 2 28 2 4 78 1 1 0 0 0 0 0 3
109 1 1 1 55 2 1 78 5 0 0 0 0 1 0 3
109 3 3 1 21 2 1 78 5 0 0 0 0 1 0 3
109 2 2 2 53 2 1 78 5 0 0 0 0 1 0 3
110 1 1 1 48 2 1 78 4 0 0 0 1 0 0 3
110 2 2 2 45 2 1 78 4 0 0 0 1 0 0 3
110 3 3 2 20 2 1 78 4 0 0 0 1 0 0 3
110 4 3 2 15 2 1 78 4 0 0 0 1 0 0 3
111 1 1 1 37 2 4 78 2 0 1 0 0 0 0 3
111 2 2 2 34 2 4 78 2 0 1 0 0 0 0 3
112 1 1 1 28 4 4 82 2 0 1 0 0 0 0 3
112 2 2 2 30 4 4 82 2 0 1 0 0 0 0 3
113 1 1 1 64 4 1 63 5 0 0 0 0 1 0 2
113 3 3 1 26 4 1 63 5 0 0 0 0 1 0 2
113 2 2 2 55 4 1 63 5 0 0 0 0 1 0 2
113 4 3 2 24 4 1 63 5 0 0 0 0 1 0 2
115 1 1 1 42 4 4 58 3 0 0 1 0 0 0 2
115 4 3 1 10 4 4 58 3 0 0 1 0 0 0 2
115 2 2 2 39 4 4 58 3 0 0 1 0 0 0 2
115 3 3 2 12 4 4 58 3 0 0 1 0 0 0 2
116 1 1 1 56 4 1 63 5 0 0 0 0 1 0 2
116 3 3 1 29 4 1 63 5 0 0 0 0 1 0 2
116 2 2 2 51 4 1 63 5 0 0 0 0 1 0 2
118 1 1 1 75 4 1 70 6 0 0 0 0 0 1 3
118 2 2 2 74 4 1 70 6 0 0 0 0 0 1 3
119 1 1 1 49 1 4 66 4 0 0 0 1 0 0 2
119 3 3 1 18 1 4 66 4 0 0 0 1 0 0 2
119 4 3 1 17 1 4 66 4 0 0 0 1 0 0 2
119 2 2 2 47 1 4 66 4 0 0 0 1 0 0 2
120 2 3 1 32 4 1 56 5 0 0 0 0 1 0 2
120 1 1 2 64 4 1 56 5 0 0 0 0 1 0 2
120 3 3 2 41 4 1 56 5 0 0 0 0 1 0 2
121 1 1 1 44 4 4 56 4 0 0 0 1 0 0 2
121 3 3 1 17 4 4 56 4 0 0 0 1 0 0 2
121 4 3 1 16 4 4 56 4 0 0 0 1 0 0 2
121 2 2 2 42 4 4 56 4 0 0 0 1 0 0 2
123 1 1 1 44 4 4 56 3 0 0 1 0 0 0 2
123 2 2 2 43 4 4 56 3 0 0 1 0 0 0 2
123 3 3 2 11 4 4 56 3 0 0 1 0 0 0 2
123 5 3 2 14 4 4 56 3 0 0 1 0 0 0 2
125 2 3 1 21 1 4 30 5 0 0 0 0 1 0 1
125 1 1 2 48 1 4 30 5 0 0 0 0 1 0 1
126 1 1 1 49 1 4 30 5 0 0 0 0 1 0 1
126 2 2 2 44 1 4 30 5 0 0 0 0 1 0 1
126 3 3 2 25 1 4 30 5 0 0 0 0 1 0 1
127 1 1 1 75 1 6 25 6 0 0 0 0 0 1 1
128 1 1 1 49 2 1 82 3 0 0 1 0 0 0 3
128 3 3 1 12 2 1 82 3 0 0 1 0 0 0 3
128 2 2 2 43 2 1 82 3 0 0 1 0 0 0 3
129 1 1 2 66 2 1 82 6 0 0 0 0 0 1 3
130 1 1 1 36 2 4 82 3 0 0 1 0 0 0 3
130 2 2 2 41 2 4 82 3 0 0 1 0 0 0 3
130 3 3 2 11 2 4 82 3 0 0 1 0 0 0 3
132 1 1 2 64 2 1 82 6 0 0 0 0 0 1 3
133 1 1 1 34 2 1 82 2 0 1 0 0 0 0 3
133 2 2 2 35 2 1 82 2 0 1 0 0 0 0 3
134 1 1 1 37 2 4 82 2 0 1 0 0 0 0 3
134 2 2 2 35 2 4 82 2 0 1 0 0 0 0 3
135 1 1 1 38 2 4 82 2 0 1 0 0 0 0 3
135 2 2 2 37 2 4 82 2 0 1 0 0 0 0 3
136 1 1 1 31 2 6 83 1 1 0 0 0 0 0 3
136 2 2 2 29 2 6 83 1 1 0 0 0 0 0 3
137 2 2 1 47 2 5 30 3 0 0 1 0 0 0 1
137 3 3 1 19 2 5 30 3 0 0 1 0 0 0 1
137 1 1 2 43 2 5 30 3 0 0 1 0 0 0 1
137 4 3 2 10 2 5 30 3 0 0 1 0 0 0 1
138 2 3 1 24 2 5 30 5 0 0 0 0 1 0 1
138 1 1 2 54 2 5 30 5 0 0 0 0 1 0 1
139 1 1 2 44 2 5 30 4 0 0 0 1 0 0 1
139 2 3 2 13 2 5 30 4 0 0 0 1 0 0 1
139 3 3 2 15 2 5 30 4 0 0 0 1 0 0 1
140 1 1 2 55 2 5 30 5 0 0 0 0 1 0 1
140 2 3 2 29 2 5 30 5 0 0 0 0 1 0 1
141 1 1 1 45 2 5 30 4 0 0 0 1 0 0 1
141 2 2 2 43 2 5 30 4 0 0 0 1 0 0 1
141 3 3 2 15 2 5 30 4 0 0 0 1 0 0 1
141 4 3 2 13 2 5 30 4 0 0 0 1 0 0 1
142 1 1 2 52 2 5 30 4 0 0 0 1 0 0 1
142 2 3 2 23 2 5 30 4 0 0 0 1 0 0 1
142 3 3 2 18 2 5 30 4 0 0 0 1 0 0 1
144 1 1 1 52 2 5 30 5 0 0 0 0 1 0 1
144 4 3 1 19 2 5 30 5 0 0 0 0 1 0 1
144 2 2 2 48 2 5 30 5 0 0 0 0 1 0 1
144 3 3 2 22 2 5 30 5 0 0 0 0 1 0 1
145 1 1 1 61 2 4 72 6 0 0 0 0 0 1 3
145 2 2 2 55 2 4 72 6 0 0 0 0 0 1 3
147 1 1 1 32 2 4 85 1 1 0 0 0 0 0 3
147 2 2 2 33 2 4 85 1 1 0 0 0 0 0 3
148 1 1 1 30 2 1 85 1 1 0 0 0 0 0 3
148 2 2 2 35 2 1 85 1 1 0 0 0 0 0 3
149 2 2 1 54 1 1 46 4 0 0 0 1 0 0 2
149 1 1 2 51 1 1 46 4 0 0 0 1 0 0 2
149 3 3 2 20 1 1 46 4 0 0 0 1 0 0 2
149 4 3 2 13 1 1 46 4 0 0 0 1 0 0 2
149 5 3 2 27 1 1 46 4 0 0 0 1 0 0 2
152 1 1 1 72 1 1 99 5 0 0 0 0 1 0 3
152 3 3 1 39 1 1 99 5 0 0 0 0 1 0 3
152 2 2 2 69 1 1 99 5 0 0 0 0 1 0 3
153 1 1 1 28 1 6 49 2 0 1 0 0 0 0 2
153 2 2 2 27 1 6 49 2 0 1 0 0 0 0 2
155 1 1 2 54 1 6 27 5 0 0 0 0 1 0 1
155 2 3 2 29 1 6 27 5 0 0 0 0 1 0 1
156 1 1 1 48 1 1 76 3 0 0 1 0 0 0 3
156 3 3 1 17 1 1 76 3 0 0 1 0 0 0 3
156 2 2 2 43 1 1 76 3 0 0 1 0 0 0 3
158 1 1 1 52 1 4 50 5 0 0 0 0 1 0 2
158 3 3 1 23 1 4 50 5 0 0 0 0 1 0 2
158 2 2 2 47 1 4 50 5 0 0 0 0 1 0 2
158 4 3 2 20 1 4 50 5 0 0 0 0 1 0 2
159 1 1 1 54 1 6 40 5 0 0 0 0 1 0 2
159 3 3 1 30 1 6 40 5 0 0 0 0 1 0 2
159 2 2 2 51 1 6 40 5 0 0 0 0 1 0 2
159 4 3 2 28 1 6 40 5 0 0 0 0 1 0 2
160 1 1 1 35 1 4 36 2 0 1 0 0 0 0 2
160 2 2 2 34 1 4 36 2 0 1 0 0 0 0 2
162 1 1 1 74 1 1 76 6 0 0 0 0 0 1 3
162 2 2 2 74 1 1 76 6 0 0 0 0 0 1 3
163 3 3 1 16 1 4 40 4 0 0 0 1 0 0 2
163 1 1 2 44 1 4 40 4 0 0 0 1 0 0 2
163 2 3 2 20 1 4 40 4 0 0 0 1 0 0 2
165 1 1 1 72 2 1 114 6 0 0 0 0 0 1 4
165 2 2 2 69 2 1 114 6 0 0 0 0 0 1 4
166 1 1 1 59 2 4 114 5 0 0 0 0 1 0 4
166 3 3 1 26 2 4 114 5 0 0 0 0 1 0 4
166 2 2 2 54 2 4 114 5 0 0 0 0 1 0 4
166 4 3 2 28 2 4 114 5 0 0 0 0 1 0 4
168 1 1 1 55 2 1 114 5 0 0 0 0 1 0 4
168 3 3 1 28 2 1 114 5 0 0 0 0 1 0 4
168 2 2 2 49 2 1 114 5 0 0 0 0 1 0 4
168 4 3 2 26 2 1 114 5 0 0 0 0 1 0 4
171 1 1 1 57 2 1 114 5 0 0 0 0 1 0 4
171 3 3 1 26 2 1 114 5 0 0 0 0 1 0 4
171 2 2 2 50 2 1 114 5 0 0 0 0 1 0 4
172 1 1 1 58 2 1 114 5 0 0 0 0 1 0 4
172 3 3 1 22 2 1 114 5 0 0 0 0 1 0 4
172 4 3 1 25 2 1 114 5 0 0 0 0 1 0 4
172 2 2 2 53 2 1 114 5 0 0 0 0 1 0 4
172 5 3 2 27 2 1 114 5 0 0 0 0 1 0 4
173 1 1 1 45 3 4 59 3 0 0 1 0 0 0 2
173 3 3 1 12 3 4 59 3 0 0 1 0 0 0 2
173 2 2 2 33 3 4 59 3 0 0 1 0 0 0 2
174 1 1 2 80 3 1 59 6 0 0 0 0 0 1 2
175 1 1 1 71 3 1 59 5 0 0 0 0 1 0 2
175 2 2 2 67 3 1 59 5 0 0 0 0 1 0 2
175 3 3 2 28 3 1 59 5 0 0 0 0 1 0 2
176 1 1 1 55 3 1 59 4 0 0 0 1 0 0 2
176 3 3 1 25 3 1 59 4 0 0 0 1 0 0 2
176 2 2 2 50 3 1 59 4 0 0 0 1 0 0 2
176 4 3 2 17 3 1 59 4 0 0 0 1 0 0 2
178 2 2 1 60 3 1 59 5 0 0 0 0 1 0 2
178 3 3 1 26 3 1 59 5 0 0 0 0 1 0 2
178 4 3 1 23 3 1 59 5 0 0 0 0 1 0 2
178 1 1 2 50 3 1 59 5 0 0 0 0 1 0 2
179 1 1 1 52 3 1 59 4 0 0 0 1 0 0 2
179 3 3 1 18 3 1 59 4 0 0 0 1 0 0 2
179 2 2 2 43 3 1 59 4 0 0 0 1 0 0 2
179 4 3 2 17 3 1 59 4 0 0 0 1 0 0 2
180 1 1 1 60 3 1 59 5 0 0 0 0 1 0 2
180 3 3 1 27 3 1 59 5 0 0 0 0 1 0 2
180 2 2 2 60 3 1 59 5 0 0 0 0 1 0 2
182 1 1 2 47 4 1 53 3 0 0 1 0 0 0 2
182 2 3 2 10 4 1 53 3 0 0 1 0 0 0 2
184 1 1 1 36 4 4 59 2 0 1 0 0 0 0 2
184 2 2 2 38 4 4 59 2 0 1 0 0 0 0 2
185 1 1 1 43 4 1 59 3 0 0 1 0 0 0 2
185 3 3 1 15 4 1 59 3 0 0 1 0 0 0 2
185 4 3 1 11 4 1 59 3 0 0 1 0 0 0 2
185 2 2 2 41 4 1 59 3 0 0 1 0 0 0 2
186 1 1 1 36 4 1 50 2 0 1 0 0 0 0 2
186 2 2 2 32 4 1 50 2 0 1 0 0 0 0 2
186 5 3 2 10 4 1 50 2 0 1 0 0 0 0 2
187 1 1 2 55 4 1 53 5 0 0 0 0 1 0 2
187 2 3 2 25 4 1 53 5 0 0 0 0 1 0 2
187 3 3 2 27 4 1 53 5 0 0 0 0 1 0 2
188 1 1 1 67 4 1 53 6 0 0 0 0 0 1 2
188 2 2 2 64 4 1 53 6 0 0 0 0 0 1 2
189 1 1 1 69 4 1 50 5 0 0 0 0 1 0 2
189 3 3 1 34 4 1 50 5 0 0 0 0 1 0 2
189 2 2 2 57 4 1 50 5 0 0 0 0 1 0 2
190 1 1 1 62 4 1 50 5 0 0 0 0 1 0 2
190 3 3 1 27 4 1 50 5 0 0 0 0 1 0 2
190 2 2 2 55 4 1 50 5 0 0 0 0 1 0 2
191 1 1 1 38 3 1 54 2 0 1 0 0 0 0 2
191 2 2 2 36 3 1 54 2 0 1 0 0 0 0 2
192 1 1 2 69 3 4 54 6 0 0 0 0 0 1 2
193 1 1 1 58 3 4 54 5 0 0 0 0 1 0 2
193 3 3 1 27 3 4 54 5 0 0 0 0 1 0 2
193 4 3 1 24 3 4 54 5 0 0 0 0 1 0 2
193 2 2 2 50 3 4 54 5 0 0 0 0 1 0 2
194 1 1 1 77 3 1 54 6 0 0 0 0 0 1 2
194 2 2 2 77 3 1 54 6 0 0 0 0 0 1 2
196 1 1 1 63 4 1 73 5 0 0 0 0 1 0 3
196 3 3 1 37 4 1 73 5 0 0 0 0 1 0 3
196 4 3 1 33 4 1 73 5 0 0 0 0 1 0 3
196 2 2 2 62 4 1 73 5 0 0 0 0 1 0 3
197 1 1 1 66 4 1 73 6 0 0 0 0 0 1 3
197 2 2 2 59 4 1 73 6 0 0 0 0 0 1 3
198 1 1 1 52 4 1 73 3 0 0 1 0 0 0 3
198 3 3 1 13 4 1 73 3 0 0 1 0 0 0 3
198 2 2 2 47 4 1 73 3 0 0 1 0 0 0 3
198 4 3 2 12 4 1 73 3 0 0 1 0 0 0 3
199 1 1 1 43 4 4 73 3 0 0 1 0 0 0 3
199 2 2 2 41 4 4 73 3 0 0 1 0 0 0 3
199 3 3 2 11 4 4 73 3 0 0 1 0 0 0 3
200 2 3 1 26 4 1 73 5 0 0 0 0 1 0 3
200 3 3 1 28 4 1 73 5 0 0 0 0 1 0 3
200 1 1 2 53 4 1 73 5 0 0 0 0 1 0 3
201 1 1 1 53 4 1 73 5 0 0 0 0 1 0 3
201 3 3 1 27 4 1 73 5 0 0 0 0 1 0 3
201 2 2 2 50 4 1 73 5 0 0 0 0 1 0 3
202 1 1 1 77 4 1 73 5 0 0 0 0 1 0 3
202 3 3 1 35 4 1 73 5 0 0 0 0 1 0 3
202 2 2 2 60 4 1 73 5 0 0 0 0 1 0 3
204 1 1 1 56 4 1 53 5 0 0 0 0 1 0 2
204 2 2 2 53 4 1 53 5 0 0 0 0 1 0 2
204 3 3 2 22 4 1 53 5 0 0 0 0 1 0 2
205 1 1 1 60 4 4 66 5 0 0 0 0 1 0 2
205 3 3 1 29 4 4 66 5 0 0 0 0 1 0 2
205 4 3 1 27 4 4 66 5 0 0 0 0 1 0 2
205 2 2 2 56 4 4 66 5 0 0 0 0 1 0 2
206 1 1 1 67 4 1 76 6 0 0 0 0 0 1 3
206 2 2 2 67 4 1 76 6 0 0 0 0 0 1 3
208 1 1 1 46 4 1 66 4 0 0 0 1 0 0 2
208 4 3 1 14 4 1 66 4 0 0 0 1 0 0 2
208 2 2 2 45 4 1 66 4 0 0 0 1 0 0 2
208 3 3 2 17 4 1 66 4 0 0 0 1 0 0 2
209 1 1 1 42 4 4 56 2 0 1 0 0 0 0 2
209 3 3 1 10 4 4 56 2 0 1 0 0 0 0 2
209 2 2 2 38 4 4 56 2 0 1 0 0 0 0 2
210 3 3 1 12 4 1 56 3 0 0 1 0 0 0 2
210 1 1 2 40 4 1 56 3 0 0 1 0 0 0 2
210 2 3 2 10 4 1 56 3 0 0 1 0 0 0 2
212 1 1 2 37 1 4 63 2 0 1 0 0 0 0 2
214 1 1 1 63 3 1 40 6 0 0 0 0 0 1 2
215 1 1 1 62 3 1 40 5 0 0 0 0 1 0 2
215 3 3 1 28 3 1 40 5 0 0 0 0 1 0 2
215 2 2 2 57 3 1 40 5 0 0 0 0 1 0 2
216 1 1 2 71 3 1 40 6 0 0 0 0 0 1 2
217 1 1 2 49 4 1 40 5 0 0 0 0 1 0 2
217 2 3 2 24 4 1 40 5 0 0 0 0 1 0 2
218 1 1 1 74 1 1 37 6 0 0 0 0 0 1 2
218 2 2 2 67 1 1 37 6 0 0 0 0 0 1 2
220 1 1 1 51 4 4 66 4 0 0 0 1 0 0 2
220 4 3 1 13 4 4 66 4 0 0 0 1 0 0 2
220 5 3 1 18 4 4 66 4 0 0 0 1 0 0 2
220 2 2 2 49 4 4 66 4 0 0 0 1 0 0 2
220 3 3 2 16 4 4 66 4 0 0 0 1 0 0 2
221 1 1 2 81 1 6 40 6 0 0 0 0 0 1 2
222 1 1 1 45 2 1 85 3 0 0 1 0 0 0 3
222 4 3 1 10 2 1 85 3 0 0 1 0 0 0 3
222 2 2 2 41 2 1 85 3 0 0 1 0 0 0 3
222 3 3 2 15 2 1 85 3 0 0 1 0 0 0 3
223 1 1 2 51 2 1 85 5 0 0 0 0 1 0 3
223 2 3 2 25 2 1 85 5 0 0 0 0 1 0 3
224 2 3 1 12 2 4 85 4 0 0 0 1 0 0 3
224 1 1 2 47 2 4 85 4 0 0 0 1 0 0 3
224 3 3 2 18 2 4 85 4 0 0 0 1 0 0 3
225 1 1 1 68 2 1 85 6 0 0 0 0 0 1 3
225 2 2 2 67 2 1 85 6 0 0 0 0 0 1 3
226 1 1 1 50 2 1 85 4 0 0 0 1 0 0 3
226 4 3 1 17 2 1 85 4 0 0 0 1 0 0 3
226 2 2 2 46 2 1 85 4 0 0 0 1 0 0 3
226 3 3 2 19 2 1 85 4 0 0 0 1 0 0 3
229 2 2 1 67 2 1 85 5 0 0 0 0 1 0 3
229 1 1 2 57 2 1 85 5 0 0 0 0 1 0 3
229 3 3 2 37 2 1 85 5 0 0 0 0 1 0 3
232 1 1 1 54 2 1 86 5 0 0 0 0 1 0 3
232 2 2 2 53 2 1 86 5 0 0 0 0 1 0 3
232 3 3 2 29 2 1 86 5 0 0 0 0 1 0 3
233 1 1 1 57 2 1 86 5 0 0 0 0 1 0 3
233 2 2 2 52 2 1 86 5 0 0 0 0 1 0 3
233 3 3 2 24 2 1 86 5 0 0 0 0 1 0 3
235 1 1 2 51 2 1 86 3 0 0 1 0 0 0 3
236 1 1 1 41 2 4 86 2 0 1 0 0 0 0 3
236 5 3 1 12 2 4 86 2 0 1 0 0 0 0 3
236 2 2 2 39 2 4 86 2 0 1 0 0 0 0 3
236 3 3 2 10 2 4 86 2 0 1 0 0 0 0 3
237 1 1 1 48 2 1 86 4 0 0 0 1 0 0 3
237 2 2 2 48 2 1 86 4 0 0 0 1 0 0 3
237 3 3 2 20 2 1 86 4 0 0 0 1 0 0 3
237 4 3 2 16 2 1 86 4 0 0 0 1 0 0 3
238 1 1 2 53 4 1 50 5 0 0 0 0 1 0 2
238 2 3 2 29 4 1 50 5 0 0 0 0 1 0 2
240 2 3 1 31 4 1 50 5 0 0 0 0 1 0 2
240 1 1 2 61 4 1 50 5 0 0 0 0 1 0 2
241 2 3 1 24 4 1 50 5 0 0 0 0 1 0 2
241 1 1 2 51 4 1 50 5 0 0 0 0 1 0 2
242 1 1 1 39 4 6 50 3 0 0 1 0 0 0 2
242 3 3 1 11 4 6 50 3 0 0 1 0 0 0 2
242 2 2 2 38 4 6 50 3 0 0 1 0 0 0 2
245 1 1 1 48 4 1 50 4 0 0 0 1 0 0 2
245 3 3 1 17 4 1 50 4 0 0 0 1 0 0 2
245 2 2 2 42 4 1 50 4 0 0 0 1 0 0 2
246 1 1 1 58 5 4 50 5 0 0 0 0 1 0 2
246 2 2 2 50 5 4 50 5 0 0 0 0 1 0 2
246 3 3 2 26 5 4 50 5 0 0 0 0 1 0 2
247 2 2 1 43 4 1 46 3 0 0 1 0 0 0 2
247 1 1 2 41 4 1 46 3 0 0 1 0 0 0 2
247 3 3 2 11 4 1 46 3 0 0 1 0 0 0 2
248 1 1 1 40 4 1 70 1 1 0 0 0 0 0 3
248 2 2 2 32 4 1 70 1 1 0 0 0 0 0 3
249 1 1 1 43 4 1 64 4 0 0 0 1 0 0 2
249 3 3 1 16 4 1 64 4 0 0 0 1 0 0 2
249 2 2 2 41 4 1 64 4 0 0 0 1 0 0 2
249 4 3 2 15 4 1 64 4 0 0 0 1 0 0 2
250 2 2 1 32 4 1 54 1 1 0 0 0 0 0 2
250 1 1 2 30 4 1 54 1 1 0 0 0 0 0 2
251 1 1 1 65 1 1 132 6 0 0 0 0 0 1 4
251 2 2 2 62 1 1 132 6 0 0 0 0 0 1 4
254 1 1 1 37 2 4 85 2 0 1 0 0 0 0 3
254 2 2 2 37 2 4 85 2 0 1 0 0 0 0 3
256 1 1 1 50 2 1 85 4 0 0 0 1 0 0 3
256 2 2 2 47 2 1 85 4 0 0 0 1 0 0 3
256 3 3 2 16 2 1 85 4 0 0 0 1 0 0 3
256 4 3 2 14 2 1 85 4 0 0 0 1 0 0 3
257 1 1 1 46 2 4 85 4 0 0 0 1 0 0 3
257 4 3 1 16 2 4 85 4 0 0 0 1 0 0 3
257 2 2 2 44 2 4 85 4 0 0 0 1 0 0 3
257 3 3 2 19 2 4 85 4 0 0 0 1 0 0 3
259 1 1 1 55 2 1 85 5 0 0 0 0 1 0 3
259 2 2 2 53 2 1 85 5 0 0 0 0 1 0 3
259 3 3 2 31 2 1 85 5 0 0 0 0 1 0 3
261 1 1 1 65 2 1 145 6 0 0 0 0 0 1 5
261 2 2 2 62 2 1 145 6 0 0 0 0 0 1 5
262 1 1 1 44 3 1 56 4 0 0 0 1 0 0 2
262 3 3 1 19 3 1 56 4 0 0 0 1 0 0 2
262 2 2 2 42 3 1 56 4 0 0 0 1 0 0 2
262 4 3 2 15 3 1 56 4 0 0 0 1 0 0 2
263 1 1 1 49 3 1 54 5 0 0 0 0 1 0 2
263 4 3 1 22 3 1 54 5 0 0 0 0 1 0 2
263 2 2 2 47 3 1 54 5 0 0 0 0 1 0 2
263 3 3 2 19 3 1 54 5 0 0 0 0 1 0 2
266 1 1 1 54 3 1 56 5 0 0 0 0 1 0 2
266 3 3 1 29 3 1 56 5 0 0 0 0 1 0 2
266 2 2 2 49 3 1 56 5 0 0 0 0 1 0 2
267 1 1 2 63 3 1 42 6 0 0 0 0 0 1 2
268 1 1 1 45 3 1 43 3 0 0 1 0 0 0 2
268 3 3 1 11 3 1 43 3 0 0 1 0 0 0 2
268 2 2 2 36 3 1 43 3 0 0 1 0 0 0 2
268 5 3 2 12 3 1 43 3 0 0 1 0 0 0 2
269 1 1 1 45 3 1 47 3 0 0 1 0 0 0 2
269 2 2 2 42 3 1 47 3 0 0 1 0 0 0 2
269 3 3 2 11 3 1 47 3 0 0 1 0 0 0 2
270 1 1 1 34 2 4 59 2 0 1 0 0 0 0 2
270 2 2 2 34 2 4 59 2 0 1 0 0 0 0 2
271 2 2 1 60 2 1 59 5 0 0 0 0 1 0 2
271 3 3 1 34 2 1 59 5 0 0 0 0 1 0 2
271 1 1 2 57 2 1 59 5 0 0 0 0 1 0 2
272 1 1 1 35 2 1 59 2 0 1 0 0 0 0 2
272 2 2 2 35 2 1 59 2 0 1 0 0 0 0 2
273 1 1 1 35 2 1 59 2 0 1 0 0 0 0 2
273 2 2 2 39 2 1 59 2 0 1 0 0 0 0 2
275 1 1 1 33 2 1 59 2 0 1 0 0 0 0 2
275 2 2 2 29 2 1 59 2 0 1 0 0 0 0 2
276 1 1 1 30 2 4 59 1 1 0 0 0 0 0 2
277 1 1 1 47 2 1 59 4 0 0 0 1 0 0 2
277 2 2 2 48 2 1 59 4 0 0 0 1 0 0 2
277 3 3 2 17 2 1 59 4 0 0 0 1 0 0 2
277 4 3 2 15 2 1 59 4 0 0 0 1 0 0 2
278 1 1 1 78 2 1 84 6 0 0 0 0 0 1 3
278 2 2 2 79 2 1 84 6 0 0 0 0 0 1 3
280 1 1 1 56 2 1 84 5 0 0 0 0 1 0 3
280 2 2 2 53 2 1 84 5 0 0 0 0 1 0 3
280 3 3 2 27 2 1 84 5 0 0 0 0 1 0 3
281 1 1 1 50 2 1 84 4 0 0 0 1 0 0 3
281 4 3 1 17 2 1 84 4 0 0 0 1 0 0 3
281 2 2 2 45 2 1 84 4 0 0 0 1 0 0 3
281 3 3 2 22 2 1 84 4 0 0 0 1 0 0 3
283 1 1 1 51 2 1 84 5 0 0 0 0 1 0 3
283 4 3 1 25 2 1 84 5 0 0 0 0 1 0 3
283 2 2 2 49 2 1 84 5 0 0 0 0 1 0 3
283 3 3 2 27 2 1 84 5 0 0 0 0 1 0 3
285 1 1 1 48 2 1 122 3 0 0 1 0 0 0 4
285 5 3 1 17 2 1 122 3 0 0 1 0 0 0 4
285 2 2 2 41 2 1 122 3 0 0 1 0 0 0 4
285 3 3 2 15 2 1 122 3 0 0 1 0 0 0 4
286 1 1 1 57 2 1 122 5 0 0 0 0 1 0 4
286 4 3 1 25 2 1 122 5 0 0 0 0 1 0 4
286 2 2 2 51 2 1 122 5 0 0 0 0 1 0 4
286 3 3 2 29 2 1 122 5 0 0 0 0 1 0 4
287 1 1 1 43 2 1 122 2 0 1 0 0 0 0 4
287 2 2 2 40 2 1 122 2 0 1 0 0 0 0 4
287 3 3 2 12 2 1 122 2 0 1 0 0 0 0 4
290 1 1 1 46 2 1 102 3 0 0 1 0 0 0 4
290 4 3 1 10 2 1 102 3 0 0 1 0 0 0 4
290 2 2 2 42 2 1 102 3 0 0 1 0 0 0 4
290 3 3 2 15 2 1 102 3 0 0 1 0 0 0 4
291 1 1 1 30 2 4 102 2 0 1 0 0 0 0 4
291 2 2 2 26 2 4 102 2 0 1 0 0 0 0 4
292 1 1 2 61 1 1 59 6 0 0 0 0 0 1 2
295 1 1 1 47 1 4 43 3 0 0 1 0 0 0 2
295 3 3 1 11 1 4 43 3 0 0 1 0 0 0 2
295 2 2 2 43 1 4 43 3 0 0 1 0 0 0 2
297 1 1 1 43 1 4 43 2 0 1 0 0 0 0 2
297 2 2 2 46 1 4 43 2 0 1 0 0 0 0 2
298 1 1 1 40 1 4 56 2 0 1 0 0 0 0 2
298 2 2 2 37 1 4 56 2 0 1 0 0 0 0 2
299 2 3 1 24 1 4 50 5 0 0 0 0 1 0 2
299 1 1 2 60 1 4 50 5 0 0 0 0 1 0 2
300 1 1 1 46 4 4 83 4 0 0 0 1 0 0 3
300 2 2 2 43 4 4 83 4 0 0 0 1 0 0 3
300 3 3 2 13 4 4 83 4 0 0 0 1 0 0 3
My understanding is that R is implemented as copy-on-write.
Take for instance:
X <- 1:1000
y <- x # no copy made. x & y share the reference
y[1] <- 8 # now a copy is made.
If x is growing, the copies take longer and longer, and the script slows down.
I'm not that familiar with macro variables, but I suspect something like this is happening.
If you're working with a list, every time you add a new element to the list, every thing is recopied.
y <- list()
y$this <- 1:5
y$that <- 6:10 # now every thing was recopied.
Therefore it's better to allocate first. It really helps the performance.
y <- vector("list", 2)
y[[1]] <- 1:5
y[[2]] <- 6:10
These slides are really good: a link take a look!
Related
I am getting some strange behavior on sort utility on Ubuntu 18.04.2. Here's some sequence of commands issued. How can I ensure numeric sort for all the columns? column 1, 2, 3, 4 should be in order.
$ cat zz
0 0 0 0
0 1 0 0
1 0 0 0
1 1 0 0
1 1 1 0
1 1 1 1
2 2 2 2
10 10 10 10
1 1 10 1
1 1 100 1
$ cat zz | sort
0 0 0 0
0 1 0 0
1 0 0 0
10 10 10 10
1 1 0 0
1 1 1 0
1 1 100 1
1 1 10 1
1 1 1 1
2 2 2 2
$ cat zz | sort -n
0 0 0 0
0 1 0 0
1 0 0 0
1 1 0 0
1 1 1 0
1 1 100 1
1 1 10 1
1 1 1 1
2 2 2 2
10 10 10 10
$ cat zz | sort -n -k1,3
0 0 0 0
0 1 0 0
1 0 0 0
1 1 0 0
1 1 1 0
1 1 100 1
1 1 10 1
1 1 1 1
2 2 2 2
10 10 10 10
Desired output (with numeric sorting):
0 0 0 0
0 1 0 0
1 0 0 0
1 1 0 0
1 1 1 0
1 1 1 1
1 1 10 1
1 1 100 1
2 2 2 2
10 10 10 10
What options should I use in sort to get my desired output i.e. sorted in numeric order
This question already has answers here:
bash: shortest way to get n-th column of output
(8 answers)
Closed 4 years ago.
I would like to extract column number 8 from the following table using shell (ash):
0xd024 2 0 32 20 3 0 1 0 2 1384 1692 -61 27694088
0xd028 0 1 5 11 1 0 46 0 0 301 187 -74 27689154
0xd02c 0 0 35 14 1 0 21 0 0 257 250 -80 27689410
0xd030 1 1 15 13 1 0 38 0 0 176 106 -91 27689666
0xd034 1 1 50 20 1 0 8 0 0 790 283 -71 27689980
0xd038 0 0 0 3 4 0 89 0 0 1633 390 -90 27690291
0xd03c 0 0 8 3 3 0 82 0 0 1837 184 -95 27690603
0xd040 0 0 4 5 1 0 90 0 0 0 148 -97 27690915
0xd064 0 0 36 9 1 0 29 0 0 321 111 -74 27691227
0xd068 0 0 5 14 14 0 40 0 0 8066 2270 -85 27691539
0xd06c 1 1 39 19 1 0 15 0 0 1342 261 -74 27691850
0xd070 0 0 12 11 1 0 53 0 0 203 174 -73 27692162
0xd074 0 0 18 2 1 0 75 0 0 301 277 -94 27692474
How can I do that?
the following command "awk '{print $8}' file" works fine
I have a matrix. I want to know it whether sparse or not. Is there any function in matlab to evaluate that property? I tried to used issparse function, but it always returns 0(not sparse). For example, my matrix (27 by 27) is
A=
[ 1 0 0 0 0 1 1 1 0 0 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0
1 1 0 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0
1 1 1 0 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0
0 1 1 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 0 0
0 0 1 1 1 0 0 1 0 1 0 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 0
0 0 0 1 1 1 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0
0 0 0 0 1 1 1 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 0 0
250 243 247 245 244 244 244 122 61 144 72 36 18 9 4 2 1 1 0 0 0 0 0 0 0 0 0
151 197 236 118 181 212 106 53 26 13 136 68 34 17 8 4 2 0 1 0 0 0 0 0 0 0 0
24 12 6 3 143 201 234 117 180 90 45 152 76 38 19 9 4 0 0 1 0 0 0 0 0 0 0
18 9 138 69 172 86 165 220 224 112 56 28 128 64 32 16 8 0 0 0 1 0 0 0 0 0 0
27 131 207 103 189 94 47 153 194 239 119 59 29 128 64 32 16 0 0 0 0 1 0 0 0 0 0
44 22 133 204 232 116 58 147 199 237 248 124 62 31 129 64 32 0 0 0 0 0 1 0 0 0 0
238 119 181 90 45 152 76 38 19 135 205 232 116 58 29 128 64 0 0 0 0 0 0 1 0 0 0
48 24 12 6 3 143 201 100 50 25 130 207 233 116 58 29 128 0 0 0 0 0 0 0 1 0 0
168 84 42 21 132 66 33 158 79 39 19 135 205 232 116 58 29 0 0 0 0 0 0 0 0 1 0
235 117 58 29 128 64 32 16 8 4 2 1 142 201 234 117 58 0 0 0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0
0 1 1 0 0 0 0 1 1 0 0 0 1 1 1 0 0 0 0 0 1 1 0 0 0 0 0
1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 0 0 0 0 0 0 0 0
0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 1 0
0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 1
0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0
0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0 1
0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 1 0 0 0 0
0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 1 0
0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 1 0 0 0 0 1 1 0 0 0 0]
This is figure for above matrix
This seemingly easy question is quite difficult to answer. There is actually no known standard that determines whether a matrix is sparse or full.
However, the most common measure I know is to measure a matrix's sparsity. This is simply the fraction of the total number of zeroes over the total number of elements. If this exceeds some sensible threshold, then you could say that the matrix is sparse.
If you're given the matrix A, perhaps something like this:
sparsity = (numel(A) - nnz(A)) / numel(A);
numel determines the total number of elements in the matrix A and nnz determines the total number of non-zero elements. Therefore, numel(A) - nnz(A) should give you the total number of zero elements.
So, going with the threshold idea, this is what I was talking about:
is_sparse = sparsity > tol;
tol would be a fraction from [0,1], so something like 0.75 could work. This would mean that if 75% of your matrix consisted of zeroes, this could be a sparse matrix. It's all heuristic though. Choose a threshold that you think makes the most sense.
I have a question in sort of connected component. I have a binary image ( onlye 0 and 1) I run the function from matlab:
f=
1 0 0 1 0 0 0 1 0 0
1 1 0 1 1 1 0 0 1 0
0 0 0 0 0 0 0 1 1 1
1 0 0 0 1 0 1 0 1 1
1 1 0 0 0 0 0 1 1 1
0 0 0 1 0 0 1 0 0 0
0 0 0 1 0 1 1 0 1 1
1 1 0 0 1 0 0 0 1 0
1 1 0 1 1 1 0 1 0 0
1 1 0 0 1 0 0 0 1 0
[L num]=bwlabel(f);
suppose that they give me the ma trix:
1 0 0 4 0 0 0 5 0 0
1 1 0 4 4 4 0 0 5 0
0 0 0 0 0 0 0 5 5 5
2 0 0 0 6 0 5 0 5 5
2 2 0 0 0 0 0 5 5 5
0 0 0 5 0 0 5 0 0 0
0 0 0 5 0 5 5 0 7 7
3 3 0 0 5 0 0 0 7 0
3 3 0 5 5 5 0 7 0 0
3 3 0 0 5 0 0 0 7 0
But you can see in this resul, the order of matrix is follow the column. Now I want to change this in to the oder rows, that mean number 4 is 2 , number 5 is 3... so on.
The oder is left-> right and top -> down. How can I do that ( the oder of reading )??
Thank you so much
f=f';
[L num]=bwlabel(f);
L=L';
does this solves your problem?
Not sure if there is any name for this algorithm I'm currently developing - "growing neighbourhood algorithm" sounds like an appropriate name. So what is my problem about?
I would like to draw a stroke around an alpha transparent image to outline it. The size of the stroke should be user-definable.
I have an array which is filled by zeros and ones, consider each item of the array as a cell like in Game of Life. An item with 0 is empty (transparent pixel), an item with 1 is a first generation cell (non transparent pixel), the number of generations is defined by the size of the surrounding stroke.
This example depicts an rectangle surrounded by alpha values:
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 1 1 1 1 0 0 0
0 0 0 1 1 1 1 0 0 0
0 0 0 1 1 1 1 0 0 0
0 0 0 1 1 1 1 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
Then I would like to let the ones grow a new generation by surrounding every 0-generation Moore neighbour. It's the second generation (stroke with 1px) - thus the array looks after growing as follows:
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 2 2 2 2 2 2 0 0
0 0 2 1 1 1 1 2 0 0
0 0 2 1 1 1 1 2 0 0
0 0 2 1 1 1 1 2 0 0
0 0 2 1 1 1 1 2 0 0
0 0 2 2 2 2 2 2 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
3rd and 4th generation (stroke with 3px):
4 4 4 4 4 4 4 4 4 4
4 3 3 3 3 3 3 3 3 4
4 3 2 2 2 2 2 2 3 4
4 3 2 1 1 1 1 2 3 4
4 3 2 1 1 1 1 2 3 4
4 3 2 1 1 1 1 2 3 4
4 3 2 1 1 1 1 2 3 4
4 3 2 2 2 2 2 2 3 4
4 3 3 3 3 3 3 3 3 4
4 4 4 4 4 4 4 4 4 4
So far so good. I'm achieving this simple task by the following code snippet:
for (int gen = 1; gen <= 4; gen++)
{
for (int x = 1; x < arrayWidth - 1; x++)
{
for (int y = 1; y < arrayHeight - 1; y++)
{
// See if this cell is in the current generation.
if (_generation[x + arrayWidth * y] == gen)
{
// Generate next generation.
for (int i = x - 1; i <= x + 1; i++)
{
for (int j = y - 1; j <= y + 1; j++)
{
if (_generation[i + arrayWidth * j] == 0 || _generation[i + arrayWidth * j] > gen)
{
_generation[i + arrayWidth * j] = gen + 1;
}
}
}
}
}
}
}
This approach works perfectly for simple shapes like a rectangle for example. But how can I do this for an ellipse? As soon as we have kind of a stair pattern in the cells, I'm getting messy results:
0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1 1 1 1 0 0 0 0 0
0 0 0 0 1 1 1 1 1 1 0 0 0 0
0 0 0 1 1 1 1 1 1 1 1 0 0 0
0 0 1 1 1 1 1 1 1 1 1 1 0 0
0 0 1 1 1 1 1 1 1 1 1 1 0 0
0 0 1 1 1 1 1 1 1 1 1 1 0 0
0 0 1 1 1 1 1 1 1 1 1 1 0 0
0 0 1 1 1 1 1 1 1 1 1 1 0 0
0 0 0 1 1 1 1 1 1 1 1 0 0 0
0 0 0 0 1 1 1 1 1 1 0 0 0 0
0 0 0 0 0 1 1 1 1 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 2 2 2 2 2 2 0 0 0 0
0 0 0 2 2 1 1 1 1 2 2 0 0 0
0 0 2 2 1 1 1 1 1 1 2 2 0 0
0 2 2 1 1 1 1 1 1 1 1 2 2 0
0 2 1 1 1 1 1 1 1 1 1 1 2 0
0 2 1 1 1 1 1 1 1 1 1 1 2 0
0 2 1 1 1 1 1 1 1 1 1 1 2 0
0 2 1 1 1 1 1 1 1 1 1 1 2 0
0 2 1 1 1 1 1 1 1 1 1 1 2 0
0 2 2 1 1 1 1 1 1 1 1 2 0 0
0 0 2 2 1 1 1 1 1 1 2 2 0 0
0 0 0 2 2 1 1 1 1 2 2 0 0 0
0 0 0 0 2 2 2 2 2 2 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 3 3 3 3 3 3 3 3 0 0 0
0 0 3 3 2 2 2 2 2 2 3 3 0 0
0 3 3 2 2 1 1 1 1 2 2 3 3 0
3 3 2 2 1 1 1 1 1 1 2 2 3 3
3 2 2 1 1 1 1 1 1 1 1 2 2 3
3 2 1 1 1 1 1 1 1 1 1 1 2 3
3 2 1 1 1 1 1 1 1 1 1 1 2 3
3 2 1 1 1 1 1 1 1 1 1 1 2 3
3 2 1 1 1 1 1 1 1 1 1 1 2 3
3 2 1 1 1 1 1 1 1 1 1 1 2 3
3 2 2 1 1 1 1 1 1 1 1 2 2 3
3 3 2 2 1 1 1 1 1 1 2 2 3 3
0 3 3 2 2 1 1 1 1 2 2 3 3 0
0 0 3 3 2 2 2 2 2 2 3 3 0 0
0 0 0 3 3 3 3 3 3 3 3 0 0 0
When applying this algorithm to an ellipse, the outline looks kinda weird because of this problem (left: algorithm result, right: requested result):
The problem here is that I do not want have those 2 2 and 3 3 duplicate blocks which occur every time I have this "stair" pattern:
1 0 0 0 0 0 0 1
0 1 0 0 0 0 1 0
0 0 1 0 0 1 0 0
0 0 0 1 1 0 0 0
I want the above 2nd and 3rd generation calculations look like this:
0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 2 2 2 2 0 0 0 0 0
0 0 0 0 2 1 1 1 1 2 0 0 0 0
0 0 0 2 1 1 1 1 1 1 2 0 0 0
0 0 2 1 1 1 1 1 1 1 1 2 0 0
0 2 1 1 1 1 1 1 1 1 1 1 2 0
0 2 1 1 1 1 1 1 1 1 1 1 2 0
0 2 1 1 1 1 1 1 1 1 1 1 2 0
0 2 1 1 1 1 1 1 1 1 1 1 2 0
0 2 1 1 1 1 1 1 1 1 1 1 2 0
0 0 2 1 1 1 1 1 1 1 1 2 0 0
0 0 0 2 1 1 1 1 1 1 2 0 0 0
0 0 0 0 2 1 1 1 1 2 0 0 0 0
0 0 0 0 0 2 2 2 2 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 3 3 3 3 0 0 0 0 0
0 0 0 0 3 2 2 2 2 2 3 0 0 0
0 0 0 3 2 1 1 1 1 2 3 0 0 0
0 0 3 2 1 1 1 1 1 1 2 3 0 0
0 3 2 1 1 1 1 1 1 1 1 2 3 0
3 2 1 1 1 1 1 1 1 1 1 1 2 3
3 2 1 1 1 1 1 1 1 1 1 1 2 3
3 2 1 1 1 1 1 1 1 1 1 1 2 3
3 2 1 1 1 1 1 1 1 1 1 1 2 3
3 2 1 1 1 1 1 1 1 1 1 1 2 3
0 3 2 1 1 1 1 1 1 1 1 2 3 0
0 0 3 2 1 1 1 1 1 1 2 3 0 0
0 0 0 3 2 1 1 1 1 2 3 0 0 0
0 0 0 3 2 2 2 2 2 2 3 0 0 0
0 0 0 0 3 3 3 3 3 3 0 0 0 0
I've tried numerous methods to filter out those duplicate cell blocks, but I can't find an easy and generic solution for solving the problem.
Any ideas how to get stroke/outline like I get from Photoshop or Paint.NET?
Thanks!
Cheers
P
The proper name is dilation, check out morphological operations. You should try dilation with circle element, this will give you the requested result.
Here is a Matlab code that shows how it is done:
im = imcircle(70);
im = padarray(im,[20,20]);
figure;imshow(im);
im2 = imdilate(im,strel('disk',8));
figure;imshow(im2);