|
|
@@ -0,0 +1,436 @@
|
|
|
+# 1. inner
|
|
|
+
|
|
|
+## 1.1 LayerArgument
|
|
|
+
|
|
|
+```java
|
|
|
+public class LayerArgument {
|
|
|
+ @Id
|
|
|
+ private int id;
|
|
|
+ private boolean isDiscrete; //是否为离散值
|
|
|
+ private String value; //参数的默认值
|
|
|
+ private String type; //模型参数取值为Float|Int|...
|
|
|
+ private String valueDes; //取值范围或者离散值则为取值量
|
|
|
+ private String description; //对取值或者参数的说明
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+这个类没有被任何类使用,这合理吗?
|
|
|
+
|
|
|
+## 1.2 ModelArgument
|
|
|
+
|
|
|
+```java
|
|
|
+public class ModelArgument {
|
|
|
+ @Id
|
|
|
+ private int id;
|
|
|
+ private String name;
|
|
|
+ private boolean isDiscrete;
|
|
|
+ private String defaultValue;
|
|
|
+ private String type;
|
|
|
+ private String valueDes;
|
|
|
+ private String description;
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+# 2. Config
|
|
|
+
|
|
|
+```java
|
|
|
+public class Config {
|
|
|
+ @Id
|
|
|
+ private int id;
|
|
|
+
|
|
|
+ private int fileInfoId; //文件id
|
|
|
+
|
|
|
+ private int userId; //用户Id
|
|
|
+
|
|
|
+ private int modelTypeId; //模型类id
|
|
|
+
|
|
|
+ private String confName; //自定义模型名
|
|
|
+
|
|
|
+ private String fieldIds; //选择训练的特征及特征描述
|
|
|
+
|
|
|
+ @Id
|
|
|
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
|
+ public int getId(){
|
|
|
+ return id;
|
|
|
+ }
|
|
|
+ public String getFieldIds(){
|
|
|
+ return fieldIds;
|
|
|
+ }
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+fileInfoId,userId,modelTypeId都是外键。
|
|
|
+
|
|
|
+# 3. DLModel
|
|
|
+
|
|
|
+```java
|
|
|
+public class DLModel {
|
|
|
+ @Id
|
|
|
+ private int id;
|
|
|
+
|
|
|
+ private int modelTypeId; //模型的类别
|
|
|
+
|
|
|
+ private int picFileId; //文件信息id
|
|
|
+
|
|
|
+ private String modelName; //自定义的训练模型名
|
|
|
+
|
|
|
+ private boolean isTrained; //是否进行了训练
|
|
|
+
|
|
|
+ private String modelPath; //具体训练出的model
|
|
|
+
|
|
|
+ private String resOfModel; //模型训练的result
|
|
|
+
|
|
|
+ //模型的具体参数取值
|
|
|
+ private String arguments; //模型的参数列表
|
|
|
+
|
|
|
+ @Id
|
|
|
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
|
+ public int getId(){
|
|
|
+ return id;
|
|
|
+ }
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+modelTypeId,picFileId都是外键。
|
|
|
+
|
|
|
+# 4.FileInfo
|
|
|
+
|
|
|
+```java
|
|
|
+public class FileInfo {
|
|
|
+
|
|
|
+ @Id
|
|
|
+ private int id;
|
|
|
+
|
|
|
+ //.parquet file location
|
|
|
+ private String location;
|
|
|
+ //create time
|
|
|
+ private Date uploadTime;
|
|
|
+ //foreign key which connect to User table
|
|
|
+ private int userId;
|
|
|
+ //filename
|
|
|
+ private String filename;
|
|
|
+ //filename
|
|
|
+ private String folder;
|
|
|
+ //file structure
|
|
|
+ private String fileStrucInfo;
|
|
|
+
|
|
|
+ public FileInfo() {}
|
|
|
+
|
|
|
+ public FileInfo(String location, int userId, String filename) {
|
|
|
+ this.location = location;
|
|
|
+ this.userId = userId;
|
|
|
+ this.filename = filename;
|
|
|
+ this.uploadTime = new Date();
|
|
|
+ }
|
|
|
+ //for the scala use
|
|
|
+ @Id
|
|
|
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
|
+ public int getId() {
|
|
|
+ return id;
|
|
|
+ }
|
|
|
+ public String getLocation() {
|
|
|
+ return location;
|
|
|
+ }
|
|
|
+ public String getFilename() {return filename;}
|
|
|
+ public void setFileStrucInfo(String fileStrucInfo)
|
|
|
+ {
|
|
|
+ this.fileStrucInfo = fileStrucInfo;
|
|
|
+ }
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+userId是外键。
|
|
|
+
|
|
|
+# 5. FuncInfo
|
|
|
+
|
|
|
+```java
|
|
|
+public class FuncInfo {
|
|
|
+ @Id
|
|
|
+ private int id;
|
|
|
+ private String funcDes;
|
|
|
+ private String funcName;
|
|
|
+ private int flagOfType;//0--String, 1--Double, 2--all
|
|
|
+ private int flagOfConOrDis;//0--con, 1--dis, 2--all
|
|
|
+
|
|
|
+ public FuncInfo(String funcDes, String funcName, int flagOfType, int flagOfConOrDis) {
|
|
|
+ this.funcName = funcName;
|
|
|
+ this.funcDes = funcDes;
|
|
|
+ this.flagOfType = flagOfType;
|
|
|
+ this.flagOfConOrDis = flagOfConOrDis;
|
|
|
+ }
|
|
|
+
|
|
|
+ public FuncInfo(int id, int flagOfType, int flagOfConOrDis) {
|
|
|
+ this.id = id;
|
|
|
+ this.flagOfType = flagOfType;
|
|
|
+ this.flagOfConOrDis = flagOfConOrDis;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+# 6. HeaderInfo
|
|
|
+
|
|
|
+```java
|
|
|
+public class HeaderInfo {
|
|
|
+ @Id
|
|
|
+ @GeneratedValue(strategy = GenerationType.AUTO)
|
|
|
+ private int id;
|
|
|
+ private int fileInfoId; //文件id
|
|
|
+ private String fieldName; //文件头的字段信息
|
|
|
+ private String aliasName; //文件字段的别名
|
|
|
+ private String fieldDes; //文件的描述信息
|
|
|
+ private double nullsRatio; //field的空值比例,为百分比 如10.00%
|
|
|
+ /**
|
|
|
+ * conOrDis 表示了这个field的类型
|
|
|
+ * 0表示离散值,1表示连续值,2表示时间
|
|
|
+ * @since 1.0 记录变量为离散值和连续值
|
|
|
+ */
|
|
|
+ private int conOrDis;
|
|
|
+ /**
|
|
|
+ * fieldType 表示了这个field的类型
|
|
|
+ * string, int, double ....
|
|
|
+ * @since 2.0 记录变量为离散值和连续值
|
|
|
+ */
|
|
|
+ private String fieldType; //值的类型
|
|
|
+ /**
|
|
|
+ * @since 1.0 valueInfo使用String数组存储取值,如果是离散值则为取值,连续值则存储前两位min & max
|
|
|
+ */
|
|
|
+ //离散值的取值或者连续值的范围
|
|
|
+ private String valueInfo;
|
|
|
+
|
|
|
+ public HeaderInfo(int fileInfoId, String fieldName, String fieldType) {
|
|
|
+ this.fileInfoId = fileInfoId;
|
|
|
+ this.fieldName = fieldName;
|
|
|
+ this.aliasName = "";
|
|
|
+ this.fieldDes = "";
|
|
|
+ this.fieldType = fieldType;
|
|
|
+ this.valueInfo = null;
|
|
|
+ this.nullsRatio =0.0;
|
|
|
+ }
|
|
|
+ /*
|
|
|
+ * For the Fucking Stupid Scala Compiler
|
|
|
+ * */
|
|
|
+ public int getFileInfoId() { return this.fileInfoId; }
|
|
|
+ public String getFieldName() {
|
|
|
+ return this.fieldName;
|
|
|
+ }
|
|
|
+ public String getFieldType() { return this.fieldType; }
|
|
|
+
|
|
|
+ public double getNullsRatio() {
|
|
|
+ return nullsRatio;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setConOrDis(int conOrDis) {
|
|
|
+ this.conOrDis = conOrDis;
|
|
|
+ }
|
|
|
+ public void setValueInfo(String valueInfo) {
|
|
|
+ this.valueInfo = valueInfo;
|
|
|
+ }
|
|
|
+ public void setNullsRatio(double nullsRatio) {this.nullsRatio = nullsRatio;}
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+fileInfoId是外键。
|
|
|
+
|
|
|
+# 7. Model
|
|
|
+
|
|
|
+```java
|
|
|
+public class Model {
|
|
|
+
|
|
|
+ @Id
|
|
|
+ private int id;
|
|
|
+
|
|
|
+ private int modelTypeId; //模型的类别
|
|
|
+
|
|
|
+ private int configId; //文件配置id
|
|
|
+
|
|
|
+ private int fileInfoId; //文件信息id
|
|
|
+
|
|
|
+ private String modelName; //自定义的训练模型名
|
|
|
+
|
|
|
+ private boolean isTrained; //是否进行了训练
|
|
|
+
|
|
|
+ private String modelPath; //具体训练出的model
|
|
|
+
|
|
|
+ private String resOfModel; //模型训练的result
|
|
|
+ //模型的具体参数取值
|
|
|
+ private String arguments; //模型的参数列表
|
|
|
+
|
|
|
+ @Id
|
|
|
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
|
+ public int getId(){
|
|
|
+ return id;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setConfigId(int configId) {
|
|
|
+ this.configId = configId;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getModelPath() {
|
|
|
+ return modelPath;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setModelPath(String modelPath) {
|
|
|
+ this.modelPath = modelPath;
|
|
|
+ }
|
|
|
+
|
|
|
+ public int getConfigId() {
|
|
|
+ return configId;
|
|
|
+ }
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+modelTypeId,configId,fileInfoId是外键。
|
|
|
+
|
|
|
+# 8. ModelType
|
|
|
+
|
|
|
+```java
|
|
|
+public class ModelType {
|
|
|
+
|
|
|
+ @Id
|
|
|
+ private int id;
|
|
|
+
|
|
|
+ private String modelTypeName;
|
|
|
+
|
|
|
+ private String modelDetailName;
|
|
|
+
|
|
|
+ private String arguments;
|
|
|
+
|
|
|
+ private String modelDetailDes;
|
|
|
+
|
|
|
+ private String modelDes;
|
|
|
+
|
|
|
+ public ModelType(String modelTypeName, String modelDetailName, String arguments,
|
|
|
+ String modelDetailDes, String modelDes) {
|
|
|
+ this.modelTypeName = modelTypeName;
|
|
|
+ this.modelDetailName = modelDetailName;
|
|
|
+ this.arguments = arguments;
|
|
|
+ this.modelDetailDes = modelDetailDes;
|
|
|
+ this.modelDes = modelDes;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+# 9. PicCategory
|
|
|
+
|
|
|
+```java
|
|
|
+public class PicCategory {
|
|
|
+
|
|
|
+ @Id
|
|
|
+ private int id;
|
|
|
+
|
|
|
+ private int picFileId;
|
|
|
+
|
|
|
+ private String categoryName;
|
|
|
+
|
|
|
+ @Id
|
|
|
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
|
+ public int getId(){
|
|
|
+ return id;
|
|
|
+ }
|
|
|
+
|
|
|
+ public PicCategory(String categoryName, int picFileId) {
|
|
|
+ this.picFileId = picFileId;
|
|
|
+ this.categoryName = categoryName;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+picFileId是外键。
|
|
|
+
|
|
|
+# 10. PicFile
|
|
|
+
|
|
|
+```java
|
|
|
+public class PicFile {
|
|
|
+
|
|
|
+ @Id
|
|
|
+ private int id;
|
|
|
+ //foreign key which connect to User table
|
|
|
+ private int userId;
|
|
|
+
|
|
|
+ private String fileName;
|
|
|
+
|
|
|
+ private String loc;
|
|
|
+
|
|
|
+ @Id
|
|
|
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
|
+ public int getId(){
|
|
|
+ return id;
|
|
|
+ }
|
|
|
+ public PicFile(int userId, String fileName, String loc){
|
|
|
+ this.userId = userId;
|
|
|
+ this.fileName = fileName;
|
|
|
+ this.loc = loc;
|
|
|
+ }
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+userId是外键。
|
|
|
+
|
|
|
+# 11. PicInfo
|
|
|
+
|
|
|
+```java
|
|
|
+public class PicInfo {
|
|
|
+
|
|
|
+
|
|
|
+ @Id
|
|
|
+ private int id;
|
|
|
+
|
|
|
+ //.pic location
|
|
|
+ private String location;
|
|
|
+ //create time
|
|
|
+ private Date uploadTime;
|
|
|
+
|
|
|
+ //filename
|
|
|
+ private String picname;
|
|
|
+
|
|
|
+ private String tag;
|
|
|
+
|
|
|
+ private int categoryId;
|
|
|
+
|
|
|
+ public PicInfo() {}
|
|
|
+
|
|
|
+ public PicInfo(String location, String picname, String tag, int categoryId) {
|
|
|
+ this.location = location;
|
|
|
+ this.picname = picname;
|
|
|
+ this.uploadTime = new Date();
|
|
|
+ this.tag = tag;
|
|
|
+ this.categoryId = categoryId;
|
|
|
+ }
|
|
|
+ //for the scala use
|
|
|
+ @Id
|
|
|
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
|
+ public int getId() {
|
|
|
+ return id;
|
|
|
+ }
|
|
|
+ public String getLocation() {
|
|
|
+ return location;
|
|
|
+ }
|
|
|
+ public String getPicname() {return picname;}
|
|
|
+ public String getTag(){return tag;}
|
|
|
+
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+# 12. User
|
|
|
+
|
|
|
+```java
|
|
|
+public class User {
|
|
|
+ @Id
|
|
|
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
|
+ private Integer id;
|
|
|
+
|
|
|
+ private String username;
|
|
|
+ private String password;
|
|
|
+
|
|
|
+ public User(String username, String password) {
|
|
|
+ this.username = username;
|
|
|
+ this.password = password;
|
|
|
+ }
|
|
|
+}
|
|
|
+```
|
|
|
+
|