提交 | 用户 | 时间
|
a6de49
|
1 |
package com.iailab.module.model.command; |
H |
2 |
|
|
3 |
import com.iailab.module.mcs.dto.StModelDTO; |
|
4 |
import com.iailab.module.model.sample.dto.SampleData; |
|
5 |
import lombok.extern.slf4j.Slf4j; |
|
6 |
import org.springframework.stereotype.Component; |
|
7 |
|
|
8 |
import java.util.List; |
|
9 |
import java.util.Map; |
|
10 |
|
|
11 |
/** |
|
12 |
* @author PanZhibao |
|
13 |
* @Description |
|
14 |
* @createTime 2023年05月17日 11:50:00 |
|
15 |
*/ |
|
16 |
@Slf4j |
|
17 |
@Component |
|
18 |
public class MLCommand { |
|
19 |
|
|
20 |
public Object[] getCommand(StModelDTO stModel, List<Object> params, Map<String, Object> settings, List<SampleData> sampleDataList) { |
|
21 |
|
|
22 |
int portLength = sampleDataList.size(); |
|
23 |
Object[] paramValues = new Object[portLength + 1]; |
|
24 |
for (int i = 0; i < portLength; i++) { |
|
25 |
paramValues[i] = sampleDataList.get(i).getMatrix(); |
|
26 |
} |
|
27 |
paramValues[portLength] = settings; |
|
28 |
return paramValues; |
|
29 |
} |
|
30 |
|
|
31 |
public Object[] getCommand1(StModelDTO stModel, List<Object> params, Map<String, Object> settings, List<double[][]> sampleDataList) { |
|
32 |
|
|
33 |
int portLength = sampleDataList.size(); |
|
34 |
Object[] paramValues = new Object[portLength + 1]; |
|
35 |
for (int i = 0; i < portLength; i++) { |
|
36 |
paramValues[i] = sampleDataList.get(i); |
|
37 |
} |
|
38 |
paramValues[portLength] = settings; |
|
39 |
return paramValues; |
|
40 |
} |
|
41 |
} |