File tree 5 files changed +12
-9
lines changed
5 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -237,8 +237,9 @@ public function predictSample(array $sample) : string
237
237
}
238
238
239
239
$ sampleWithOffset = [];
240
- foreach ($ sample as $ key =>$ value ){
241
- $ sampleWithOffset [$ key +1 ] = $ value ;
240
+
241
+ foreach ($ sample as $ key => $ value ) {
242
+ $ sampleWithOffset [$ key + 1 ] = $ value ;
242
243
}
243
244
244
245
$ index = $ this ->model ->predict ($ sampleWithOffset );
Original file line number Diff line number Diff line change @@ -237,9 +237,11 @@ public function predictSample(array $sample)
237
237
}
238
238
//As SVM needs to have the same keys and order between training samples and those to predict we need to put an offset to the keys
239
239
$ sampleWithOffset = [];
240
- foreach ($ sample as $ key =>$ value ){
241
- $ sampleWithOffset [$ key +1 ] = $ value ;
240
+
241
+ foreach ($ sample as $ key => $ value ) {
242
+ $ sampleWithOffset [$ key + 1 ] = $ value ;
242
243
}
244
+
243
245
return $ this ->model ->predict ($ sampleWithOffset );
244
246
}
245
247
Original file line number Diff line number Diff line change @@ -92,8 +92,8 @@ public function resize(array &$sample) : void
92
92
{
93
93
foreach ($ sample as &$ value ) {
94
94
if (DataType::detect ($ value )->isImage ()) {
95
- $ width = imagesx ($ value ) ?: 0 ;
96
- $ height = imagesy ($ value ) ?: 0 ;
95
+ $ width = imagesx ($ value );
96
+ $ height = imagesy ($ value );
97
97
98
98
if ($ width === $ this ->width and $ height === $ this ->height ) {
99
99
continue ;
Original file line number Diff line number Diff line change @@ -91,8 +91,8 @@ public function fit(Dataset $dataset) : void
91
91
$ value = $ sample [$ column ];
92
92
93
93
$ this ->sizes [$ column ] = [
94
- imagesx ($ value ) ?: 0 ,
95
- imagesy ($ value ) ?: 0 ,
94
+ imagesx ($ value ),
95
+ imagesy ($ value ),
96
96
];
97
97
}
98
98
}
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ class SVRTest extends TestCase
43
43
*
44
44
* @var float
45
45
*/
46
- protected const MIN_SCORE = - INF ;
46
+ protected const MIN_SCORE = 0.9 ;
47
47
48
48
/**
49
49
* Constant used to see the random number generator.
You can’t perform that action at this time.
0 commit comments