├── model
├── .babelrc
├── model
│ ├── group1-shard1of1
│ └── model.json
├── README.md
├── .vscode
│ └── launch.json
├── package.json
├── webpack.config.js
├── src
│ ├── generate_app.js
│ ├── app_template.js
│ └── app.js
├── .gitignore
└── data
│ ├── wine.names
│ ├── .ipynb_checkpoints
│ ├── wine-checkpoint.names
│ ├── wine-checkpoint.data
│ └── wine-checkpoint.csv
│ ├── wine.data
│ └── wine.csv
├── tof-example
├── src
│ └── main
│ │ ├── resources
│ │ └── model
│ │ │ └── todo.txt
│ │ └── scala
│ │ └── com
│ │ └── github
│ │ └── tsingjyujing
│ │ └── tof
│ │ └── example
│ │ └── Entry.scala
├── tof-example.iml
└── pom.xml
├── tf&flink.jpg
├── .idea
├── vcs.xml
├── scala_compiler.xml
├── encodings.xml
├── misc.xml
└── compiler.xml
├── tof-engine
├── src
│ ├── main
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── github
│ │ │ │ └── tsingjyujing
│ │ │ │ └── tof
│ │ │ │ ├── tensorflow
│ │ │ │ └── IModel.java
│ │ │ │ ├── util
│ │ │ │ ├── V8SleepFunction.java
│ │ │ │ ├── V8PrintFunction.java
│ │ │ │ └── FileUtil.java
│ │ │ │ ├── engine
│ │ │ │ └── Engine.java
│ │ │ │ └── JavaScriptRunner.java
│ │ └── scala
│ │ │ └── com
│ │ │ └── github
│ │ │ └── tsingjyujing
│ │ │ └── tof
│ │ │ ├── engine
│ │ │ └── DenseMatrixModel.scala
│ │ │ └── tensorflow
│ │ │ └── MatrixConverter.scala
│ └── test
│ │ └── java
│ │ └── com
│ │ └── github
│ │ └── tsingjyujing
│ │ └── tof
│ │ └── JavaScriptRunnerTest.java
└── pom.xml
├── pom.xml
├── README.md
├── README-zh.md
├── .gitignore
└── LICENSE
/model/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | "es2015"
4 | ]
5 | }
--------------------------------------------------------------------------------
/tof-example/src/main/resources/model/todo.txt:
--------------------------------------------------------------------------------
1 | copy your ml.bundle.js here
--------------------------------------------------------------------------------
/tf&flink.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TsingJyujing/tf.js-on-flink/HEAD/tf&flink.jpg
--------------------------------------------------------------------------------
/tof-example/tof-example.iml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/model/model/group1-shard1of1:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TsingJyujing/tf.js-on-flink/HEAD/model/model/group1-shard1of1
--------------------------------------------------------------------------------
/model/README.md:
--------------------------------------------------------------------------------
1 | # Tensorflow.js 编译
2 |
3 | 通过将 Tensorflow.js 的库(和其他部分)编译入同一个 js 文件,此 js 文件符合 ES5 标准,便于 Nashorn 引擎加载,也便于应用 npm 或者 yarn 上的其他库。
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/scala_compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/model/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // 使用 IntelliSense 了解相关属性。
3 | // 悬停以查看现有属性的描述。
4 | // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "type": "node",
9 | "request": "launch",
10 | "name": "启动程序",
11 | "program": "${workspaceFolder}/src/app.js",
12 | "runtimeExecutable": "babel-node"
13 | }
14 | ]
15 | }
--------------------------------------------------------------------------------
/tof-engine/src/main/java/com/github/tsingjyujing/tof/tensorflow/IModel.java:
--------------------------------------------------------------------------------
1 | package com.github.tsingjyujing.tof.tensorflow;
2 |
3 | /**
4 | * Model interface
5 | *
6 | * @param input type of the model
7 | * @param output type of the model
8 | */
9 | public interface IModel {
10 |
11 | /**
12 | * Predict the input data
13 | *
14 | * @param in
15 | * @return
16 | */
17 | OutputType predict(InputType in);
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/tof-engine/src/test/java/com/github/tsingjyujing/tof/JavaScriptRunnerTest.java:
--------------------------------------------------------------------------------
1 | package com.github.tsingjyujing.tof;
2 |
3 | import com.github.tsingjyujing.tof.util.FileUtil;
4 | import org.junit.Test;
5 |
6 | import java.io.IOException;
7 |
8 | public class JavaScriptRunnerTest {
9 |
10 | @Test
11 | public void runScriptTest() throws Exception {
12 | JavaScriptRunner.runScript(
13 | FileUtil.readRawTextFile(
14 | "../model/target/ml.bundle.js"
15 | )
16 | );
17 | }
18 |
19 | }
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/tof-engine/src/main/java/com/github/tsingjyujing/tof/util/V8SleepFunction.java:
--------------------------------------------------------------------------------
1 | package com.github.tsingjyujing.tof.util;
2 |
3 | import com.eclipsesource.v8.JavaVoidCallback;
4 | import com.eclipsesource.v8.V8Array;
5 | import com.eclipsesource.v8.V8Object;
6 |
7 | /**
8 | * Sleep function
9 | */
10 | public class V8SleepFunction implements JavaVoidCallback {
11 |
12 | @Override
13 | public void invoke(V8Object receiver, V8Array parameters) {
14 | try {
15 | Thread.sleep(Math.round(parameters.getDouble(0)));
16 | } catch (InterruptedException e) {
17 | // fixme print details to log
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/tof-engine/src/main/java/com/github/tsingjyujing/tof/engine/Engine.java:
--------------------------------------------------------------------------------
1 | package com.github.tsingjyujing.tof.engine;
2 |
3 | import com.eclipsesource.v8.NodeJS;
4 | import com.eclipsesource.v8.V8;
5 |
6 | /**
7 | * JavaScript Engine
8 | */
9 | public class Engine {
10 |
11 | public V8 getEngineCore() {
12 | return engineCore.getRuntime();
13 | }
14 |
15 | private final NodeJS engineCore = NodeJS.createNodeJS();
16 |
17 | public Engine() throws Exception {
18 | }
19 |
20 | public Engine(String initScript) throws Exception {
21 | engineCore.getRuntime().executeScript(
22 | initScript
23 | );
24 |
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | com.github.tsingjyujing
8 | tensorflow-on-flink
9 | 1.0
10 |
11 | pom
12 |
13 |
14 | UTF-8
15 | 1.8
16 | 1.8
17 | 2.11
18 | 2.11.12
19 |
20 |
21 |
22 | tof-engine
23 | tof-example
24 |
25 |
26 |
--------------------------------------------------------------------------------
/model/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "tf.js-test",
3 | "version": "0.1.0",
4 | "scripts": {
5 | "start": "node target/ml.bundle.js",
6 | "start-dev": "babel-node src/app.js",
7 | "build-dev": "rm -rf ./target/*.js && babel-node src/generate_app.js && webpack --progress --mode development --config webpack.config.js",
8 | "build": "rm -rf ./target/*.js && babel-node src/generate_app.js && webpack --progress ",
9 | "clean": "rm -rf target/*.js"
10 | },
11 | "main": "src/app.js",
12 | "author": "",
13 | "license": "ISC",
14 | "dependencies": {
15 | "@babel/polyfill": "^7.2.5",
16 | "@tensorflow/tfjs": "^0.14.1",
17 | "node-fetch": "^2.3.0"
18 | },
19 | "devDependencies": {
20 | "babel-core": "^6.26.3",
21 | "babel-loader": "^7.1.5",
22 | "babel-plugin-transform-es2015-typeof-symbol": "^6.23.0",
23 | "babel-plugin-transform-runtime": "^6.23.0",
24 | "babel-preset-es2015": "^6.24.1",
25 | "webpack": "^4.28.3",
26 | "webpack-cli": "^3.1.2"
27 | },
28 | "keywords": []
29 | }
30 |
--------------------------------------------------------------------------------
/model/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require("path");
2 | const webpack = require('webpack');
3 |
4 | module.exports = {
5 | entry: './src/app.js',
6 | output: {
7 | path: path.resolve(__dirname, 'target'),
8 | filename: 'ml.bundle.js'
9 | },
10 | performance: {
11 | hints: false
12 | },
13 | module: {
14 | rules: [
15 | {
16 | test: /\.js$/,
17 | exclude: /node_modules/,
18 | use: {
19 | loader: 'babel-loader',
20 | options: {
21 | presets: [
22 | 'es2015'
23 | ],
24 | plugins: [
25 | 'transform-es2015-typeof-symbol',
26 | "transform-runtime"
27 | ]
28 | }
29 | }
30 | }
31 | ]
32 | },
33 | mode: 'production',
34 | // externals: {
35 | // 'node-fetch': 'fetch'
36 | // }
37 | }
38 |
--------------------------------------------------------------------------------
/tof-engine/src/main/java/com/github/tsingjyujing/tof/util/V8PrintFunction.java:
--------------------------------------------------------------------------------
1 | package com.github.tsingjyujing.tof.util;
2 |
3 | import com.eclipsesource.v8.JavaVoidCallback;
4 | import com.eclipsesource.v8.V8Array;
5 | import com.eclipsesource.v8.V8Object;
6 |
7 | import java.io.PrintStream;
8 |
9 | /**
10 | * Print function, output data to specified PrintStream
11 | */
12 | public class V8PrintFunction implements JavaVoidCallback {
13 |
14 | private final PrintStream printStream;
15 |
16 | /**
17 | * Initialize by default PrintStream (to stdout)
18 | */
19 | public V8PrintFunction() {
20 | this(System.out);
21 | }
22 |
23 | /**
24 | * Specified PrintStream
25 | *
26 | * @param printStream PrintStream
27 | */
28 | public V8PrintFunction(PrintStream printStream) {
29 | this.printStream = printStream;
30 | }
31 |
32 | @Override
33 | public void invoke(V8Object receiver, V8Array parameters) {
34 | final int N = parameters.length();
35 | for (int i = 0; i < N; i++) {
36 | printStream.print(parameters.get(i));
37 | }
38 | printStream.print("\n");
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/model/src/generate_app.js:
--------------------------------------------------------------------------------
1 | import "@babel/polyfill";
2 | import * as tf from '@tensorflow/tfjs';
3 | import fs from "fs";
4 |
5 | global.fetch = require("node-fetch");
6 |
7 | const modelPath = "http://fileserver.shinonomelab.com/tof/models/wine/v1.0.0/model.json";
8 |
9 | tf.loadModel(
10 | modelPath
11 | ).then(
12 | modelGet => {
13 | fs.readFile("src/app_template.js", (err, data) => {
14 | if (err) {
15 | console.error("Error while reading template.");
16 | console.error(err);
17 | } else {
18 | const fileText = data.toString().replace(
19 | "__MODEL_JSON__",
20 | modelGet.toJSON()
21 | ).replace(
22 | "__WEIGHTS__",
23 | modelGet.getWeights().map(w => {
24 | const array = [];
25 | w.dataSync().forEach(x => array.push(x));
26 | return `tf.tensor(${JSON.stringify(array)},${JSON.stringify(w.shape)})`
27 | }).join(",\n")
28 | );
29 | fs.writeFile("src/app.js", fileText, err => {
30 | if (err) {
31 | console.error("Error while writing application.");
32 | console.error(err);
33 | }
34 | })
35 | }
36 | })
37 | }
38 | ).catch(
39 | ex => {
40 | console.error("Error while loading model.");
41 | console.error(ex)
42 | }
43 | );
--------------------------------------------------------------------------------
/model/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by .ignore support plugin (hsz.mobi)
2 | ### VisualStudioCode template
3 | .vscode/*
4 | !.vscode/settings.json
5 | !.vscode/tasks.json
6 | !.vscode/launch.json
7 | !.vscode/extensions.json
8 | ### Node template
9 | # Logs
10 | logs
11 | *.log
12 | npm-debug.log*
13 | yarn-debug.log*
14 | yarn-error.log*
15 |
16 | # Runtime data
17 | pids
18 | *.pid
19 | *.seed
20 | *.pid.lock
21 |
22 | # Directory for instrumented libs generated by jscoverage/JSCover
23 | lib-cov
24 |
25 | # Coverage directory used by tools like istanbul
26 | coverage
27 |
28 | # nyc test coverage
29 | .nyc_output
30 |
31 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
32 | .grunt
33 |
34 | # Bower dependency directory (https://bower.io/)
35 | bower_components
36 |
37 | # node-waf configuration
38 | .lock-wscript
39 |
40 | # Compiled binary addons (https://nodejs.org/api/addons.html)
41 | build/Release
42 |
43 | # Dependency directories
44 | node_modules/
45 | jspm_packages/
46 |
47 | # TypeScript v1 declaration files
48 | typings/
49 |
50 | # Optional npm cache directory
51 | .npm
52 |
53 | # Optional eslint cache
54 | .eslintcache
55 |
56 | # Optional REPL history
57 | .node_repl_history
58 |
59 | # Output of 'npm pack'
60 | *.tgz
61 |
62 | # Yarn Integrity file
63 | .yarn-integrity
64 |
65 | # dotenv environment variables file
66 | .env
67 |
68 | # parcel-bundler cache (https://parceljs.org/)
69 | .cache
70 |
71 | # next.js build output
72 | .next
73 |
74 | # nuxt.js build output
75 | .nuxt
76 |
77 | # vuepress build output
78 | .vuepress/dist
79 |
80 | # Serverless directories
81 | .serverless
82 |
83 | dist
--------------------------------------------------------------------------------
/tof-engine/src/main/scala/com/github/tsingjyujing/tof/engine/DenseMatrixModel.scala:
--------------------------------------------------------------------------------
1 | package com.github.tsingjyujing.tof.engine
2 |
3 | import breeze.linalg.DenseMatrix
4 | import com.eclipsesource.v8.V8Array
5 | import com.github.tsingjyujing.tof.tensorflow.{IModel, MatrixConverter}
6 |
7 | /**
8 | * Dense matrix model
9 | *
10 | * @param initScript
11 | */
12 | class DenseMatrixModel(initScript: String) extends
13 | Engine(initScript) with
14 | IModel[DenseMatrix[Double], DenseMatrix[Double]] {
15 |
16 | getEngineCore.executeScript("let predict = Function(\"return this\")().predict;")
17 | getEngineCore.executeScript("let isLoaded = Function(\"return this\")().isLoaded;")
18 |
19 | // Waiting for model loaded.
20 | while (! {
21 | try {
22 | getEngineCore.executeBooleanFunction("isLoaded", null)
23 | } catch {
24 | case ex: Throwable =>
25 | ex.printStackTrace()
26 | false
27 | }
28 | }) {
29 | Thread.sleep(200)
30 | }
31 |
32 | val matrixConverter = new MatrixConverter(getEngineCore)
33 |
34 | /**
35 | * Predict the input data
36 | *
37 | * @param in
38 | * @return
39 | */
40 | override def predict(in: DenseMatrix[Double]): DenseMatrix[Double] = {
41 | val result = getEngineCore.executeArrayFunction(
42 | "predict",
43 | new V8Array(getEngineCore).push(
44 | matrixConverter.denseMatrixToV8Object(in)
45 | )
46 | )
47 | matrixConverter.v8ArrayToDenseMatrix(
48 | result
49 | )
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/model/model/model.json:
--------------------------------------------------------------------------------
1 | {"weightsManifest": [{"weights": [{"shape": [13, 60], "dtype": "float32", "name": "dense_1/kernel"}, {"shape": [60], "dtype": "float32", "name": "dense_1/bias"}, {"shape": [60, 3], "dtype": "float32", "name": "dense_2/kernel"}, {"shape": [3], "dtype": "float32", "name": "dense_2/bias"}], "paths": ["group1-shard1of1"]}], "modelTopology": {"training_config": {"metrics": ["accuracy"], "loss": "categorical_crossentropy", "optimizer_config": {"config": {"decay": 0.0, "beta_1": 0.8999999761581421, "epsilon": 1e-07, "beta_2": 0.9990000128746033, "lr": 0.004999999888241291, "amsgrad": false}, "class_name": "Adam"}, "loss_weights": null, "sample_weight_mode": null}, "backend": "tensorflow", "model_config": {"config": [{"config": {"trainable": true, "bias_initializer": {"config": {}, "class_name": "Zeros"}, "kernel_constraint": null, "kernel_initializer": {"config": {"minval": -0.05, "maxval": 0.05, "seed": null}, "class_name": "RandomUniform"}, "dtype": "float32", "bias_constraint": null, "bias_regularizer": null, "kernel_regularizer": null, "activity_regularizer": null, "batch_input_shape": [null, 13], "name": "dense_1", "activation": "sigmoid", "units": 60, "use_bias": true}, "class_name": "Dense"}, {"config": {"trainable": true, "bias_initializer": {"config": {}, "class_name": "Zeros"}, "kernel_constraint": null, "kernel_initializer": {"config": {"mode": "fan_avg", "seed": null, "distribution": "uniform", "scale": 1.0}, "class_name": "VarianceScaling"}, "bias_constraint": null, "bias_regularizer": null, "kernel_regularizer": null, "activity_regularizer": null, "name": "dense_2", "activation": "softmax", "units": 3, "use_bias": true}, "class_name": "Dense"}], "class_name": "Sequential"}, "keras_version": "2.2.2"}}
--------------------------------------------------------------------------------
/model/src/app_template.js:
--------------------------------------------------------------------------------
1 | import "@babel/polyfill";
2 | import * as tf from '@tensorflow/tfjs';
3 |
4 | /**
5 | * Convert an array to tensorflow matrix
6 | * @param {Array} value array like [[1,2,3,4]]
7 | * @param {Number} row row count of the matrix, if <=0 means auto
8 | * @param {Number} col column count of the matrix, if <=0 means auto
9 | */
10 | function arrayToMatrix(value, row = -1, col = -1) {
11 | if (row <= 0) {
12 | row = value.length;
13 | }
14 | if (col <= 0) {
15 | col = value.map(
16 | row => row.length
17 | ).reduce(
18 | (a, b) => Math.max(a, b)
19 | );
20 | }
21 | return tf.tensor2d(value, [row, col]);
22 | }
23 |
24 | let modelLoaded = undefined;
25 |
26 | const GLOBAL = Function("return this")();
27 |
28 | GLOBAL.isLoaded = function() {
29 | return typeof modelLoaded !== "undefined";
30 | }
31 |
32 | /**
33 | * Predict Function
34 | * @param {*} input_data Input data (maybe a matrix)
35 | */
36 | GLOBAL.predict = function (input_data) {
37 | if (!isLoaded()) {
38 | console.log("Model not prepared yet.")
39 | throw Error("Model not prepared yet.");
40 | }
41 | const array = [];
42 | modelLoaded.predict(
43 | arrayToMatrix(
44 | input_data
45 | )
46 | ).dataSync().forEach(
47 | x => {
48 | array.push(x)
49 | }
50 | );
51 | return [array];
52 | }
53 |
54 | tf.models.modelFromJSON(
55 | __MODEL_JSON__
56 | ).then(
57 | model => {
58 | model.setWeights([
59 | __WEIGHTS__
60 | ]);
61 | modelLoaded = model;
62 | console.log("Model loaded successfully.")
63 | }
64 | ).catch(
65 | err => {
66 | console.error("Error while loading model:");
67 | console.error(err);
68 | }
69 | )
70 |
71 |
--------------------------------------------------------------------------------
/tof-engine/src/main/java/com/github/tsingjyujing/tof/JavaScriptRunner.java:
--------------------------------------------------------------------------------
1 | package com.github.tsingjyujing.tof;
2 |
3 | import com.eclipsesource.v8.NodeJS;
4 | import com.eclipsesource.v8.V8Array;
5 | import com.github.tsingjyujing.tof.util.FileUtil;
6 |
7 | import java.io.IOException;
8 |
9 | /**
10 | * To run JavaScript on JVM
11 | */
12 | public class JavaScriptRunner {
13 |
14 | /**
15 | * First arg should be filename
16 | *
17 | * @param args
18 | */
19 | public static void main(String[] args) throws Exception {
20 | runScript(
21 | FileUtil.readRawTextFile(
22 | args[0]
23 | )
24 | );
25 | }
26 |
27 | /**
28 | * Create an engine and run specified script
29 | *
30 | * @param script javascript script
31 | * @throws IOException
32 | */
33 | public static void runScript(String script) {
34 | final NodeJS node = NodeJS.createNodeJS();
35 | try {
36 | node.getRuntime().executeScript(script);
37 | node.getRuntime().executeScript("const predict = Function(\"return this\")().predict;const isLoaded = Function(\"return this\")().isLoaded;");
38 | Thread.sleep(5000);
39 | V8Array data = new V8Array(node.getRuntime());
40 | double[] dataRaw = new double[]{
41 | 14.23, 1.71, 2.43, 15.6, 127, 2.8, 3.06, .28, 2.29, 5.64, 1.04, 3.92, 1065
42 | };
43 | for (double x : dataRaw) {
44 | data.push(x);
45 | }
46 | System.out.println(node.getRuntime().executeBooleanFunction("isLoaded",null));
47 | V8Array result = node.getRuntime().executeArrayFunction("predict", new V8Array(node.getRuntime()).push(new V8Array(node.getRuntime()).push(data)));
48 | System.out.println(result);
49 | } catch (Throwable t) {
50 | t.printStackTrace();
51 | } finally {
52 | node.release();
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/tof-example/src/main/scala/com/github/tsingjyujing/tof/example/Entry.scala:
--------------------------------------------------------------------------------
1 | package com.github.tsingjyujing.tof.example
2 |
3 | import com.github.tsingjyujing.tof.engine.DenseMatrixModel
4 | import com.github.tsingjyujing.tof.util.FileUtil
5 | import org.apache.flink.api.common.functions.RichMapFunction
6 | import org.apache.flink.api.java.utils.ParameterTool
7 | import org.apache.flink.streaming.api.scala._
8 | import org.apache.flink.streaming.api.scala.function.ProcessAllWindowFunction
9 | import org.apache.flink.streaming.api.windowing.windows.GlobalWindow
10 | import org.apache.flink.util.Collector
11 |
12 | import scala.io.Source
13 |
14 | /**
15 | * Entry of Flink program
16 | */
17 | object Entry {
18 | def main(args: Array[String]): Unit = {
19 | val env: StreamExecutionEnvironment = StreamExecutionEnvironment.getExecutionEnvironment
20 | val configFromArg = ParameterTool.fromArgs(args)
21 | env.getConfig.setGlobalJobParameters(
22 | configFromArg
23 | )
24 |
25 | env.setParallelism(1)
26 |
27 | val data = Source.fromFile("model/data/wine.csv").getLines().flatMap(line => try {
28 | val arr = line.replace("\n", "").split(",")
29 | val label = arr(0).toInt - 1
30 | val data = arr.tail.map(_.toDouble)
31 | Some((label, data))
32 | } catch {
33 | case ex: Throwable => None
34 | }).toIndexedSeq
35 |
36 | env.fromCollection(
37 | data
38 | ).map(new RichMapFunction[(Int, Array[Double]), Boolean] {
39 | lazy val model: DenseMatrixModel = new DenseMatrixModel(
40 | FileUtil.readTextResource("model/ml.bundle.js")
41 | )
42 |
43 | override def map(value: (Int, Array[Double])): Boolean = {
44 | val label = value._1
45 | val data = value._2
46 | val result = model.predict(
47 | model.matrixConverter.arraysToDenseMatrix(
48 | Array(data), 1, data.length
49 | )
50 | )
51 | val predictLabel = result.data.zipWithIndex.maxBy(_._1)._2
52 | predictLabel == label
53 | }
54 | }).countWindowAll(10).process(
55 | new ProcessAllWindowFunction[Boolean, String, GlobalWindow]() {
56 | override def process(context: Context, elements: Iterable[Boolean], out: Collector[String]): Unit = out.collect({
57 | val acc = elements.count(x => x) * 100.0 / elements.size
58 | s"Accuracy of batch 10 elements: ${acc}%"
59 | })
60 | }
61 | ).print()
62 |
63 | env.execute("TensorFlow Example")
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/tof-engine/src/main/scala/com/github/tsingjyujing/tof/tensorflow/MatrixConverter.scala:
--------------------------------------------------------------------------------
1 | package com.github.tsingjyujing.tof.tensorflow
2 |
3 | import breeze.linalg.DenseMatrix
4 | import com.eclipsesource.v8.{V8, V8Array}
5 |
6 | /**
7 | * Convert data from DMatrix to V8Object
8 | */
9 | class MatrixConverter(engine: V8) {
10 |
11 | /**
12 | * Convert arrays to DenseMatrix
13 | *
14 | * @param matrixInfo
15 | * @param rowSize
16 | * @param colSize
17 | * @return
18 | */
19 | def arraysToDenseMatrix(matrixInfo: Array[Array[Double]], rowSize: Int = -1, colSize: Int = -1): DenseMatrix[Double] = {
20 | val shape: (Int, Int) = if (rowSize <= 0 || colSize <= 0) {
21 | (matrixInfo.length, matrixInfo.map(_.length).max)
22 | } else {
23 | (rowSize, colSize)
24 | }
25 | val mat = new DenseMatrix[Double](shape._1, shape._2)
26 | matrixInfo.zipWithIndex.foreach(
27 | rowInfo => {
28 | val rowId = rowInfo._2
29 | rowInfo._1.zipWithIndex.foreach(
30 | colInfo => {
31 | mat(rowId, colInfo._2) = colInfo._1
32 | }
33 | )
34 | }
35 | )
36 | mat
37 | }
38 |
39 | def v8ArrayToDenseMatrix(matrixInfo:V8Array,rowSize: Int = -1, colSize: Int = -1):DenseMatrix[Double] = {
40 | val shape: (Int, Int) = if (rowSize <= 0 || colSize <= 0) {
41 | (matrixInfo.length, {
42 | (0 until matrixInfo.length()).map(i=>{
43 | matrixInfo.getArray(i).length()
44 | }).max
45 | })
46 | } else {
47 | (rowSize, colSize)
48 | }
49 | val mat = new DenseMatrix[Double](shape._1, shape._2)
50 | (0 until matrixInfo.length()).map(i=>{
51 | matrixInfo.getArray(i)
52 | }).zipWithIndex.foreach(
53 | rowInfo => {
54 | val rowId: Int = rowInfo._2
55 | val rowData: V8Array = rowInfo._1
56 | (0 until rowData.length()).foreach(
57 | colId=>{
58 | mat(rowId,colId) = rowData.getDouble(colId).asInstanceOf[Double]
59 | }
60 | )
61 | }
62 | )
63 | mat
64 | }
65 |
66 | /**
67 | * Convert dense matrix into JavaScript array format
68 | *
69 | * @param data dense matrix
70 | * @return
71 | */
72 | def denseMatrixToV8Object(data: DenseMatrix[Double]): V8Array = {
73 | val array = new V8Array(engine)
74 | (0 until data.rows).foreach(rowId => {
75 | val row = new V8Array(engine)
76 | (0 until data.cols).foreach(colId => {
77 | row.push(data(rowId, colId))
78 | })
79 | array.push(row)
80 | })
81 | array
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Tensorflow on Flink
2 |
3 | 
4 | ## Basic Conceptions
5 |
6 | It's hard to use Tensorflow in standard JVM,
7 | because the Tensorflow on JVM need native libraries and so many other dependencies.
8 | But there's another way to apply your Tensorflow model on JVM: Use Tensorflow.js and V8 engine.
9 |
10 | The V8 engine we're using is based on some native library.
11 | But in future releases of Java, the Nashorn engine will support ES6.
12 | We will use nashorn instead of V8.
13 |
14 | ## Features
15 |
16 | - Realtime machine learning (prediction)
17 | - Update your model without restart your streaming computation system
18 | - Not only models, but pre-processing and conversion of the data.
19 |
20 | ## Tutorial
21 |
22 | For contributing an example of TF.js on Flink,
23 | we use [WINE](https://archive.ics.uci.edu/ml/datasets/wine) dataset to build our model and realtime predict system.
24 |
25 | ### Step 1: Build your model by Keras
26 |
27 | By using [WINE](https://archive.ics.uci.edu/ml/datasets/wine) dataset, we build a really simple model.
28 |
29 | This model is only for EXAMPLE!
30 |
31 | See [model](model/ModelExample.ipynb) for more details about model contribution.
32 |
33 | We saved the model by:
34 | ```python
35 | import tensorflowjs as tfjs
36 | tfjs.converters.save_keras_model(model, "model")
37 | ```
38 |
39 | You can also done this step by command line tool.
40 |
41 | ### Step 2: Convert you model into executable javascript library
42 |
43 | First, We upload the model to our website (shinonome.com) for tensorflow.js to load it.
44 |
45 | Switch your dir into `model` and:
46 |
47 | 1. Modify `src/generate_app.js`, change the variable `modelPath` into the path of your model.
48 | 2. Run the commands below:
49 | ```bash
50 | npm run build # if you want to build more readable script, try npm run build-dev
51 | ```
52 |
53 | After compile stage, we get `ml.bundle.js` in `model/target`, and that's our model~
54 |
55 | ### Step 3: Write appropriate `IModel` for your input type and return type
56 |
57 | We're using DenseMatrix to pass the data and result,
58 | if there're more personal requirement like pre-processing,
59 | you may edit the function `predict` in `src/app_template.js` and rebuild it.
60 | And you may write your own `IModel` to adapt your personal data type.
61 |
62 | ### Step 5: Apply your model in the Flink
63 |
64 | Add a rich map function in your streaming computation DAG maybe the most simple way to apply your predict model like the example shows.
65 |
66 | If there's no requirement to change the model while running, you can easily put them in `resources` and load them.
67 |
68 | ### Step 6: Build your update pipeline if necessary
69 |
70 | There're quite many ways to update your model on~the~fly~~
71 |
72 | - Push your models into Kafka, receive them in Kafka and connect data stream and model stream.
73 | - Put your model and version file on some file server, check version periodically and reload model while the version change.
74 | - Some other methods like `Spring Cloud Config Server`
75 |
76 | If you can read Chinese, read [this artical](https://zhuanlan.zhihu.com/p/52007980) written by me.
77 |
--------------------------------------------------------------------------------
/README-zh.md:
--------------------------------------------------------------------------------
1 | # 实时数据流上的机器学习——Tensorflow on Flink
2 |
3 | 
4 |
5 | ## 前言
6 |
7 | 2019年伊始的时候,给自己定下了一个小目标,不用JNI把TensorFlow撸上Flink做实时的预测。把去年放出去的狠话收个尾。
8 |
9 | 之所以定这个目标,主要是因为在机器学习+流计算的场景有两大诉求:
10 |
11 | 1. 如何给流计算赋能机器学习,做一些在线的预测(不是训练)?
12 | 2. 要是能直接利用训练好的Keras或者Tensorflow模型就更好了嘿嘿嘿……
13 | 3. 如何方便的部署?
14 |
15 | 目前大多的方案还是Flask或者Django写一个Http接口,利用 TensorFlow 原生的 Python API + 某个 Http/RPC Server 作为机器学习中心,然后在流计算中无状态的调用这些接口。
16 |
17 | 这样做的好处是可以无缝衔接研究者训练好的模型,毕竟大部分的机器学习框架都是Python友好的。但是缺点也很明显:
18 | - 网络IO消耗较大
19 | - 为了适配接口编写代码复杂
20 | - 流计算和机器学习服务集群压力不匹配,单方面处理速度过快导致机器学习服务器侧压力太大但是不能背压
21 | - ……
22 |
23 | 为了解决这样的问题,我们需要把 Tensorflow 直接嵌入到 JVM 中去,这样的话有好几个方案:
24 |
25 | 1. 利用原生的 [Tensorflow Java API](https://www.tensorflow.org/api_docs/java/reference/org/tensorflow/package-summary)
26 | 2. 把 Python 解释器嵌入JVM
27 | 3. 利用 JNI,调用 [C++ API](https://www.tensorflow.org/api_docs/cc/),完成预测(某种程度和1有点像)
28 | 4. 利用 JavaScript Engine 运行 [Tensorflow.js](https://js.tensorflow.org/api/latest/)
29 |
30 | 本文最终用的是方案4。
31 |
32 | 先说说几个方案的问题:
33 | 1. Java API 官方不保证不稳定是最大的坑,其次部署麻烦,有些glibc不能升级的场景很难部署,更新也很麻烦。
34 | 2. 没有找到较好的 Python 解释器的Java库,Jython不能用的,详细原因过长不解释。
35 | 3. 依然是glibc等基础库的坑,而且还有在运行中模型不易更新等问题。
36 | 4. 也是有坑的,我这一套工具用起来并不是很方便,模型编译出来较大,如果设置不恰当,因为V8引擎的特性,不易使用多核(其实是可以滴)
37 |
38 | 最后我们的V8依旧是用JNI上的,但是这个库对其他依赖的要求要小很多,基本可以做到是个64位的Linux就可以上(J2V8也支持Windows/Mac/Linux x86/Android等等,但是需要修改POM重新编译)。
39 |
40 | ## Talk is Cheap
41 |
42 | ### 1. 用Keras构建一个模型
43 |
44 | 我这里利用Wine数据集构建了一个简单的模型,详情参见:
45 |
46 | https://github.com/TsingJyujing/tf.js-on-flink/blob/master/model/ModelExample.ipynb
47 |
48 | 这只是一个用于演示的测试模型。
49 |
50 | ### 2. 将模型编译为js文件
51 |
52 | 首先找个网站(自己本机搭建也可以),把你的模型放上去,确保通过http可以访问,像这样:
53 |
54 | http://fileserver.shinonomelab.com/tof/models/wine/v1.0.0/
55 |
56 | 随后修改`src/generate_app.js`,把里面的`modelPath`改成你的模型。
57 |
58 | 最后编译就好啦:`npm run build`,如果你要保留一些调试信息可以用`npm run build-dev`。
59 |
60 | 编译完成以后,你就可以在target文件夹下看到你的 `ml.bundle.js` 文件,这个就是连库带模型打包到一起的一个文件。
61 |
62 | ### 3. 编写合适的 `IModel`
63 |
64 | 我这里仅仅实现了输入输出都是稠密矩阵的函数,参见:`com.github.tsingjyujing.tof.engine.DenseMatrixModel`,因为支持JS的语法,所以你可以把部分的预处理和后处理都放到JS中去,再编写相应的IModel即可。
65 |
66 | ### 4. 跑吧~
67 |
68 | 最简单的方式是使用一个RichMapFunction完成预测任务,我给出的例子里,每来10条数据就输出一下正确率,实际的业务场景还有更多玩法,例如把预测错的样本单独输出,这里就不展开了。
69 |
70 | 详细代码参看这个类:`com.github.tsingjyujing.tof.example.Entry`
71 |
72 | ### 5. 实时更新
73 |
74 | 如果你需要在运行中无缝更新你的模型怎么做?可以参考我写的[这篇文章](https://zhuanlan.zhihu.com/p/52007980)。
75 |
76 | 一般来说,大致就是:
77 |
78 | - 配置更新推送到Kafka,然后connect数据流和模型更新流。
79 | - 把你的模型文件和文件版本放到文件服务器上,定期检测更新,检测到更新就重新加载V8引擎
80 | - 或者用配置中心什么的……你们开心就好
81 |
82 | ## 最佳实践
83 |
84 | - 为了最大发挥CPU的效能(如果你的计算需要GPU还是老老实实用Python吧),建议将Flink的TaskManager启动时候的Slot数量设置为CPU的核心数量,如果上面还有其他任务,可以酌情减少。
85 | - 同时,并行化应该配置为全部Slot的个数
86 | - 不建议直接将JS文件放入Kafka中传输,因为实在太大了,建议使用文件服务器
87 | - 在切换Model的时候,先静静的等待新的Model加载好了,然后瞬间换掉老的Model即可。
88 | - 新老Model的切换和使用都必须是同一个Thread!
89 |
90 | ## 踩过的坑
91 |
92 | 看上去很简单,但是其实做出这个东西不是一个容易的事情,尤其是前端技术是我的短板的情况下,借助Tensorflow.js就变得尤其痛苦。
93 |
94 | 放弃了两三次,因为和太多的人吹过水,说能给Flink上TF,所以忍着做完了……
95 |
96 | - Webpack 打包问题
97 | - babel问题
98 | - polyfill的兼容性问题
99 | - Nashorn引擎和V8引擎支持语言版本不同的问题
100 | - Webpack打包后函数被包裹住,全局内找不到的问题
101 | - 本地V8不支持访问网络资源的问题
102 | - global对象的问题
103 | - JNI的多线程应用问题
104 | - 还有很多记不清了
105 |
--------------------------------------------------------------------------------
/tof-engine/src/main/java/com/github/tsingjyujing/tof/util/FileUtil.java:
--------------------------------------------------------------------------------
1 | package com.github.tsingjyujing.tof.util;
2 |
3 | import org.apache.commons.io.IOUtils;
4 |
5 | import java.io.FileInputStream;
6 | import java.io.IOException;
7 | import java.io.InputStream;
8 | import java.util.Properties;
9 |
10 | /**
11 | * 文件小公举~
12 | */
13 | public class FileUtil {
14 |
15 | /**
16 | * 自动读取配置文件
17 | * 先尝试从文件中获取,再从配置中获取
18 | *
19 | * @param propertiesFileName 配置文件名
20 | * @return
21 | * @throws IOException
22 | */
23 | public static Properties autoReadProperties(String propertiesFileName) throws IOException {
24 | try {
25 | // 尝试读取工作目录下conf文件夹
26 | return readPropertiesFile(propertiesFileName);
27 | } catch (IOException ex) {
28 | // 尝试读取资源文件
29 | return readPropertiesResource(propertiesFileName);
30 | }
31 | }
32 |
33 | /**
34 | * 自动读取文本文件
35 | * 先尝试从文件中获取,再从配置中获取
36 | *
37 | * @param textFileName 配置文件名
38 | * @return
39 | * @throws IOException
40 | */
41 | public static String autoReadText(String textFileName) throws IOException {
42 | try {
43 | // 尝试读取工作目录下conf文件夹
44 | return readTextFile(textFileName);
45 | } catch (IOException ex) {
46 | // 尝试读取资源文件
47 | return readTextResource(textFileName);
48 | }
49 | }
50 |
51 |
52 | /**
53 | * 读取配置(从资源文件根目录中)
54 | *
55 | * @param propertiesResourceName 配置文件名
56 | * @return properties对象
57 | */
58 | public static Properties readPropertiesResource(String propertiesResourceName) throws IOException {
59 | final Properties properties = new Properties();
60 | final InputStream stream = FileUtil.class.getResourceAsStream("/" + propertiesResourceName);
61 | properties.load(stream);
62 | return properties;
63 | }
64 |
65 | /**
66 | * 读取配置(默认从工作目录中的conf文件夹)
67 | *
68 | * @param propertiesFileName 配置文件名
69 | * @return properties对象
70 | */
71 | public static Properties readPropertiesFile(String propertiesFileName) throws IOException {
72 | final Properties properties = new Properties();
73 | final InputStream stream = new FileInputStream("conf/" + propertiesFileName);
74 | properties.load(stream);
75 | return properties;
76 | }
77 |
78 |
79 | /**
80 | * 读取配置(从资源文件根目录中)
81 | *
82 | * @param textResourceName 配置文件名
83 | * @return properties对象
84 | */
85 | public static String readTextResource(String textResourceName) throws IOException {
86 | return IOUtils.toString(FileUtil.class.getResourceAsStream("/" + textResourceName));
87 | }
88 |
89 | /**
90 | * 读取配置(默认从工作目录中的conf文件夹)
91 | *
92 | * @param textFileName 配置文件名
93 | * @return properties对象
94 | */
95 | public static String readTextFile(String textFileName) throws IOException {
96 | return IOUtils.toString(new FileInputStream("conf/" + textFileName));
97 | }
98 |
99 | /**
100 | * 读取配置(默认从工作目录中的conf文件夹)
101 | *
102 | * @param textFileName 配置文件名
103 | * @return properties对象
104 | */
105 | public static String readRawTextFile(String textFileName) throws IOException {
106 | return IOUtils.toString(new FileInputStream(textFileName));
107 | }
108 |
109 |
110 | }
111 |
--------------------------------------------------------------------------------
/model/data/wine.names:
--------------------------------------------------------------------------------
1 | 1. Title of Database: Wine recognition data
2 | Updated Sept 21, 1998 by C.Blake : Added attribute information
3 |
4 | 2. Sources:
5 | (a) Forina, M. et al, PARVUS - An Extendible Package for Data
6 | Exploration, Classification and Correlation. Institute of Pharmaceutical
7 | and Food Analysis and Technologies, Via Brigata Salerno,
8 | 16147 Genoa, Italy.
9 |
10 | (b) Stefan Aeberhard, email: stefan@coral.cs.jcu.edu.au
11 | (c) July 1991
12 | 3. Past Usage:
13 |
14 | (1)
15 | S. Aeberhard, D. Coomans and O. de Vel,
16 | Comparison of Classifiers in High Dimensional Settings,
17 | Tech. Rep. no. 92-02, (1992), Dept. of Computer Science and Dept. of
18 | Mathematics and Statistics, James Cook University of North Queensland.
19 | (Also submitted to Technometrics).
20 |
21 | The data was used with many others for comparing various
22 | classifiers. The classes are separable, though only RDA
23 | has achieved 100% correct classification.
24 | (RDA : 100%, QDA 99.4%, LDA 98.9%, 1NN 96.1% (z-transformed data))
25 | (All results using the leave-one-out technique)
26 |
27 | In a classification context, this is a well posed problem
28 | with "well behaved" class structures. A good data set
29 | for first testing of a new classifier, but not very
30 | challenging.
31 |
32 | (2)
33 | S. Aeberhard, D. Coomans and O. de Vel,
34 | "THE CLASSIFICATION PERFORMANCE OF RDA"
35 | Tech. Rep. no. 92-01, (1992), Dept. of Computer Science and Dept. of
36 | Mathematics and Statistics, James Cook University of North Queensland.
37 | (Also submitted to Journal of Chemometrics).
38 |
39 | Here, the data was used to illustrate the superior performance of
40 | the use of a new appreciation function with RDA.
41 |
42 | 4. Relevant Information:
43 |
44 | -- These data are the results of a chemical analysis of
45 | wines grown in the same region in Italy but derived from three
46 | different cultivars.
47 | The analysis determined the quantities of 13 constituents
48 | found in each of the three types of wines.
49 |
50 | -- I think that the initial data set had around 30 variables, but
51 | for some reason I only have the 13 dimensional version.
52 | I had a list of what the 30 or so variables were, but a.)
53 | I lost it, and b.), I would not know which 13 variables
54 | are included in the set.
55 |
56 | -- The attributes are (dontated by Riccardo Leardi,
57 | riclea@anchem.unige.it )
58 | 1) Alcohol
59 | 2) Malic acid
60 | 3) Ash
61 | 4) Alcalinity of ash
62 | 5) Magnesium
63 | 6) Total phenols
64 | 7) Flavanoids
65 | 8) Nonflavanoid phenols
66 | 9) Proanthocyanins
67 | 10)Color intensity
68 | 11)Hue
69 | 12)OD280/OD315 of diluted wines
70 | 13)Proline
71 |
72 | 5. Number of Instances
73 |
74 | class 1 59
75 | class 2 71
76 | class 3 48
77 |
78 | 6. Number of Attributes
79 |
80 | 13
81 |
82 | 7. For Each Attribute:
83 |
84 | All attributes are continuous
85 |
86 | No statistics available, but suggest to standardise
87 | variables for certain uses (e.g. for us with classifiers
88 | which are NOT scale invariant)
89 |
90 | NOTE: 1st attribute is class identifier (1-3)
91 |
92 | 8. Missing Attribute Values:
93 |
94 | None
95 |
96 | 9. Class Distribution: number of instances per class
97 |
98 | class 1 59
99 | class 2 71
100 | class 3 48
101 |
--------------------------------------------------------------------------------
/model/data/.ipynb_checkpoints/wine-checkpoint.names:
--------------------------------------------------------------------------------
1 | 1. Title of Database: Wine recognition data
2 | Updated Sept 21, 1998 by C.Blake : Added attribute information
3 |
4 | 2. Sources:
5 | (a) Forina, M. et al, PARVUS - An Extendible Package for Data
6 | Exploration, Classification and Correlation. Institute of Pharmaceutical
7 | and Food Analysis and Technologies, Via Brigata Salerno,
8 | 16147 Genoa, Italy.
9 |
10 | (b) Stefan Aeberhard, email: stefan@coral.cs.jcu.edu.au
11 | (c) July 1991
12 | 3. Past Usage:
13 |
14 | (1)
15 | S. Aeberhard, D. Coomans and O. de Vel,
16 | Comparison of Classifiers in High Dimensional Settings,
17 | Tech. Rep. no. 92-02, (1992), Dept. of Computer Science and Dept. of
18 | Mathematics and Statistics, James Cook University of North Queensland.
19 | (Also submitted to Technometrics).
20 |
21 | The data was used with many others for comparing various
22 | classifiers. The classes are separable, though only RDA
23 | has achieved 100% correct classification.
24 | (RDA : 100%, QDA 99.4%, LDA 98.9%, 1NN 96.1% (z-transformed data))
25 | (All results using the leave-one-out technique)
26 |
27 | In a classification context, this is a well posed problem
28 | with "well behaved" class structures. A good data set
29 | for first testing of a new classifier, but not very
30 | challenging.
31 |
32 | (2)
33 | S. Aeberhard, D. Coomans and O. de Vel,
34 | "THE CLASSIFICATION PERFORMANCE OF RDA"
35 | Tech. Rep. no. 92-01, (1992), Dept. of Computer Science and Dept. of
36 | Mathematics and Statistics, James Cook University of North Queensland.
37 | (Also submitted to Journal of Chemometrics).
38 |
39 | Here, the data was used to illustrate the superior performance of
40 | the use of a new appreciation function with RDA.
41 |
42 | 4. Relevant Information:
43 |
44 | -- These data are the results of a chemical analysis of
45 | wines grown in the same region in Italy but derived from three
46 | different cultivars.
47 | The analysis determined the quantities of 13 constituents
48 | found in each of the three types of wines.
49 |
50 | -- I think that the initial data set had around 30 variables, but
51 | for some reason I only have the 13 dimensional version.
52 | I had a list of what the 30 or so variables were, but a.)
53 | I lost it, and b.), I would not know which 13 variables
54 | are included in the set.
55 |
56 | -- The attributes are (dontated by Riccardo Leardi,
57 | riclea@anchem.unige.it )
58 | 1) Alcohol
59 | 2) Malic acid
60 | 3) Ash
61 | 4) Alcalinity of ash
62 | 5) Magnesium
63 | 6) Total phenols
64 | 7) Flavanoids
65 | 8) Nonflavanoid phenols
66 | 9) Proanthocyanins
67 | 10)Color intensity
68 | 11)Hue
69 | 12)OD280/OD315 of diluted wines
70 | 13)Proline
71 |
72 | 5. Number of Instances
73 |
74 | class 1 59
75 | class 2 71
76 | class 3 48
77 |
78 | 6. Number of Attributes
79 |
80 | 13
81 |
82 | 7. For Each Attribute:
83 |
84 | All attributes are continuous
85 |
86 | No statistics available, but suggest to standardise
87 | variables for certain uses (e.g. for us with classifiers
88 | which are NOT scale invariant)
89 |
90 | NOTE: 1st attribute is class identifier (1-3)
91 |
92 | 8. Missing Attribute Values:
93 |
94 | None
95 |
96 | 9. Class Distribution: number of instances per class
97 |
98 | class 1 59
99 | class 2 71
100 | class 3 48
101 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by .ignore support plugin (hsz.mobi)
2 | ### Node template
3 | # Logs
4 | logs
5 | *.log
6 | npm-debug.log*
7 | yarn-debug.log*
8 | yarn-error.log*
9 |
10 | # Runtime data
11 | pids
12 | *.pid
13 | *.seed
14 | *.pid.lock
15 |
16 | # Directory for instrumented libs generated by jscoverage/JSCover
17 | lib-cov
18 |
19 | # Coverage directory used by tools like istanbul
20 | coverage
21 |
22 | # nyc test coverage
23 | .nyc_output
24 |
25 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
26 | .grunt
27 |
28 | # Bower dependency directory (https://bower.io/)
29 | bower_components
30 |
31 | # node-waf configuration
32 | .lock-wscript
33 |
34 | # Compiled binary addons (https://nodejs.org/api/addons.html)
35 | build/Release
36 |
37 | # Dependency directories
38 | node_modules/
39 | jspm_packages/
40 |
41 | # TypeScript v1 declaration files
42 | typings/
43 |
44 | # Optional npm cache directory
45 | .npm
46 |
47 | # Optional eslint cache
48 | .eslintcache
49 |
50 | # Optional REPL history
51 | .node_repl_history
52 |
53 | # Output of 'npm pack'
54 | *.tgz
55 |
56 | # Yarn Integrity file
57 | .yarn-integrity
58 |
59 | # dotenv environment variables file
60 | .env
61 |
62 | # parcel-bundler cache (https://parceljs.org/)
63 | .cache
64 |
65 | # next.js build output
66 | .next
67 |
68 | # nuxt.js build output
69 | .nuxt
70 |
71 | # vuepress build output
72 | .vuepress/dist
73 |
74 | # Serverless directories
75 | .serverless
76 | ### Java template
77 | # Compiled class file
78 | *.class
79 |
80 | # Log file
81 | *.log
82 |
83 | # BlueJ files
84 | *.ctxt
85 |
86 | # Mobile Tools for Java (J2ME)
87 | .mtj.tmp/
88 |
89 | # Package Files #
90 | *.jar
91 | *.war
92 | *.nar
93 | *.ear
94 | *.zip
95 | *.tar.gz
96 | *.rar
97 |
98 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
99 | hs_err_pid*
100 | ### JetBrains template
101 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
102 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
103 |
104 | # User-specific stuff
105 | .idea/**/workspace.xml
106 | .idea/**/tasks.xml
107 | .idea/**/usage.statistics.xml
108 | .idea/**/dictionaries
109 | .idea/**/shelf
110 |
111 | # Sensitive or high-churn files
112 | .idea/**/dataSources/
113 | .idea/**/dataSources.ids
114 | .idea/**/dataSources.local.xml
115 | .idea/**/sqlDataSources.xml
116 | .idea/**/dynamic.xml
117 | .idea/**/uiDesigner.xml
118 | .idea/**/dbnavigator.xml
119 |
120 | # Gradle
121 | .idea/**/gradle.xml
122 | .idea/**/libraries
123 |
124 | # Gradle and Maven with auto-import
125 | # When using Gradle or Maven with auto-import, you should exclude module files,
126 | # since they will be recreated, and may cause churn. Uncomment if using
127 | # auto-import.
128 | # .idea/modules.xml
129 | # .idea/*.iml
130 | # .idea/modules
131 |
132 | # CMake
133 | cmake-build-*/
134 |
135 | # Mongo Explorer plugin
136 | .idea/**/mongoSettings.xml
137 |
138 | # File-based project format
139 | *.iws
140 |
141 | # IntelliJ
142 | out/
143 |
144 | # mpeltonen/sbt-idea plugin
145 | .idea_modules/
146 |
147 | # JIRA plugin
148 | atlassian-ide-plugin.xml
149 |
150 | # Cursive Clojure plugin
151 | .idea/replstate.xml
152 |
153 | # Crashlytics plugin (for Android Studio and IntelliJ)
154 | com_crashlytics_export_strings.xml
155 | crashlytics.properties
156 | crashlytics-build.properties
157 | fabric.properties
158 |
159 | # Editor-based Rest Client
160 | .idea/httpRequests
161 | ### Maven template
162 | target/
163 | pom.xml.tag
164 | pom.xml.releaseBackup
165 | pom.xml.versionsBackup
166 | pom.xml.next
167 | release.properties
168 | dependency-reduced-pom.xml
169 | buildNumber.properties
170 | .mvn/timing.properties
171 | .mvn/wrapper/maven-wrapper.jar
172 | ### Scala template
173 | *.class
174 | *.log
175 |
176 | *.bundle.js
--------------------------------------------------------------------------------
/tof-engine/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | tensorflow-on-flink
7 | com.github.tsingjyujing
8 | 1.0
9 |
10 | 4.0.0
11 |
12 | tof-engine
13 |
14 |
15 |
16 |
17 |
18 | org.scalanlp
19 | breeze_${scala.binary.version}
20 | 0.13.2
21 |
22 |
23 |
24 | org.scala-lang
25 | scala-library
26 | ${scala.version}
27 |
28 |
29 |
30 | org.apache.commons
31 | commons-io
32 | 1.3.2
33 |
34 |
35 |
36 | org.apache.commons
37 | commons-pool2
38 | 2.4.2
39 |
40 |
41 |
42 | org.apache.httpcomponents
43 | httpasyncclient
44 | 4.1.3
45 |
46 |
47 |
48 |
49 | com.eclipsesource.j2v8
50 | j2v8_linux_x86_64
51 | 4.8.0
52 |
53 |
54 |
55 |
56 | org.apache.httpcomponents
57 | httpclient
58 | 4.5.2
59 |
60 |
61 |
62 | junit
63 | junit
64 | 4.12
65 | test
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 | org.apache.maven.wagon
75 | wagon-webdav
76 | 1.0-beta-2
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 | org.apache.maven.plugins
85 | maven-dependency-plugin
86 |
87 |
88 | copy-dependencies
89 | prepare-package
90 |
91 | copy-dependencies
92 |
93 |
94 | ${project.build.directory}/lib
95 | false
96 | false
97 | true
98 | compile
99 |
100 |
101 |
102 |
103 |
104 |
105 | maven-compiler-plugin
106 | 3.6.0
107 |
108 | ${maven.compiler.source}
109 | ${maven.compiler.target}
110 |
111 |
112 |
113 | org.apache.maven.plugins
114 | maven-release-plugin
115 | 2.5.3
116 |
117 |
118 |
119 |
120 |
121 | org.apache.maven.plugins
122 | maven-jar-plugin
123 |
124 |
125 |
126 | true
127 | lib/
128 | com.github.tsingjyujing.tof.JavaScriptRunner
129 |
130 |
131 |
132 |
133 |
134 |
135 | org.apache.maven.plugins
136 | maven-source-plugin
137 | 3.0.1
138 |
139 |
140 | attach-sources
141 |
142 | jar
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
--------------------------------------------------------------------------------
/tof-example/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | tensorflow-on-flink
7 | com.github.tsingjyujing
8 | 1.0
9 |
10 |
11 | 4.0.0
12 |
13 | tof-example
14 |
15 | jar
16 |
17 |
18 | 1.6.2
19 | 0.9
20 |
21 |
22 |
23 |
24 | com.github.tsingjyujing
25 | tof-engine
26 | 1.0
27 |
28 |
29 | org.apache.kafka
30 | kafka_${scala.binary.version}
31 | 0.9.0.1
32 |
33 |
34 |
35 | org.apache.flink
36 | flink-scala_${scala.binary.version}
37 | ${flink.version}
38 | provided
39 |
40 |
41 |
42 | org.apache.flink
43 | flink-streaming-scala_${scala.binary.version}
44 | ${flink.version}
45 | provided
46 |
47 |
48 |
49 |
50 | org.scala-lang
51 | scala-library
52 | ${scala.version}
53 | provided
54 |
55 |
56 |
57 | org.apache.flink
58 | flink-connector-kafka-${kafka.version}_${scala.binary.version}
59 | ${flink.version}
60 |
61 |
62 |
63 | org.slf4j
64 | slf4j-log4j12
65 | 1.7.7
66 | runtime
67 |
68 |
69 |
70 | log4j
71 | log4j
72 | 1.2.17
73 | runtime
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 | org.apache.maven.plugins
84 | maven-shade-plugin
85 | 3.0.0
86 |
87 |
88 | package
89 |
90 | shade
91 |
92 |
93 |
94 |
95 | org.apache.flink:force-shading
96 | com.google.code.findbugs:jsr305
97 | org.slf4j:*
98 | log4j:*
99 |
100 |
101 |
102 |
103 |
105 | *:*
106 |
107 | META-INF/*.SF
108 | META-INF/*.DSA
109 | META-INF/*.RSA
110 |
111 |
112 |
113 |
114 |
116 | com.cvnavi.streaming.GatewayDataProcessing
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 | org.apache.maven.plugins
126 | maven-compiler-plugin
127 | 3.6.0
128 |
129 | ${maven.compiler.source}
130 | ${maven.compiler.target}
131 | UTF-8
132 |
133 |
134 |
135 | compile
136 |
137 | compile
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 | org.scala-tools
146 | maven-scala-plugin
147 | 2.15.1
148 |
149 |
150 | scala-compile
151 | process-resources
152 |
153 | compile
154 |
155 |
156 |
157 | scala-test-compile
158 | process-test-resources
159 |
160 | testCompile
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 | add-dependencies-for-IDEA
174 |
175 |
176 |
177 | idea.version
178 |
179 |
180 |
181 |
182 |
183 | org.apache.flink
184 | flink-scala_${scala.binary.version}
185 | ${flink.version}
186 | compile
187 |
188 |
189 | org.apache.flink
190 | flink-streaming-scala_${scala.binary.version}
191 | ${flink.version}
192 | compile
193 |
194 |
195 | org.scala-lang
196 | scala-library
197 | ${scala.version}
198 | compile
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
--------------------------------------------------------------------------------
/model/data/wine.data:
--------------------------------------------------------------------------------
1 | 1,14.23,1.71,2.43,15.6,127,2.8,3.06,.28,2.29,5.64,1.04,3.92,1065
2 | 1,13.2,1.78,2.14,11.2,100,2.65,2.76,.26,1.28,4.38,1.05,3.4,1050
3 | 1,13.16,2.36,2.67,18.6,101,2.8,3.24,.3,2.81,5.68,1.03,3.17,1185
4 | 1,14.37,1.95,2.5,16.8,113,3.85,3.49,.24,2.18,7.8,.86,3.45,1480
5 | 1,13.24,2.59,2.87,21,118,2.8,2.69,.39,1.82,4.32,1.04,2.93,735
6 | 1,14.2,1.76,2.45,15.2,112,3.27,3.39,.34,1.97,6.75,1.05,2.85,1450
7 | 1,14.39,1.87,2.45,14.6,96,2.5,2.52,.3,1.98,5.25,1.02,3.58,1290
8 | 1,14.06,2.15,2.61,17.6,121,2.6,2.51,.31,1.25,5.05,1.06,3.58,1295
9 | 1,14.83,1.64,2.17,14,97,2.8,2.98,.29,1.98,5.2,1.08,2.85,1045
10 | 1,13.86,1.35,2.27,16,98,2.98,3.15,.22,1.85,7.22,1.01,3.55,1045
11 | 1,14.1,2.16,2.3,18,105,2.95,3.32,.22,2.38,5.75,1.25,3.17,1510
12 | 1,14.12,1.48,2.32,16.8,95,2.2,2.43,.26,1.57,5,1.17,2.82,1280
13 | 1,13.75,1.73,2.41,16,89,2.6,2.76,.29,1.81,5.6,1.15,2.9,1320
14 | 1,14.75,1.73,2.39,11.4,91,3.1,3.69,.43,2.81,5.4,1.25,2.73,1150
15 | 1,14.38,1.87,2.38,12,102,3.3,3.64,.29,2.96,7.5,1.2,3,1547
16 | 1,13.63,1.81,2.7,17.2,112,2.85,2.91,.3,1.46,7.3,1.28,2.88,1310
17 | 1,14.3,1.92,2.72,20,120,2.8,3.14,.33,1.97,6.2,1.07,2.65,1280
18 | 1,13.83,1.57,2.62,20,115,2.95,3.4,.4,1.72,6.6,1.13,2.57,1130
19 | 1,14.19,1.59,2.48,16.5,108,3.3,3.93,.32,1.86,8.7,1.23,2.82,1680
20 | 1,13.64,3.1,2.56,15.2,116,2.7,3.03,.17,1.66,5.1,.96,3.36,845
21 | 1,14.06,1.63,2.28,16,126,3,3.17,.24,2.1,5.65,1.09,3.71,780
22 | 1,12.93,3.8,2.65,18.6,102,2.41,2.41,.25,1.98,4.5,1.03,3.52,770
23 | 1,13.71,1.86,2.36,16.6,101,2.61,2.88,.27,1.69,3.8,1.11,4,1035
24 | 1,12.85,1.6,2.52,17.8,95,2.48,2.37,.26,1.46,3.93,1.09,3.63,1015
25 | 1,13.5,1.81,2.61,20,96,2.53,2.61,.28,1.66,3.52,1.12,3.82,845
26 | 1,13.05,2.05,3.22,25,124,2.63,2.68,.47,1.92,3.58,1.13,3.2,830
27 | 1,13.39,1.77,2.62,16.1,93,2.85,2.94,.34,1.45,4.8,.92,3.22,1195
28 | 1,13.3,1.72,2.14,17,94,2.4,2.19,.27,1.35,3.95,1.02,2.77,1285
29 | 1,13.87,1.9,2.8,19.4,107,2.95,2.97,.37,1.76,4.5,1.25,3.4,915
30 | 1,14.02,1.68,2.21,16,96,2.65,2.33,.26,1.98,4.7,1.04,3.59,1035
31 | 1,13.73,1.5,2.7,22.5,101,3,3.25,.29,2.38,5.7,1.19,2.71,1285
32 | 1,13.58,1.66,2.36,19.1,106,2.86,3.19,.22,1.95,6.9,1.09,2.88,1515
33 | 1,13.68,1.83,2.36,17.2,104,2.42,2.69,.42,1.97,3.84,1.23,2.87,990
34 | 1,13.76,1.53,2.7,19.5,132,2.95,2.74,.5,1.35,5.4,1.25,3,1235
35 | 1,13.51,1.8,2.65,19,110,2.35,2.53,.29,1.54,4.2,1.1,2.87,1095
36 | 1,13.48,1.81,2.41,20.5,100,2.7,2.98,.26,1.86,5.1,1.04,3.47,920
37 | 1,13.28,1.64,2.84,15.5,110,2.6,2.68,.34,1.36,4.6,1.09,2.78,880
38 | 1,13.05,1.65,2.55,18,98,2.45,2.43,.29,1.44,4.25,1.12,2.51,1105
39 | 1,13.07,1.5,2.1,15.5,98,2.4,2.64,.28,1.37,3.7,1.18,2.69,1020
40 | 1,14.22,3.99,2.51,13.2,128,3,3.04,.2,2.08,5.1,.89,3.53,760
41 | 1,13.56,1.71,2.31,16.2,117,3.15,3.29,.34,2.34,6.13,.95,3.38,795
42 | 1,13.41,3.84,2.12,18.8,90,2.45,2.68,.27,1.48,4.28,.91,3,1035
43 | 1,13.88,1.89,2.59,15,101,3.25,3.56,.17,1.7,5.43,.88,3.56,1095
44 | 1,13.24,3.98,2.29,17.5,103,2.64,2.63,.32,1.66,4.36,.82,3,680
45 | 1,13.05,1.77,2.1,17,107,3,3,.28,2.03,5.04,.88,3.35,885
46 | 1,14.21,4.04,2.44,18.9,111,2.85,2.65,.3,1.25,5.24,.87,3.33,1080
47 | 1,14.38,3.59,2.28,16,102,3.25,3.17,.27,2.19,4.9,1.04,3.44,1065
48 | 1,13.9,1.68,2.12,16,101,3.1,3.39,.21,2.14,6.1,.91,3.33,985
49 | 1,14.1,2.02,2.4,18.8,103,2.75,2.92,.32,2.38,6.2,1.07,2.75,1060
50 | 1,13.94,1.73,2.27,17.4,108,2.88,3.54,.32,2.08,8.90,1.12,3.1,1260
51 | 1,13.05,1.73,2.04,12.4,92,2.72,3.27,.17,2.91,7.2,1.12,2.91,1150
52 | 1,13.83,1.65,2.6,17.2,94,2.45,2.99,.22,2.29,5.6,1.24,3.37,1265
53 | 1,13.82,1.75,2.42,14,111,3.88,3.74,.32,1.87,7.05,1.01,3.26,1190
54 | 1,13.77,1.9,2.68,17.1,115,3,2.79,.39,1.68,6.3,1.13,2.93,1375
55 | 1,13.74,1.67,2.25,16.4,118,2.6,2.9,.21,1.62,5.85,.92,3.2,1060
56 | 1,13.56,1.73,2.46,20.5,116,2.96,2.78,.2,2.45,6.25,.98,3.03,1120
57 | 1,14.22,1.7,2.3,16.3,118,3.2,3,.26,2.03,6.38,.94,3.31,970
58 | 1,13.29,1.97,2.68,16.8,102,3,3.23,.31,1.66,6,1.07,2.84,1270
59 | 1,13.72,1.43,2.5,16.7,108,3.4,3.67,.19,2.04,6.8,.89,2.87,1285
60 | 2,12.37,.94,1.36,10.6,88,1.98,.57,.28,.42,1.95,1.05,1.82,520
61 | 2,12.33,1.1,2.28,16,101,2.05,1.09,.63,.41,3.27,1.25,1.67,680
62 | 2,12.64,1.36,2.02,16.8,100,2.02,1.41,.53,.62,5.75,.98,1.59,450
63 | 2,13.67,1.25,1.92,18,94,2.1,1.79,.32,.73,3.8,1.23,2.46,630
64 | 2,12.37,1.13,2.16,19,87,3.5,3.1,.19,1.87,4.45,1.22,2.87,420
65 | 2,12.17,1.45,2.53,19,104,1.89,1.75,.45,1.03,2.95,1.45,2.23,355
66 | 2,12.37,1.21,2.56,18.1,98,2.42,2.65,.37,2.08,4.6,1.19,2.3,678
67 | 2,13.11,1.01,1.7,15,78,2.98,3.18,.26,2.28,5.3,1.12,3.18,502
68 | 2,12.37,1.17,1.92,19.6,78,2.11,2,.27,1.04,4.68,1.12,3.48,510
69 | 2,13.34,.94,2.36,17,110,2.53,1.3,.55,.42,3.17,1.02,1.93,750
70 | 2,12.21,1.19,1.75,16.8,151,1.85,1.28,.14,2.5,2.85,1.28,3.07,718
71 | 2,12.29,1.61,2.21,20.4,103,1.1,1.02,.37,1.46,3.05,.906,1.82,870
72 | 2,13.86,1.51,2.67,25,86,2.95,2.86,.21,1.87,3.38,1.36,3.16,410
73 | 2,13.49,1.66,2.24,24,87,1.88,1.84,.27,1.03,3.74,.98,2.78,472
74 | 2,12.99,1.67,2.6,30,139,3.3,2.89,.21,1.96,3.35,1.31,3.5,985
75 | 2,11.96,1.09,2.3,21,101,3.38,2.14,.13,1.65,3.21,.99,3.13,886
76 | 2,11.66,1.88,1.92,16,97,1.61,1.57,.34,1.15,3.8,1.23,2.14,428
77 | 2,13.03,.9,1.71,16,86,1.95,2.03,.24,1.46,4.6,1.19,2.48,392
78 | 2,11.84,2.89,2.23,18,112,1.72,1.32,.43,.95,2.65,.96,2.52,500
79 | 2,12.33,.99,1.95,14.8,136,1.9,1.85,.35,2.76,3.4,1.06,2.31,750
80 | 2,12.7,3.87,2.4,23,101,2.83,2.55,.43,1.95,2.57,1.19,3.13,463
81 | 2,12,.92,2,19,86,2.42,2.26,.3,1.43,2.5,1.38,3.12,278
82 | 2,12.72,1.81,2.2,18.8,86,2.2,2.53,.26,1.77,3.9,1.16,3.14,714
83 | 2,12.08,1.13,2.51,24,78,2,1.58,.4,1.4,2.2,1.31,2.72,630
84 | 2,13.05,3.86,2.32,22.5,85,1.65,1.59,.61,1.62,4.8,.84,2.01,515
85 | 2,11.84,.89,2.58,18,94,2.2,2.21,.22,2.35,3.05,.79,3.08,520
86 | 2,12.67,.98,2.24,18,99,2.2,1.94,.3,1.46,2.62,1.23,3.16,450
87 | 2,12.16,1.61,2.31,22.8,90,1.78,1.69,.43,1.56,2.45,1.33,2.26,495
88 | 2,11.65,1.67,2.62,26,88,1.92,1.61,.4,1.34,2.6,1.36,3.21,562
89 | 2,11.64,2.06,2.46,21.6,84,1.95,1.69,.48,1.35,2.8,1,2.75,680
90 | 2,12.08,1.33,2.3,23.6,70,2.2,1.59,.42,1.38,1.74,1.07,3.21,625
91 | 2,12.08,1.83,2.32,18.5,81,1.6,1.5,.52,1.64,2.4,1.08,2.27,480
92 | 2,12,1.51,2.42,22,86,1.45,1.25,.5,1.63,3.6,1.05,2.65,450
93 | 2,12.69,1.53,2.26,20.7,80,1.38,1.46,.58,1.62,3.05,.96,2.06,495
94 | 2,12.29,2.83,2.22,18,88,2.45,2.25,.25,1.99,2.15,1.15,3.3,290
95 | 2,11.62,1.99,2.28,18,98,3.02,2.26,.17,1.35,3.25,1.16,2.96,345
96 | 2,12.47,1.52,2.2,19,162,2.5,2.27,.32,3.28,2.6,1.16,2.63,937
97 | 2,11.81,2.12,2.74,21.5,134,1.6,.99,.14,1.56,2.5,.95,2.26,625
98 | 2,12.29,1.41,1.98,16,85,2.55,2.5,.29,1.77,2.9,1.23,2.74,428
99 | 2,12.37,1.07,2.1,18.5,88,3.52,3.75,.24,1.95,4.5,1.04,2.77,660
100 | 2,12.29,3.17,2.21,18,88,2.85,2.99,.45,2.81,2.3,1.42,2.83,406
101 | 2,12.08,2.08,1.7,17.5,97,2.23,2.17,.26,1.4,3.3,1.27,2.96,710
102 | 2,12.6,1.34,1.9,18.5,88,1.45,1.36,.29,1.35,2.45,1.04,2.77,562
103 | 2,12.34,2.45,2.46,21,98,2.56,2.11,.34,1.31,2.8,.8,3.38,438
104 | 2,11.82,1.72,1.88,19.5,86,2.5,1.64,.37,1.42,2.06,.94,2.44,415
105 | 2,12.51,1.73,1.98,20.5,85,2.2,1.92,.32,1.48,2.94,1.04,3.57,672
106 | 2,12.42,2.55,2.27,22,90,1.68,1.84,.66,1.42,2.7,.86,3.3,315
107 | 2,12.25,1.73,2.12,19,80,1.65,2.03,.37,1.63,3.4,1,3.17,510
108 | 2,12.72,1.75,2.28,22.5,84,1.38,1.76,.48,1.63,3.3,.88,2.42,488
109 | 2,12.22,1.29,1.94,19,92,2.36,2.04,.39,2.08,2.7,.86,3.02,312
110 | 2,11.61,1.35,2.7,20,94,2.74,2.92,.29,2.49,2.65,.96,3.26,680
111 | 2,11.46,3.74,1.82,19.5,107,3.18,2.58,.24,3.58,2.9,.75,2.81,562
112 | 2,12.52,2.43,2.17,21,88,2.55,2.27,.26,1.22,2,.9,2.78,325
113 | 2,11.76,2.68,2.92,20,103,1.75,2.03,.6,1.05,3.8,1.23,2.5,607
114 | 2,11.41,.74,2.5,21,88,2.48,2.01,.42,1.44,3.08,1.1,2.31,434
115 | 2,12.08,1.39,2.5,22.5,84,2.56,2.29,.43,1.04,2.9,.93,3.19,385
116 | 2,11.03,1.51,2.2,21.5,85,2.46,2.17,.52,2.01,1.9,1.71,2.87,407
117 | 2,11.82,1.47,1.99,20.8,86,1.98,1.6,.3,1.53,1.95,.95,3.33,495
118 | 2,12.42,1.61,2.19,22.5,108,2,2.09,.34,1.61,2.06,1.06,2.96,345
119 | 2,12.77,3.43,1.98,16,80,1.63,1.25,.43,.83,3.4,.7,2.12,372
120 | 2,12,3.43,2,19,87,2,1.64,.37,1.87,1.28,.93,3.05,564
121 | 2,11.45,2.4,2.42,20,96,2.9,2.79,.32,1.83,3.25,.8,3.39,625
122 | 2,11.56,2.05,3.23,28.5,119,3.18,5.08,.47,1.87,6,.93,3.69,465
123 | 2,12.42,4.43,2.73,26.5,102,2.2,2.13,.43,1.71,2.08,.92,3.12,365
124 | 2,13.05,5.8,2.13,21.5,86,2.62,2.65,.3,2.01,2.6,.73,3.1,380
125 | 2,11.87,4.31,2.39,21,82,2.86,3.03,.21,2.91,2.8,.75,3.64,380
126 | 2,12.07,2.16,2.17,21,85,2.6,2.65,.37,1.35,2.76,.86,3.28,378
127 | 2,12.43,1.53,2.29,21.5,86,2.74,3.15,.39,1.77,3.94,.69,2.84,352
128 | 2,11.79,2.13,2.78,28.5,92,2.13,2.24,.58,1.76,3,.97,2.44,466
129 | 2,12.37,1.63,2.3,24.5,88,2.22,2.45,.4,1.9,2.12,.89,2.78,342
130 | 2,12.04,4.3,2.38,22,80,2.1,1.75,.42,1.35,2.6,.79,2.57,580
131 | 3,12.86,1.35,2.32,18,122,1.51,1.25,.21,.94,4.1,.76,1.29,630
132 | 3,12.88,2.99,2.4,20,104,1.3,1.22,.24,.83,5.4,.74,1.42,530
133 | 3,12.81,2.31,2.4,24,98,1.15,1.09,.27,.83,5.7,.66,1.36,560
134 | 3,12.7,3.55,2.36,21.5,106,1.7,1.2,.17,.84,5,.78,1.29,600
135 | 3,12.51,1.24,2.25,17.5,85,2,.58,.6,1.25,5.45,.75,1.51,650
136 | 3,12.6,2.46,2.2,18.5,94,1.62,.66,.63,.94,7.1,.73,1.58,695
137 | 3,12.25,4.72,2.54,21,89,1.38,.47,.53,.8,3.85,.75,1.27,720
138 | 3,12.53,5.51,2.64,25,96,1.79,.6,.63,1.1,5,.82,1.69,515
139 | 3,13.49,3.59,2.19,19.5,88,1.62,.48,.58,.88,5.7,.81,1.82,580
140 | 3,12.84,2.96,2.61,24,101,2.32,.6,.53,.81,4.92,.89,2.15,590
141 | 3,12.93,2.81,2.7,21,96,1.54,.5,.53,.75,4.6,.77,2.31,600
142 | 3,13.36,2.56,2.35,20,89,1.4,.5,.37,.64,5.6,.7,2.47,780
143 | 3,13.52,3.17,2.72,23.5,97,1.55,.52,.5,.55,4.35,.89,2.06,520
144 | 3,13.62,4.95,2.35,20,92,2,.8,.47,1.02,4.4,.91,2.05,550
145 | 3,12.25,3.88,2.2,18.5,112,1.38,.78,.29,1.14,8.21,.65,2,855
146 | 3,13.16,3.57,2.15,21,102,1.5,.55,.43,1.3,4,.6,1.68,830
147 | 3,13.88,5.04,2.23,20,80,.98,.34,.4,.68,4.9,.58,1.33,415
148 | 3,12.87,4.61,2.48,21.5,86,1.7,.65,.47,.86,7.65,.54,1.86,625
149 | 3,13.32,3.24,2.38,21.5,92,1.93,.76,.45,1.25,8.42,.55,1.62,650
150 | 3,13.08,3.9,2.36,21.5,113,1.41,1.39,.34,1.14,9.40,.57,1.33,550
151 | 3,13.5,3.12,2.62,24,123,1.4,1.57,.22,1.25,8.60,.59,1.3,500
152 | 3,12.79,2.67,2.48,22,112,1.48,1.36,.24,1.26,10.8,.48,1.47,480
153 | 3,13.11,1.9,2.75,25.5,116,2.2,1.28,.26,1.56,7.1,.61,1.33,425
154 | 3,13.23,3.3,2.28,18.5,98,1.8,.83,.61,1.87,10.52,.56,1.51,675
155 | 3,12.58,1.29,2.1,20,103,1.48,.58,.53,1.4,7.6,.58,1.55,640
156 | 3,13.17,5.19,2.32,22,93,1.74,.63,.61,1.55,7.9,.6,1.48,725
157 | 3,13.84,4.12,2.38,19.5,89,1.8,.83,.48,1.56,9.01,.57,1.64,480
158 | 3,12.45,3.03,2.64,27,97,1.9,.58,.63,1.14,7.5,.67,1.73,880
159 | 3,14.34,1.68,2.7,25,98,2.8,1.31,.53,2.7,13,.57,1.96,660
160 | 3,13.48,1.67,2.64,22.5,89,2.6,1.1,.52,2.29,11.75,.57,1.78,620
161 | 3,12.36,3.83,2.38,21,88,2.3,.92,.5,1.04,7.65,.56,1.58,520
162 | 3,13.69,3.26,2.54,20,107,1.83,.56,.5,.8,5.88,.96,1.82,680
163 | 3,12.85,3.27,2.58,22,106,1.65,.6,.6,.96,5.58,.87,2.11,570
164 | 3,12.96,3.45,2.35,18.5,106,1.39,.7,.4,.94,5.28,.68,1.75,675
165 | 3,13.78,2.76,2.3,22,90,1.35,.68,.41,1.03,9.58,.7,1.68,615
166 | 3,13.73,4.36,2.26,22.5,88,1.28,.47,.52,1.15,6.62,.78,1.75,520
167 | 3,13.45,3.7,2.6,23,111,1.7,.92,.43,1.46,10.68,.85,1.56,695
168 | 3,12.82,3.37,2.3,19.5,88,1.48,.66,.4,.97,10.26,.72,1.75,685
169 | 3,13.58,2.58,2.69,24.5,105,1.55,.84,.39,1.54,8.66,.74,1.8,750
170 | 3,13.4,4.6,2.86,25,112,1.98,.96,.27,1.11,8.5,.67,1.92,630
171 | 3,12.2,3.03,2.32,19,96,1.25,.49,.4,.73,5.5,.66,1.83,510
172 | 3,12.77,2.39,2.28,19.5,86,1.39,.51,.48,.64,9.899999,.57,1.63,470
173 | 3,14.16,2.51,2.48,20,91,1.68,.7,.44,1.24,9.7,.62,1.71,660
174 | 3,13.71,5.65,2.45,20.5,95,1.68,.61,.52,1.06,7.7,.64,1.74,740
175 | 3,13.4,3.91,2.48,23,102,1.8,.75,.43,1.41,7.3,.7,1.56,750
176 | 3,13.27,4.28,2.26,20,120,1.59,.69,.43,1.35,10.2,.59,1.56,835
177 | 3,13.17,2.59,2.37,20,120,1.65,.68,.53,1.46,9.3,.6,1.62,840
178 | 3,14.13,4.1,2.74,24.5,96,2.05,.76,.56,1.35,9.2,.61,1.6,560
179 |
--------------------------------------------------------------------------------
/model/data/.ipynb_checkpoints/wine-checkpoint.data:
--------------------------------------------------------------------------------
1 | 1,14.23,1.71,2.43,15.6,127,2.8,3.06,.28,2.29,5.64,1.04,3.92,1065
2 | 1,13.2,1.78,2.14,11.2,100,2.65,2.76,.26,1.28,4.38,1.05,3.4,1050
3 | 1,13.16,2.36,2.67,18.6,101,2.8,3.24,.3,2.81,5.68,1.03,3.17,1185
4 | 1,14.37,1.95,2.5,16.8,113,3.85,3.49,.24,2.18,7.8,.86,3.45,1480
5 | 1,13.24,2.59,2.87,21,118,2.8,2.69,.39,1.82,4.32,1.04,2.93,735
6 | 1,14.2,1.76,2.45,15.2,112,3.27,3.39,.34,1.97,6.75,1.05,2.85,1450
7 | 1,14.39,1.87,2.45,14.6,96,2.5,2.52,.3,1.98,5.25,1.02,3.58,1290
8 | 1,14.06,2.15,2.61,17.6,121,2.6,2.51,.31,1.25,5.05,1.06,3.58,1295
9 | 1,14.83,1.64,2.17,14,97,2.8,2.98,.29,1.98,5.2,1.08,2.85,1045
10 | 1,13.86,1.35,2.27,16,98,2.98,3.15,.22,1.85,7.22,1.01,3.55,1045
11 | 1,14.1,2.16,2.3,18,105,2.95,3.32,.22,2.38,5.75,1.25,3.17,1510
12 | 1,14.12,1.48,2.32,16.8,95,2.2,2.43,.26,1.57,5,1.17,2.82,1280
13 | 1,13.75,1.73,2.41,16,89,2.6,2.76,.29,1.81,5.6,1.15,2.9,1320
14 | 1,14.75,1.73,2.39,11.4,91,3.1,3.69,.43,2.81,5.4,1.25,2.73,1150
15 | 1,14.38,1.87,2.38,12,102,3.3,3.64,.29,2.96,7.5,1.2,3,1547
16 | 1,13.63,1.81,2.7,17.2,112,2.85,2.91,.3,1.46,7.3,1.28,2.88,1310
17 | 1,14.3,1.92,2.72,20,120,2.8,3.14,.33,1.97,6.2,1.07,2.65,1280
18 | 1,13.83,1.57,2.62,20,115,2.95,3.4,.4,1.72,6.6,1.13,2.57,1130
19 | 1,14.19,1.59,2.48,16.5,108,3.3,3.93,.32,1.86,8.7,1.23,2.82,1680
20 | 1,13.64,3.1,2.56,15.2,116,2.7,3.03,.17,1.66,5.1,.96,3.36,845
21 | 1,14.06,1.63,2.28,16,126,3,3.17,.24,2.1,5.65,1.09,3.71,780
22 | 1,12.93,3.8,2.65,18.6,102,2.41,2.41,.25,1.98,4.5,1.03,3.52,770
23 | 1,13.71,1.86,2.36,16.6,101,2.61,2.88,.27,1.69,3.8,1.11,4,1035
24 | 1,12.85,1.6,2.52,17.8,95,2.48,2.37,.26,1.46,3.93,1.09,3.63,1015
25 | 1,13.5,1.81,2.61,20,96,2.53,2.61,.28,1.66,3.52,1.12,3.82,845
26 | 1,13.05,2.05,3.22,25,124,2.63,2.68,.47,1.92,3.58,1.13,3.2,830
27 | 1,13.39,1.77,2.62,16.1,93,2.85,2.94,.34,1.45,4.8,.92,3.22,1195
28 | 1,13.3,1.72,2.14,17,94,2.4,2.19,.27,1.35,3.95,1.02,2.77,1285
29 | 1,13.87,1.9,2.8,19.4,107,2.95,2.97,.37,1.76,4.5,1.25,3.4,915
30 | 1,14.02,1.68,2.21,16,96,2.65,2.33,.26,1.98,4.7,1.04,3.59,1035
31 | 1,13.73,1.5,2.7,22.5,101,3,3.25,.29,2.38,5.7,1.19,2.71,1285
32 | 1,13.58,1.66,2.36,19.1,106,2.86,3.19,.22,1.95,6.9,1.09,2.88,1515
33 | 1,13.68,1.83,2.36,17.2,104,2.42,2.69,.42,1.97,3.84,1.23,2.87,990
34 | 1,13.76,1.53,2.7,19.5,132,2.95,2.74,.5,1.35,5.4,1.25,3,1235
35 | 1,13.51,1.8,2.65,19,110,2.35,2.53,.29,1.54,4.2,1.1,2.87,1095
36 | 1,13.48,1.81,2.41,20.5,100,2.7,2.98,.26,1.86,5.1,1.04,3.47,920
37 | 1,13.28,1.64,2.84,15.5,110,2.6,2.68,.34,1.36,4.6,1.09,2.78,880
38 | 1,13.05,1.65,2.55,18,98,2.45,2.43,.29,1.44,4.25,1.12,2.51,1105
39 | 1,13.07,1.5,2.1,15.5,98,2.4,2.64,.28,1.37,3.7,1.18,2.69,1020
40 | 1,14.22,3.99,2.51,13.2,128,3,3.04,.2,2.08,5.1,.89,3.53,760
41 | 1,13.56,1.71,2.31,16.2,117,3.15,3.29,.34,2.34,6.13,.95,3.38,795
42 | 1,13.41,3.84,2.12,18.8,90,2.45,2.68,.27,1.48,4.28,.91,3,1035
43 | 1,13.88,1.89,2.59,15,101,3.25,3.56,.17,1.7,5.43,.88,3.56,1095
44 | 1,13.24,3.98,2.29,17.5,103,2.64,2.63,.32,1.66,4.36,.82,3,680
45 | 1,13.05,1.77,2.1,17,107,3,3,.28,2.03,5.04,.88,3.35,885
46 | 1,14.21,4.04,2.44,18.9,111,2.85,2.65,.3,1.25,5.24,.87,3.33,1080
47 | 1,14.38,3.59,2.28,16,102,3.25,3.17,.27,2.19,4.9,1.04,3.44,1065
48 | 1,13.9,1.68,2.12,16,101,3.1,3.39,.21,2.14,6.1,.91,3.33,985
49 | 1,14.1,2.02,2.4,18.8,103,2.75,2.92,.32,2.38,6.2,1.07,2.75,1060
50 | 1,13.94,1.73,2.27,17.4,108,2.88,3.54,.32,2.08,8.90,1.12,3.1,1260
51 | 1,13.05,1.73,2.04,12.4,92,2.72,3.27,.17,2.91,7.2,1.12,2.91,1150
52 | 1,13.83,1.65,2.6,17.2,94,2.45,2.99,.22,2.29,5.6,1.24,3.37,1265
53 | 1,13.82,1.75,2.42,14,111,3.88,3.74,.32,1.87,7.05,1.01,3.26,1190
54 | 1,13.77,1.9,2.68,17.1,115,3,2.79,.39,1.68,6.3,1.13,2.93,1375
55 | 1,13.74,1.67,2.25,16.4,118,2.6,2.9,.21,1.62,5.85,.92,3.2,1060
56 | 1,13.56,1.73,2.46,20.5,116,2.96,2.78,.2,2.45,6.25,.98,3.03,1120
57 | 1,14.22,1.7,2.3,16.3,118,3.2,3,.26,2.03,6.38,.94,3.31,970
58 | 1,13.29,1.97,2.68,16.8,102,3,3.23,.31,1.66,6,1.07,2.84,1270
59 | 1,13.72,1.43,2.5,16.7,108,3.4,3.67,.19,2.04,6.8,.89,2.87,1285
60 | 2,12.37,.94,1.36,10.6,88,1.98,.57,.28,.42,1.95,1.05,1.82,520
61 | 2,12.33,1.1,2.28,16,101,2.05,1.09,.63,.41,3.27,1.25,1.67,680
62 | 2,12.64,1.36,2.02,16.8,100,2.02,1.41,.53,.62,5.75,.98,1.59,450
63 | 2,13.67,1.25,1.92,18,94,2.1,1.79,.32,.73,3.8,1.23,2.46,630
64 | 2,12.37,1.13,2.16,19,87,3.5,3.1,.19,1.87,4.45,1.22,2.87,420
65 | 2,12.17,1.45,2.53,19,104,1.89,1.75,.45,1.03,2.95,1.45,2.23,355
66 | 2,12.37,1.21,2.56,18.1,98,2.42,2.65,.37,2.08,4.6,1.19,2.3,678
67 | 2,13.11,1.01,1.7,15,78,2.98,3.18,.26,2.28,5.3,1.12,3.18,502
68 | 2,12.37,1.17,1.92,19.6,78,2.11,2,.27,1.04,4.68,1.12,3.48,510
69 | 2,13.34,.94,2.36,17,110,2.53,1.3,.55,.42,3.17,1.02,1.93,750
70 | 2,12.21,1.19,1.75,16.8,151,1.85,1.28,.14,2.5,2.85,1.28,3.07,718
71 | 2,12.29,1.61,2.21,20.4,103,1.1,1.02,.37,1.46,3.05,.906,1.82,870
72 | 2,13.86,1.51,2.67,25,86,2.95,2.86,.21,1.87,3.38,1.36,3.16,410
73 | 2,13.49,1.66,2.24,24,87,1.88,1.84,.27,1.03,3.74,.98,2.78,472
74 | 2,12.99,1.67,2.6,30,139,3.3,2.89,.21,1.96,3.35,1.31,3.5,985
75 | 2,11.96,1.09,2.3,21,101,3.38,2.14,.13,1.65,3.21,.99,3.13,886
76 | 2,11.66,1.88,1.92,16,97,1.61,1.57,.34,1.15,3.8,1.23,2.14,428
77 | 2,13.03,.9,1.71,16,86,1.95,2.03,.24,1.46,4.6,1.19,2.48,392
78 | 2,11.84,2.89,2.23,18,112,1.72,1.32,.43,.95,2.65,.96,2.52,500
79 | 2,12.33,.99,1.95,14.8,136,1.9,1.85,.35,2.76,3.4,1.06,2.31,750
80 | 2,12.7,3.87,2.4,23,101,2.83,2.55,.43,1.95,2.57,1.19,3.13,463
81 | 2,12,.92,2,19,86,2.42,2.26,.3,1.43,2.5,1.38,3.12,278
82 | 2,12.72,1.81,2.2,18.8,86,2.2,2.53,.26,1.77,3.9,1.16,3.14,714
83 | 2,12.08,1.13,2.51,24,78,2,1.58,.4,1.4,2.2,1.31,2.72,630
84 | 2,13.05,3.86,2.32,22.5,85,1.65,1.59,.61,1.62,4.8,.84,2.01,515
85 | 2,11.84,.89,2.58,18,94,2.2,2.21,.22,2.35,3.05,.79,3.08,520
86 | 2,12.67,.98,2.24,18,99,2.2,1.94,.3,1.46,2.62,1.23,3.16,450
87 | 2,12.16,1.61,2.31,22.8,90,1.78,1.69,.43,1.56,2.45,1.33,2.26,495
88 | 2,11.65,1.67,2.62,26,88,1.92,1.61,.4,1.34,2.6,1.36,3.21,562
89 | 2,11.64,2.06,2.46,21.6,84,1.95,1.69,.48,1.35,2.8,1,2.75,680
90 | 2,12.08,1.33,2.3,23.6,70,2.2,1.59,.42,1.38,1.74,1.07,3.21,625
91 | 2,12.08,1.83,2.32,18.5,81,1.6,1.5,.52,1.64,2.4,1.08,2.27,480
92 | 2,12,1.51,2.42,22,86,1.45,1.25,.5,1.63,3.6,1.05,2.65,450
93 | 2,12.69,1.53,2.26,20.7,80,1.38,1.46,.58,1.62,3.05,.96,2.06,495
94 | 2,12.29,2.83,2.22,18,88,2.45,2.25,.25,1.99,2.15,1.15,3.3,290
95 | 2,11.62,1.99,2.28,18,98,3.02,2.26,.17,1.35,3.25,1.16,2.96,345
96 | 2,12.47,1.52,2.2,19,162,2.5,2.27,.32,3.28,2.6,1.16,2.63,937
97 | 2,11.81,2.12,2.74,21.5,134,1.6,.99,.14,1.56,2.5,.95,2.26,625
98 | 2,12.29,1.41,1.98,16,85,2.55,2.5,.29,1.77,2.9,1.23,2.74,428
99 | 2,12.37,1.07,2.1,18.5,88,3.52,3.75,.24,1.95,4.5,1.04,2.77,660
100 | 2,12.29,3.17,2.21,18,88,2.85,2.99,.45,2.81,2.3,1.42,2.83,406
101 | 2,12.08,2.08,1.7,17.5,97,2.23,2.17,.26,1.4,3.3,1.27,2.96,710
102 | 2,12.6,1.34,1.9,18.5,88,1.45,1.36,.29,1.35,2.45,1.04,2.77,562
103 | 2,12.34,2.45,2.46,21,98,2.56,2.11,.34,1.31,2.8,.8,3.38,438
104 | 2,11.82,1.72,1.88,19.5,86,2.5,1.64,.37,1.42,2.06,.94,2.44,415
105 | 2,12.51,1.73,1.98,20.5,85,2.2,1.92,.32,1.48,2.94,1.04,3.57,672
106 | 2,12.42,2.55,2.27,22,90,1.68,1.84,.66,1.42,2.7,.86,3.3,315
107 | 2,12.25,1.73,2.12,19,80,1.65,2.03,.37,1.63,3.4,1,3.17,510
108 | 2,12.72,1.75,2.28,22.5,84,1.38,1.76,.48,1.63,3.3,.88,2.42,488
109 | 2,12.22,1.29,1.94,19,92,2.36,2.04,.39,2.08,2.7,.86,3.02,312
110 | 2,11.61,1.35,2.7,20,94,2.74,2.92,.29,2.49,2.65,.96,3.26,680
111 | 2,11.46,3.74,1.82,19.5,107,3.18,2.58,.24,3.58,2.9,.75,2.81,562
112 | 2,12.52,2.43,2.17,21,88,2.55,2.27,.26,1.22,2,.9,2.78,325
113 | 2,11.76,2.68,2.92,20,103,1.75,2.03,.6,1.05,3.8,1.23,2.5,607
114 | 2,11.41,.74,2.5,21,88,2.48,2.01,.42,1.44,3.08,1.1,2.31,434
115 | 2,12.08,1.39,2.5,22.5,84,2.56,2.29,.43,1.04,2.9,.93,3.19,385
116 | 2,11.03,1.51,2.2,21.5,85,2.46,2.17,.52,2.01,1.9,1.71,2.87,407
117 | 2,11.82,1.47,1.99,20.8,86,1.98,1.6,.3,1.53,1.95,.95,3.33,495
118 | 2,12.42,1.61,2.19,22.5,108,2,2.09,.34,1.61,2.06,1.06,2.96,345
119 | 2,12.77,3.43,1.98,16,80,1.63,1.25,.43,.83,3.4,.7,2.12,372
120 | 2,12,3.43,2,19,87,2,1.64,.37,1.87,1.28,.93,3.05,564
121 | 2,11.45,2.4,2.42,20,96,2.9,2.79,.32,1.83,3.25,.8,3.39,625
122 | 2,11.56,2.05,3.23,28.5,119,3.18,5.08,.47,1.87,6,.93,3.69,465
123 | 2,12.42,4.43,2.73,26.5,102,2.2,2.13,.43,1.71,2.08,.92,3.12,365
124 | 2,13.05,5.8,2.13,21.5,86,2.62,2.65,.3,2.01,2.6,.73,3.1,380
125 | 2,11.87,4.31,2.39,21,82,2.86,3.03,.21,2.91,2.8,.75,3.64,380
126 | 2,12.07,2.16,2.17,21,85,2.6,2.65,.37,1.35,2.76,.86,3.28,378
127 | 2,12.43,1.53,2.29,21.5,86,2.74,3.15,.39,1.77,3.94,.69,2.84,352
128 | 2,11.79,2.13,2.78,28.5,92,2.13,2.24,.58,1.76,3,.97,2.44,466
129 | 2,12.37,1.63,2.3,24.5,88,2.22,2.45,.4,1.9,2.12,.89,2.78,342
130 | 2,12.04,4.3,2.38,22,80,2.1,1.75,.42,1.35,2.6,.79,2.57,580
131 | 3,12.86,1.35,2.32,18,122,1.51,1.25,.21,.94,4.1,.76,1.29,630
132 | 3,12.88,2.99,2.4,20,104,1.3,1.22,.24,.83,5.4,.74,1.42,530
133 | 3,12.81,2.31,2.4,24,98,1.15,1.09,.27,.83,5.7,.66,1.36,560
134 | 3,12.7,3.55,2.36,21.5,106,1.7,1.2,.17,.84,5,.78,1.29,600
135 | 3,12.51,1.24,2.25,17.5,85,2,.58,.6,1.25,5.45,.75,1.51,650
136 | 3,12.6,2.46,2.2,18.5,94,1.62,.66,.63,.94,7.1,.73,1.58,695
137 | 3,12.25,4.72,2.54,21,89,1.38,.47,.53,.8,3.85,.75,1.27,720
138 | 3,12.53,5.51,2.64,25,96,1.79,.6,.63,1.1,5,.82,1.69,515
139 | 3,13.49,3.59,2.19,19.5,88,1.62,.48,.58,.88,5.7,.81,1.82,580
140 | 3,12.84,2.96,2.61,24,101,2.32,.6,.53,.81,4.92,.89,2.15,590
141 | 3,12.93,2.81,2.7,21,96,1.54,.5,.53,.75,4.6,.77,2.31,600
142 | 3,13.36,2.56,2.35,20,89,1.4,.5,.37,.64,5.6,.7,2.47,780
143 | 3,13.52,3.17,2.72,23.5,97,1.55,.52,.5,.55,4.35,.89,2.06,520
144 | 3,13.62,4.95,2.35,20,92,2,.8,.47,1.02,4.4,.91,2.05,550
145 | 3,12.25,3.88,2.2,18.5,112,1.38,.78,.29,1.14,8.21,.65,2,855
146 | 3,13.16,3.57,2.15,21,102,1.5,.55,.43,1.3,4,.6,1.68,830
147 | 3,13.88,5.04,2.23,20,80,.98,.34,.4,.68,4.9,.58,1.33,415
148 | 3,12.87,4.61,2.48,21.5,86,1.7,.65,.47,.86,7.65,.54,1.86,625
149 | 3,13.32,3.24,2.38,21.5,92,1.93,.76,.45,1.25,8.42,.55,1.62,650
150 | 3,13.08,3.9,2.36,21.5,113,1.41,1.39,.34,1.14,9.40,.57,1.33,550
151 | 3,13.5,3.12,2.62,24,123,1.4,1.57,.22,1.25,8.60,.59,1.3,500
152 | 3,12.79,2.67,2.48,22,112,1.48,1.36,.24,1.26,10.8,.48,1.47,480
153 | 3,13.11,1.9,2.75,25.5,116,2.2,1.28,.26,1.56,7.1,.61,1.33,425
154 | 3,13.23,3.3,2.28,18.5,98,1.8,.83,.61,1.87,10.52,.56,1.51,675
155 | 3,12.58,1.29,2.1,20,103,1.48,.58,.53,1.4,7.6,.58,1.55,640
156 | 3,13.17,5.19,2.32,22,93,1.74,.63,.61,1.55,7.9,.6,1.48,725
157 | 3,13.84,4.12,2.38,19.5,89,1.8,.83,.48,1.56,9.01,.57,1.64,480
158 | 3,12.45,3.03,2.64,27,97,1.9,.58,.63,1.14,7.5,.67,1.73,880
159 | 3,14.34,1.68,2.7,25,98,2.8,1.31,.53,2.7,13,.57,1.96,660
160 | 3,13.48,1.67,2.64,22.5,89,2.6,1.1,.52,2.29,11.75,.57,1.78,620
161 | 3,12.36,3.83,2.38,21,88,2.3,.92,.5,1.04,7.65,.56,1.58,520
162 | 3,13.69,3.26,2.54,20,107,1.83,.56,.5,.8,5.88,.96,1.82,680
163 | 3,12.85,3.27,2.58,22,106,1.65,.6,.6,.96,5.58,.87,2.11,570
164 | 3,12.96,3.45,2.35,18.5,106,1.39,.7,.4,.94,5.28,.68,1.75,675
165 | 3,13.78,2.76,2.3,22,90,1.35,.68,.41,1.03,9.58,.7,1.68,615
166 | 3,13.73,4.36,2.26,22.5,88,1.28,.47,.52,1.15,6.62,.78,1.75,520
167 | 3,13.45,3.7,2.6,23,111,1.7,.92,.43,1.46,10.68,.85,1.56,695
168 | 3,12.82,3.37,2.3,19.5,88,1.48,.66,.4,.97,10.26,.72,1.75,685
169 | 3,13.58,2.58,2.69,24.5,105,1.55,.84,.39,1.54,8.66,.74,1.8,750
170 | 3,13.4,4.6,2.86,25,112,1.98,.96,.27,1.11,8.5,.67,1.92,630
171 | 3,12.2,3.03,2.32,19,96,1.25,.49,.4,.73,5.5,.66,1.83,510
172 | 3,12.77,2.39,2.28,19.5,86,1.39,.51,.48,.64,9.899999,.57,1.63,470
173 | 3,14.16,2.51,2.48,20,91,1.68,.7,.44,1.24,9.7,.62,1.71,660
174 | 3,13.71,5.65,2.45,20.5,95,1.68,.61,.52,1.06,7.7,.64,1.74,740
175 | 3,13.4,3.91,2.48,23,102,1.8,.75,.43,1.41,7.3,.7,1.56,750
176 | 3,13.27,4.28,2.26,20,120,1.59,.69,.43,1.35,10.2,.59,1.56,835
177 | 3,13.17,2.59,2.37,20,120,1.65,.68,.53,1.46,9.3,.6,1.62,840
178 | 3,14.13,4.1,2.74,24.5,96,2.05,.76,.56,1.35,9.2,.61,1.6,560
179 |
--------------------------------------------------------------------------------
/model/data/wine.csv:
--------------------------------------------------------------------------------
1 | Type,Alcohol,Malic acid,Ash,Alcalinity of ash,Magnesium,Total phenols,Flavanoids,Nonflavanoid phenols,Proanthocyanins,Color intensity,Hue,OD280/OD315 of diluted wines,Proline
2 | 1,14.23,1.71,2.43,15.6,127,2.8,3.06,.28,2.29,5.64,1.04,3.92,1065
3 | 1,13.2,1.78,2.14,11.2,100,2.65,2.76,.26,1.28,4.38,1.05,3.4,1050
4 | 1,13.16,2.36,2.67,18.6,101,2.8,3.24,.3,2.81,5.68,1.03,3.17,1185
5 | 1,14.37,1.95,2.5,16.8,113,3.85,3.49,.24,2.18,7.8,.86,3.45,1480
6 | 1,13.24,2.59,2.87,21,118,2.8,2.69,.39,1.82,4.32,1.04,2.93,735
7 | 1,14.2,1.76,2.45,15.2,112,3.27,3.39,.34,1.97,6.75,1.05,2.85,1450
8 | 1,14.39,1.87,2.45,14.6,96,2.5,2.52,.3,1.98,5.25,1.02,3.58,1290
9 | 1,14.06,2.15,2.61,17.6,121,2.6,2.51,.31,1.25,5.05,1.06,3.58,1295
10 | 1,14.83,1.64,2.17,14,97,2.8,2.98,.29,1.98,5.2,1.08,2.85,1045
11 | 1,13.86,1.35,2.27,16,98,2.98,3.15,.22,1.85,7.22,1.01,3.55,1045
12 | 1,14.1,2.16,2.3,18,105,2.95,3.32,.22,2.38,5.75,1.25,3.17,1510
13 | 1,14.12,1.48,2.32,16.8,95,2.2,2.43,.26,1.57,5,1.17,2.82,1280
14 | 1,13.75,1.73,2.41,16,89,2.6,2.76,.29,1.81,5.6,1.15,2.9,1320
15 | 1,14.75,1.73,2.39,11.4,91,3.1,3.69,.43,2.81,5.4,1.25,2.73,1150
16 | 1,14.38,1.87,2.38,12,102,3.3,3.64,.29,2.96,7.5,1.2,3,1547
17 | 1,13.63,1.81,2.7,17.2,112,2.85,2.91,.3,1.46,7.3,1.28,2.88,1310
18 | 1,14.3,1.92,2.72,20,120,2.8,3.14,.33,1.97,6.2,1.07,2.65,1280
19 | 1,13.83,1.57,2.62,20,115,2.95,3.4,.4,1.72,6.6,1.13,2.57,1130
20 | 1,14.19,1.59,2.48,16.5,108,3.3,3.93,.32,1.86,8.7,1.23,2.82,1680
21 | 1,13.64,3.1,2.56,15.2,116,2.7,3.03,.17,1.66,5.1,.96,3.36,845
22 | 1,14.06,1.63,2.28,16,126,3,3.17,.24,2.1,5.65,1.09,3.71,780
23 | 1,12.93,3.8,2.65,18.6,102,2.41,2.41,.25,1.98,4.5,1.03,3.52,770
24 | 1,13.71,1.86,2.36,16.6,101,2.61,2.88,.27,1.69,3.8,1.11,4,1035
25 | 1,12.85,1.6,2.52,17.8,95,2.48,2.37,.26,1.46,3.93,1.09,3.63,1015
26 | 1,13.5,1.81,2.61,20,96,2.53,2.61,.28,1.66,3.52,1.12,3.82,845
27 | 1,13.05,2.05,3.22,25,124,2.63,2.68,.47,1.92,3.58,1.13,3.2,830
28 | 1,13.39,1.77,2.62,16.1,93,2.85,2.94,.34,1.45,4.8,.92,3.22,1195
29 | 1,13.3,1.72,2.14,17,94,2.4,2.19,.27,1.35,3.95,1.02,2.77,1285
30 | 1,13.87,1.9,2.8,19.4,107,2.95,2.97,.37,1.76,4.5,1.25,3.4,915
31 | 1,14.02,1.68,2.21,16,96,2.65,2.33,.26,1.98,4.7,1.04,3.59,1035
32 | 1,13.73,1.5,2.7,22.5,101,3,3.25,.29,2.38,5.7,1.19,2.71,1285
33 | 1,13.58,1.66,2.36,19.1,106,2.86,3.19,.22,1.95,6.9,1.09,2.88,1515
34 | 1,13.68,1.83,2.36,17.2,104,2.42,2.69,.42,1.97,3.84,1.23,2.87,990
35 | 1,13.76,1.53,2.7,19.5,132,2.95,2.74,.5,1.35,5.4,1.25,3,1235
36 | 1,13.51,1.8,2.65,19,110,2.35,2.53,.29,1.54,4.2,1.1,2.87,1095
37 | 1,13.48,1.81,2.41,20.5,100,2.7,2.98,.26,1.86,5.1,1.04,3.47,920
38 | 1,13.28,1.64,2.84,15.5,110,2.6,2.68,.34,1.36,4.6,1.09,2.78,880
39 | 1,13.05,1.65,2.55,18,98,2.45,2.43,.29,1.44,4.25,1.12,2.51,1105
40 | 1,13.07,1.5,2.1,15.5,98,2.4,2.64,.28,1.37,3.7,1.18,2.69,1020
41 | 1,14.22,3.99,2.51,13.2,128,3,3.04,.2,2.08,5.1,.89,3.53,760
42 | 1,13.56,1.71,2.31,16.2,117,3.15,3.29,.34,2.34,6.13,.95,3.38,795
43 | 1,13.41,3.84,2.12,18.8,90,2.45,2.68,.27,1.48,4.28,.91,3,1035
44 | 1,13.88,1.89,2.59,15,101,3.25,3.56,.17,1.7,5.43,.88,3.56,1095
45 | 1,13.24,3.98,2.29,17.5,103,2.64,2.63,.32,1.66,4.36,.82,3,680
46 | 1,13.05,1.77,2.1,17,107,3,3,.28,2.03,5.04,.88,3.35,885
47 | 1,14.21,4.04,2.44,18.9,111,2.85,2.65,.3,1.25,5.24,.87,3.33,1080
48 | 1,14.38,3.59,2.28,16,102,3.25,3.17,.27,2.19,4.9,1.04,3.44,1065
49 | 1,13.9,1.68,2.12,16,101,3.1,3.39,.21,2.14,6.1,.91,3.33,985
50 | 1,14.1,2.02,2.4,18.8,103,2.75,2.92,.32,2.38,6.2,1.07,2.75,1060
51 | 1,13.94,1.73,2.27,17.4,108,2.88,3.54,.32,2.08,8.90,1.12,3.1,1260
52 | 1,13.05,1.73,2.04,12.4,92,2.72,3.27,.17,2.91,7.2,1.12,2.91,1150
53 | 1,13.83,1.65,2.6,17.2,94,2.45,2.99,.22,2.29,5.6,1.24,3.37,1265
54 | 1,13.82,1.75,2.42,14,111,3.88,3.74,.32,1.87,7.05,1.01,3.26,1190
55 | 1,13.77,1.9,2.68,17.1,115,3,2.79,.39,1.68,6.3,1.13,2.93,1375
56 | 1,13.74,1.67,2.25,16.4,118,2.6,2.9,.21,1.62,5.85,.92,3.2,1060
57 | 1,13.56,1.73,2.46,20.5,116,2.96,2.78,.2,2.45,6.25,.98,3.03,1120
58 | 1,14.22,1.7,2.3,16.3,118,3.2,3,.26,2.03,6.38,.94,3.31,970
59 | 1,13.29,1.97,2.68,16.8,102,3,3.23,.31,1.66,6,1.07,2.84,1270
60 | 1,13.72,1.43,2.5,16.7,108,3.4,3.67,.19,2.04,6.8,.89,2.87,1285
61 | 2,12.37,.94,1.36,10.6,88,1.98,.57,.28,.42,1.95,1.05,1.82,520
62 | 2,12.33,1.1,2.28,16,101,2.05,1.09,.63,.41,3.27,1.25,1.67,680
63 | 2,12.64,1.36,2.02,16.8,100,2.02,1.41,.53,.62,5.75,.98,1.59,450
64 | 2,13.67,1.25,1.92,18,94,2.1,1.79,.32,.73,3.8,1.23,2.46,630
65 | 2,12.37,1.13,2.16,19,87,3.5,3.1,.19,1.87,4.45,1.22,2.87,420
66 | 2,12.17,1.45,2.53,19,104,1.89,1.75,.45,1.03,2.95,1.45,2.23,355
67 | 2,12.37,1.21,2.56,18.1,98,2.42,2.65,.37,2.08,4.6,1.19,2.3,678
68 | 2,13.11,1.01,1.7,15,78,2.98,3.18,.26,2.28,5.3,1.12,3.18,502
69 | 2,12.37,1.17,1.92,19.6,78,2.11,2,.27,1.04,4.68,1.12,3.48,510
70 | 2,13.34,.94,2.36,17,110,2.53,1.3,.55,.42,3.17,1.02,1.93,750
71 | 2,12.21,1.19,1.75,16.8,151,1.85,1.28,.14,2.5,2.85,1.28,3.07,718
72 | 2,12.29,1.61,2.21,20.4,103,1.1,1.02,.37,1.46,3.05,.906,1.82,870
73 | 2,13.86,1.51,2.67,25,86,2.95,2.86,.21,1.87,3.38,1.36,3.16,410
74 | 2,13.49,1.66,2.24,24,87,1.88,1.84,.27,1.03,3.74,.98,2.78,472
75 | 2,12.99,1.67,2.6,30,139,3.3,2.89,.21,1.96,3.35,1.31,3.5,985
76 | 2,11.96,1.09,2.3,21,101,3.38,2.14,.13,1.65,3.21,.99,3.13,886
77 | 2,11.66,1.88,1.92,16,97,1.61,1.57,.34,1.15,3.8,1.23,2.14,428
78 | 2,13.03,.9,1.71,16,86,1.95,2.03,.24,1.46,4.6,1.19,2.48,392
79 | 2,11.84,2.89,2.23,18,112,1.72,1.32,.43,.95,2.65,.96,2.52,500
80 | 2,12.33,.99,1.95,14.8,136,1.9,1.85,.35,2.76,3.4,1.06,2.31,750
81 | 2,12.7,3.87,2.4,23,101,2.83,2.55,.43,1.95,2.57,1.19,3.13,463
82 | 2,12,.92,2,19,86,2.42,2.26,.3,1.43,2.5,1.38,3.12,278
83 | 2,12.72,1.81,2.2,18.8,86,2.2,2.53,.26,1.77,3.9,1.16,3.14,714
84 | 2,12.08,1.13,2.51,24,78,2,1.58,.4,1.4,2.2,1.31,2.72,630
85 | 2,13.05,3.86,2.32,22.5,85,1.65,1.59,.61,1.62,4.8,.84,2.01,515
86 | 2,11.84,.89,2.58,18,94,2.2,2.21,.22,2.35,3.05,.79,3.08,520
87 | 2,12.67,.98,2.24,18,99,2.2,1.94,.3,1.46,2.62,1.23,3.16,450
88 | 2,12.16,1.61,2.31,22.8,90,1.78,1.69,.43,1.56,2.45,1.33,2.26,495
89 | 2,11.65,1.67,2.62,26,88,1.92,1.61,.4,1.34,2.6,1.36,3.21,562
90 | 2,11.64,2.06,2.46,21.6,84,1.95,1.69,.48,1.35,2.8,1,2.75,680
91 | 2,12.08,1.33,2.3,23.6,70,2.2,1.59,.42,1.38,1.74,1.07,3.21,625
92 | 2,12.08,1.83,2.32,18.5,81,1.6,1.5,.52,1.64,2.4,1.08,2.27,480
93 | 2,12,1.51,2.42,22,86,1.45,1.25,.5,1.63,3.6,1.05,2.65,450
94 | 2,12.69,1.53,2.26,20.7,80,1.38,1.46,.58,1.62,3.05,.96,2.06,495
95 | 2,12.29,2.83,2.22,18,88,2.45,2.25,.25,1.99,2.15,1.15,3.3,290
96 | 2,11.62,1.99,2.28,18,98,3.02,2.26,.17,1.35,3.25,1.16,2.96,345
97 | 2,12.47,1.52,2.2,19,162,2.5,2.27,.32,3.28,2.6,1.16,2.63,937
98 | 2,11.81,2.12,2.74,21.5,134,1.6,.99,.14,1.56,2.5,.95,2.26,625
99 | 2,12.29,1.41,1.98,16,85,2.55,2.5,.29,1.77,2.9,1.23,2.74,428
100 | 2,12.37,1.07,2.1,18.5,88,3.52,3.75,.24,1.95,4.5,1.04,2.77,660
101 | 2,12.29,3.17,2.21,18,88,2.85,2.99,.45,2.81,2.3,1.42,2.83,406
102 | 2,12.08,2.08,1.7,17.5,97,2.23,2.17,.26,1.4,3.3,1.27,2.96,710
103 | 2,12.6,1.34,1.9,18.5,88,1.45,1.36,.29,1.35,2.45,1.04,2.77,562
104 | 2,12.34,2.45,2.46,21,98,2.56,2.11,.34,1.31,2.8,.8,3.38,438
105 | 2,11.82,1.72,1.88,19.5,86,2.5,1.64,.37,1.42,2.06,.94,2.44,415
106 | 2,12.51,1.73,1.98,20.5,85,2.2,1.92,.32,1.48,2.94,1.04,3.57,672
107 | 2,12.42,2.55,2.27,22,90,1.68,1.84,.66,1.42,2.7,.86,3.3,315
108 | 2,12.25,1.73,2.12,19,80,1.65,2.03,.37,1.63,3.4,1,3.17,510
109 | 2,12.72,1.75,2.28,22.5,84,1.38,1.76,.48,1.63,3.3,.88,2.42,488
110 | 2,12.22,1.29,1.94,19,92,2.36,2.04,.39,2.08,2.7,.86,3.02,312
111 | 2,11.61,1.35,2.7,20,94,2.74,2.92,.29,2.49,2.65,.96,3.26,680
112 | 2,11.46,3.74,1.82,19.5,107,3.18,2.58,.24,3.58,2.9,.75,2.81,562
113 | 2,12.52,2.43,2.17,21,88,2.55,2.27,.26,1.22,2,.9,2.78,325
114 | 2,11.76,2.68,2.92,20,103,1.75,2.03,.6,1.05,3.8,1.23,2.5,607
115 | 2,11.41,.74,2.5,21,88,2.48,2.01,.42,1.44,3.08,1.1,2.31,434
116 | 2,12.08,1.39,2.5,22.5,84,2.56,2.29,.43,1.04,2.9,.93,3.19,385
117 | 2,11.03,1.51,2.2,21.5,85,2.46,2.17,.52,2.01,1.9,1.71,2.87,407
118 | 2,11.82,1.47,1.99,20.8,86,1.98,1.6,.3,1.53,1.95,.95,3.33,495
119 | 2,12.42,1.61,2.19,22.5,108,2,2.09,.34,1.61,2.06,1.06,2.96,345
120 | 2,12.77,3.43,1.98,16,80,1.63,1.25,.43,.83,3.4,.7,2.12,372
121 | 2,12,3.43,2,19,87,2,1.64,.37,1.87,1.28,.93,3.05,564
122 | 2,11.45,2.4,2.42,20,96,2.9,2.79,.32,1.83,3.25,.8,3.39,625
123 | 2,11.56,2.05,3.23,28.5,119,3.18,5.08,.47,1.87,6,.93,3.69,465
124 | 2,12.42,4.43,2.73,26.5,102,2.2,2.13,.43,1.71,2.08,.92,3.12,365
125 | 2,13.05,5.8,2.13,21.5,86,2.62,2.65,.3,2.01,2.6,.73,3.1,380
126 | 2,11.87,4.31,2.39,21,82,2.86,3.03,.21,2.91,2.8,.75,3.64,380
127 | 2,12.07,2.16,2.17,21,85,2.6,2.65,.37,1.35,2.76,.86,3.28,378
128 | 2,12.43,1.53,2.29,21.5,86,2.74,3.15,.39,1.77,3.94,.69,2.84,352
129 | 2,11.79,2.13,2.78,28.5,92,2.13,2.24,.58,1.76,3,.97,2.44,466
130 | 2,12.37,1.63,2.3,24.5,88,2.22,2.45,.4,1.9,2.12,.89,2.78,342
131 | 2,12.04,4.3,2.38,22,80,2.1,1.75,.42,1.35,2.6,.79,2.57,580
132 | 3,12.86,1.35,2.32,18,122,1.51,1.25,.21,.94,4.1,.76,1.29,630
133 | 3,12.88,2.99,2.4,20,104,1.3,1.22,.24,.83,5.4,.74,1.42,530
134 | 3,12.81,2.31,2.4,24,98,1.15,1.09,.27,.83,5.7,.66,1.36,560
135 | 3,12.7,3.55,2.36,21.5,106,1.7,1.2,.17,.84,5,.78,1.29,600
136 | 3,12.51,1.24,2.25,17.5,85,2,.58,.6,1.25,5.45,.75,1.51,650
137 | 3,12.6,2.46,2.2,18.5,94,1.62,.66,.63,.94,7.1,.73,1.58,695
138 | 3,12.25,4.72,2.54,21,89,1.38,.47,.53,.8,3.85,.75,1.27,720
139 | 3,12.53,5.51,2.64,25,96,1.79,.6,.63,1.1,5,.82,1.69,515
140 | 3,13.49,3.59,2.19,19.5,88,1.62,.48,.58,.88,5.7,.81,1.82,580
141 | 3,12.84,2.96,2.61,24,101,2.32,.6,.53,.81,4.92,.89,2.15,590
142 | 3,12.93,2.81,2.7,21,96,1.54,.5,.53,.75,4.6,.77,2.31,600
143 | 3,13.36,2.56,2.35,20,89,1.4,.5,.37,.64,5.6,.7,2.47,780
144 | 3,13.52,3.17,2.72,23.5,97,1.55,.52,.5,.55,4.35,.89,2.06,520
145 | 3,13.62,4.95,2.35,20,92,2,.8,.47,1.02,4.4,.91,2.05,550
146 | 3,12.25,3.88,2.2,18.5,112,1.38,.78,.29,1.14,8.21,.65,2,855
147 | 3,13.16,3.57,2.15,21,102,1.5,.55,.43,1.3,4,.6,1.68,830
148 | 3,13.88,5.04,2.23,20,80,.98,.34,.4,.68,4.9,.58,1.33,415
149 | 3,12.87,4.61,2.48,21.5,86,1.7,.65,.47,.86,7.65,.54,1.86,625
150 | 3,13.32,3.24,2.38,21.5,92,1.93,.76,.45,1.25,8.42,.55,1.62,650
151 | 3,13.08,3.9,2.36,21.5,113,1.41,1.39,.34,1.14,9.40,.57,1.33,550
152 | 3,13.5,3.12,2.62,24,123,1.4,1.57,.22,1.25,8.60,.59,1.3,500
153 | 3,12.79,2.67,2.48,22,112,1.48,1.36,.24,1.26,10.8,.48,1.47,480
154 | 3,13.11,1.9,2.75,25.5,116,2.2,1.28,.26,1.56,7.1,.61,1.33,425
155 | 3,13.23,3.3,2.28,18.5,98,1.8,.83,.61,1.87,10.52,.56,1.51,675
156 | 3,12.58,1.29,2.1,20,103,1.48,.58,.53,1.4,7.6,.58,1.55,640
157 | 3,13.17,5.19,2.32,22,93,1.74,.63,.61,1.55,7.9,.6,1.48,725
158 | 3,13.84,4.12,2.38,19.5,89,1.8,.83,.48,1.56,9.01,.57,1.64,480
159 | 3,12.45,3.03,2.64,27,97,1.9,.58,.63,1.14,7.5,.67,1.73,880
160 | 3,14.34,1.68,2.7,25,98,2.8,1.31,.53,2.7,13,.57,1.96,660
161 | 3,13.48,1.67,2.64,22.5,89,2.6,1.1,.52,2.29,11.75,.57,1.78,620
162 | 3,12.36,3.83,2.38,21,88,2.3,.92,.5,1.04,7.65,.56,1.58,520
163 | 3,13.69,3.26,2.54,20,107,1.83,.56,.5,.8,5.88,.96,1.82,680
164 | 3,12.85,3.27,2.58,22,106,1.65,.6,.6,.96,5.58,.87,2.11,570
165 | 3,12.96,3.45,2.35,18.5,106,1.39,.7,.4,.94,5.28,.68,1.75,675
166 | 3,13.78,2.76,2.3,22,90,1.35,.68,.41,1.03,9.58,.7,1.68,615
167 | 3,13.73,4.36,2.26,22.5,88,1.28,.47,.52,1.15,6.62,.78,1.75,520
168 | 3,13.45,3.7,2.6,23,111,1.7,.92,.43,1.46,10.68,.85,1.56,695
169 | 3,12.82,3.37,2.3,19.5,88,1.48,.66,.4,.97,10.26,.72,1.75,685
170 | 3,13.58,2.58,2.69,24.5,105,1.55,.84,.39,1.54,8.66,.74,1.8,750
171 | 3,13.4,4.6,2.86,25,112,1.98,.96,.27,1.11,8.5,.67,1.92,630
172 | 3,12.2,3.03,2.32,19,96,1.25,.49,.4,.73,5.5,.66,1.83,510
173 | 3,12.77,2.39,2.28,19.5,86,1.39,.51,.48,.64,9.899999,.57,1.63,470
174 | 3,14.16,2.51,2.48,20,91,1.68,.7,.44,1.24,9.7,.62,1.71,660
175 | 3,13.71,5.65,2.45,20.5,95,1.68,.61,.52,1.06,7.7,.64,1.74,740
176 | 3,13.4,3.91,2.48,23,102,1.8,.75,.43,1.41,7.3,.7,1.56,750
177 | 3,13.27,4.28,2.26,20,120,1.59,.69,.43,1.35,10.2,.59,1.56,835
178 | 3,13.17,2.59,2.37,20,120,1.65,.68,.53,1.46,9.3,.6,1.62,840
179 | 3,14.13,4.1,2.74,24.5,96,2.05,.76,.56,1.35,9.2,.61,1.6,560
180 |
--------------------------------------------------------------------------------
/model/data/.ipynb_checkpoints/wine-checkpoint.csv:
--------------------------------------------------------------------------------
1 | Type,Alcohol,Malic acid,Ash,Alcalinity of ash,Magnesium,Total phenols,Flavanoids,Nonflavanoid phenols,Proanthocyanins,Color intensity,Hue,OD280/OD315 of diluted wines,Proline
2 | 1,14.23,1.71,2.43,15.6,127,2.8,3.06,.28,2.29,5.64,1.04,3.92,1065
3 | 1,13.2,1.78,2.14,11.2,100,2.65,2.76,.26,1.28,4.38,1.05,3.4,1050
4 | 1,13.16,2.36,2.67,18.6,101,2.8,3.24,.3,2.81,5.68,1.03,3.17,1185
5 | 1,14.37,1.95,2.5,16.8,113,3.85,3.49,.24,2.18,7.8,.86,3.45,1480
6 | 1,13.24,2.59,2.87,21,118,2.8,2.69,.39,1.82,4.32,1.04,2.93,735
7 | 1,14.2,1.76,2.45,15.2,112,3.27,3.39,.34,1.97,6.75,1.05,2.85,1450
8 | 1,14.39,1.87,2.45,14.6,96,2.5,2.52,.3,1.98,5.25,1.02,3.58,1290
9 | 1,14.06,2.15,2.61,17.6,121,2.6,2.51,.31,1.25,5.05,1.06,3.58,1295
10 | 1,14.83,1.64,2.17,14,97,2.8,2.98,.29,1.98,5.2,1.08,2.85,1045
11 | 1,13.86,1.35,2.27,16,98,2.98,3.15,.22,1.85,7.22,1.01,3.55,1045
12 | 1,14.1,2.16,2.3,18,105,2.95,3.32,.22,2.38,5.75,1.25,3.17,1510
13 | 1,14.12,1.48,2.32,16.8,95,2.2,2.43,.26,1.57,5,1.17,2.82,1280
14 | 1,13.75,1.73,2.41,16,89,2.6,2.76,.29,1.81,5.6,1.15,2.9,1320
15 | 1,14.75,1.73,2.39,11.4,91,3.1,3.69,.43,2.81,5.4,1.25,2.73,1150
16 | 1,14.38,1.87,2.38,12,102,3.3,3.64,.29,2.96,7.5,1.2,3,1547
17 | 1,13.63,1.81,2.7,17.2,112,2.85,2.91,.3,1.46,7.3,1.28,2.88,1310
18 | 1,14.3,1.92,2.72,20,120,2.8,3.14,.33,1.97,6.2,1.07,2.65,1280
19 | 1,13.83,1.57,2.62,20,115,2.95,3.4,.4,1.72,6.6,1.13,2.57,1130
20 | 1,14.19,1.59,2.48,16.5,108,3.3,3.93,.32,1.86,8.7,1.23,2.82,1680
21 | 1,13.64,3.1,2.56,15.2,116,2.7,3.03,.17,1.66,5.1,.96,3.36,845
22 | 1,14.06,1.63,2.28,16,126,3,3.17,.24,2.1,5.65,1.09,3.71,780
23 | 1,12.93,3.8,2.65,18.6,102,2.41,2.41,.25,1.98,4.5,1.03,3.52,770
24 | 1,13.71,1.86,2.36,16.6,101,2.61,2.88,.27,1.69,3.8,1.11,4,1035
25 | 1,12.85,1.6,2.52,17.8,95,2.48,2.37,.26,1.46,3.93,1.09,3.63,1015
26 | 1,13.5,1.81,2.61,20,96,2.53,2.61,.28,1.66,3.52,1.12,3.82,845
27 | 1,13.05,2.05,3.22,25,124,2.63,2.68,.47,1.92,3.58,1.13,3.2,830
28 | 1,13.39,1.77,2.62,16.1,93,2.85,2.94,.34,1.45,4.8,.92,3.22,1195
29 | 1,13.3,1.72,2.14,17,94,2.4,2.19,.27,1.35,3.95,1.02,2.77,1285
30 | 1,13.87,1.9,2.8,19.4,107,2.95,2.97,.37,1.76,4.5,1.25,3.4,915
31 | 1,14.02,1.68,2.21,16,96,2.65,2.33,.26,1.98,4.7,1.04,3.59,1035
32 | 1,13.73,1.5,2.7,22.5,101,3,3.25,.29,2.38,5.7,1.19,2.71,1285
33 | 1,13.58,1.66,2.36,19.1,106,2.86,3.19,.22,1.95,6.9,1.09,2.88,1515
34 | 1,13.68,1.83,2.36,17.2,104,2.42,2.69,.42,1.97,3.84,1.23,2.87,990
35 | 1,13.76,1.53,2.7,19.5,132,2.95,2.74,.5,1.35,5.4,1.25,3,1235
36 | 1,13.51,1.8,2.65,19,110,2.35,2.53,.29,1.54,4.2,1.1,2.87,1095
37 | 1,13.48,1.81,2.41,20.5,100,2.7,2.98,.26,1.86,5.1,1.04,3.47,920
38 | 1,13.28,1.64,2.84,15.5,110,2.6,2.68,.34,1.36,4.6,1.09,2.78,880
39 | 1,13.05,1.65,2.55,18,98,2.45,2.43,.29,1.44,4.25,1.12,2.51,1105
40 | 1,13.07,1.5,2.1,15.5,98,2.4,2.64,.28,1.37,3.7,1.18,2.69,1020
41 | 1,14.22,3.99,2.51,13.2,128,3,3.04,.2,2.08,5.1,.89,3.53,760
42 | 1,13.56,1.71,2.31,16.2,117,3.15,3.29,.34,2.34,6.13,.95,3.38,795
43 | 1,13.41,3.84,2.12,18.8,90,2.45,2.68,.27,1.48,4.28,.91,3,1035
44 | 1,13.88,1.89,2.59,15,101,3.25,3.56,.17,1.7,5.43,.88,3.56,1095
45 | 1,13.24,3.98,2.29,17.5,103,2.64,2.63,.32,1.66,4.36,.82,3,680
46 | 1,13.05,1.77,2.1,17,107,3,3,.28,2.03,5.04,.88,3.35,885
47 | 1,14.21,4.04,2.44,18.9,111,2.85,2.65,.3,1.25,5.24,.87,3.33,1080
48 | 1,14.38,3.59,2.28,16,102,3.25,3.17,.27,2.19,4.9,1.04,3.44,1065
49 | 1,13.9,1.68,2.12,16,101,3.1,3.39,.21,2.14,6.1,.91,3.33,985
50 | 1,14.1,2.02,2.4,18.8,103,2.75,2.92,.32,2.38,6.2,1.07,2.75,1060
51 | 1,13.94,1.73,2.27,17.4,108,2.88,3.54,.32,2.08,8.90,1.12,3.1,1260
52 | 1,13.05,1.73,2.04,12.4,92,2.72,3.27,.17,2.91,7.2,1.12,2.91,1150
53 | 1,13.83,1.65,2.6,17.2,94,2.45,2.99,.22,2.29,5.6,1.24,3.37,1265
54 | 1,13.82,1.75,2.42,14,111,3.88,3.74,.32,1.87,7.05,1.01,3.26,1190
55 | 1,13.77,1.9,2.68,17.1,115,3,2.79,.39,1.68,6.3,1.13,2.93,1375
56 | 1,13.74,1.67,2.25,16.4,118,2.6,2.9,.21,1.62,5.85,.92,3.2,1060
57 | 1,13.56,1.73,2.46,20.5,116,2.96,2.78,.2,2.45,6.25,.98,3.03,1120
58 | 1,14.22,1.7,2.3,16.3,118,3.2,3,.26,2.03,6.38,.94,3.31,970
59 | 1,13.29,1.97,2.68,16.8,102,3,3.23,.31,1.66,6,1.07,2.84,1270
60 | 1,13.72,1.43,2.5,16.7,108,3.4,3.67,.19,2.04,6.8,.89,2.87,1285
61 | 2,12.37,.94,1.36,10.6,88,1.98,.57,.28,.42,1.95,1.05,1.82,520
62 | 2,12.33,1.1,2.28,16,101,2.05,1.09,.63,.41,3.27,1.25,1.67,680
63 | 2,12.64,1.36,2.02,16.8,100,2.02,1.41,.53,.62,5.75,.98,1.59,450
64 | 2,13.67,1.25,1.92,18,94,2.1,1.79,.32,.73,3.8,1.23,2.46,630
65 | 2,12.37,1.13,2.16,19,87,3.5,3.1,.19,1.87,4.45,1.22,2.87,420
66 | 2,12.17,1.45,2.53,19,104,1.89,1.75,.45,1.03,2.95,1.45,2.23,355
67 | 2,12.37,1.21,2.56,18.1,98,2.42,2.65,.37,2.08,4.6,1.19,2.3,678
68 | 2,13.11,1.01,1.7,15,78,2.98,3.18,.26,2.28,5.3,1.12,3.18,502
69 | 2,12.37,1.17,1.92,19.6,78,2.11,2,.27,1.04,4.68,1.12,3.48,510
70 | 2,13.34,.94,2.36,17,110,2.53,1.3,.55,.42,3.17,1.02,1.93,750
71 | 2,12.21,1.19,1.75,16.8,151,1.85,1.28,.14,2.5,2.85,1.28,3.07,718
72 | 2,12.29,1.61,2.21,20.4,103,1.1,1.02,.37,1.46,3.05,.906,1.82,870
73 | 2,13.86,1.51,2.67,25,86,2.95,2.86,.21,1.87,3.38,1.36,3.16,410
74 | 2,13.49,1.66,2.24,24,87,1.88,1.84,.27,1.03,3.74,.98,2.78,472
75 | 2,12.99,1.67,2.6,30,139,3.3,2.89,.21,1.96,3.35,1.31,3.5,985
76 | 2,11.96,1.09,2.3,21,101,3.38,2.14,.13,1.65,3.21,.99,3.13,886
77 | 2,11.66,1.88,1.92,16,97,1.61,1.57,.34,1.15,3.8,1.23,2.14,428
78 | 2,13.03,.9,1.71,16,86,1.95,2.03,.24,1.46,4.6,1.19,2.48,392
79 | 2,11.84,2.89,2.23,18,112,1.72,1.32,.43,.95,2.65,.96,2.52,500
80 | 2,12.33,.99,1.95,14.8,136,1.9,1.85,.35,2.76,3.4,1.06,2.31,750
81 | 2,12.7,3.87,2.4,23,101,2.83,2.55,.43,1.95,2.57,1.19,3.13,463
82 | 2,12,.92,2,19,86,2.42,2.26,.3,1.43,2.5,1.38,3.12,278
83 | 2,12.72,1.81,2.2,18.8,86,2.2,2.53,.26,1.77,3.9,1.16,3.14,714
84 | 2,12.08,1.13,2.51,24,78,2,1.58,.4,1.4,2.2,1.31,2.72,630
85 | 2,13.05,3.86,2.32,22.5,85,1.65,1.59,.61,1.62,4.8,.84,2.01,515
86 | 2,11.84,.89,2.58,18,94,2.2,2.21,.22,2.35,3.05,.79,3.08,520
87 | 2,12.67,.98,2.24,18,99,2.2,1.94,.3,1.46,2.62,1.23,3.16,450
88 | 2,12.16,1.61,2.31,22.8,90,1.78,1.69,.43,1.56,2.45,1.33,2.26,495
89 | 2,11.65,1.67,2.62,26,88,1.92,1.61,.4,1.34,2.6,1.36,3.21,562
90 | 2,11.64,2.06,2.46,21.6,84,1.95,1.69,.48,1.35,2.8,1,2.75,680
91 | 2,12.08,1.33,2.3,23.6,70,2.2,1.59,.42,1.38,1.74,1.07,3.21,625
92 | 2,12.08,1.83,2.32,18.5,81,1.6,1.5,.52,1.64,2.4,1.08,2.27,480
93 | 2,12,1.51,2.42,22,86,1.45,1.25,.5,1.63,3.6,1.05,2.65,450
94 | 2,12.69,1.53,2.26,20.7,80,1.38,1.46,.58,1.62,3.05,.96,2.06,495
95 | 2,12.29,2.83,2.22,18,88,2.45,2.25,.25,1.99,2.15,1.15,3.3,290
96 | 2,11.62,1.99,2.28,18,98,3.02,2.26,.17,1.35,3.25,1.16,2.96,345
97 | 2,12.47,1.52,2.2,19,162,2.5,2.27,.32,3.28,2.6,1.16,2.63,937
98 | 2,11.81,2.12,2.74,21.5,134,1.6,.99,.14,1.56,2.5,.95,2.26,625
99 | 2,12.29,1.41,1.98,16,85,2.55,2.5,.29,1.77,2.9,1.23,2.74,428
100 | 2,12.37,1.07,2.1,18.5,88,3.52,3.75,.24,1.95,4.5,1.04,2.77,660
101 | 2,12.29,3.17,2.21,18,88,2.85,2.99,.45,2.81,2.3,1.42,2.83,406
102 | 2,12.08,2.08,1.7,17.5,97,2.23,2.17,.26,1.4,3.3,1.27,2.96,710
103 | 2,12.6,1.34,1.9,18.5,88,1.45,1.36,.29,1.35,2.45,1.04,2.77,562
104 | 2,12.34,2.45,2.46,21,98,2.56,2.11,.34,1.31,2.8,.8,3.38,438
105 | 2,11.82,1.72,1.88,19.5,86,2.5,1.64,.37,1.42,2.06,.94,2.44,415
106 | 2,12.51,1.73,1.98,20.5,85,2.2,1.92,.32,1.48,2.94,1.04,3.57,672
107 | 2,12.42,2.55,2.27,22,90,1.68,1.84,.66,1.42,2.7,.86,3.3,315
108 | 2,12.25,1.73,2.12,19,80,1.65,2.03,.37,1.63,3.4,1,3.17,510
109 | 2,12.72,1.75,2.28,22.5,84,1.38,1.76,.48,1.63,3.3,.88,2.42,488
110 | 2,12.22,1.29,1.94,19,92,2.36,2.04,.39,2.08,2.7,.86,3.02,312
111 | 2,11.61,1.35,2.7,20,94,2.74,2.92,.29,2.49,2.65,.96,3.26,680
112 | 2,11.46,3.74,1.82,19.5,107,3.18,2.58,.24,3.58,2.9,.75,2.81,562
113 | 2,12.52,2.43,2.17,21,88,2.55,2.27,.26,1.22,2,.9,2.78,325
114 | 2,11.76,2.68,2.92,20,103,1.75,2.03,.6,1.05,3.8,1.23,2.5,607
115 | 2,11.41,.74,2.5,21,88,2.48,2.01,.42,1.44,3.08,1.1,2.31,434
116 | 2,12.08,1.39,2.5,22.5,84,2.56,2.29,.43,1.04,2.9,.93,3.19,385
117 | 2,11.03,1.51,2.2,21.5,85,2.46,2.17,.52,2.01,1.9,1.71,2.87,407
118 | 2,11.82,1.47,1.99,20.8,86,1.98,1.6,.3,1.53,1.95,.95,3.33,495
119 | 2,12.42,1.61,2.19,22.5,108,2,2.09,.34,1.61,2.06,1.06,2.96,345
120 | 2,12.77,3.43,1.98,16,80,1.63,1.25,.43,.83,3.4,.7,2.12,372
121 | 2,12,3.43,2,19,87,2,1.64,.37,1.87,1.28,.93,3.05,564
122 | 2,11.45,2.4,2.42,20,96,2.9,2.79,.32,1.83,3.25,.8,3.39,625
123 | 2,11.56,2.05,3.23,28.5,119,3.18,5.08,.47,1.87,6,.93,3.69,465
124 | 2,12.42,4.43,2.73,26.5,102,2.2,2.13,.43,1.71,2.08,.92,3.12,365
125 | 2,13.05,5.8,2.13,21.5,86,2.62,2.65,.3,2.01,2.6,.73,3.1,380
126 | 2,11.87,4.31,2.39,21,82,2.86,3.03,.21,2.91,2.8,.75,3.64,380
127 | 2,12.07,2.16,2.17,21,85,2.6,2.65,.37,1.35,2.76,.86,3.28,378
128 | 2,12.43,1.53,2.29,21.5,86,2.74,3.15,.39,1.77,3.94,.69,2.84,352
129 | 2,11.79,2.13,2.78,28.5,92,2.13,2.24,.58,1.76,3,.97,2.44,466
130 | 2,12.37,1.63,2.3,24.5,88,2.22,2.45,.4,1.9,2.12,.89,2.78,342
131 | 2,12.04,4.3,2.38,22,80,2.1,1.75,.42,1.35,2.6,.79,2.57,580
132 | 3,12.86,1.35,2.32,18,122,1.51,1.25,.21,.94,4.1,.76,1.29,630
133 | 3,12.88,2.99,2.4,20,104,1.3,1.22,.24,.83,5.4,.74,1.42,530
134 | 3,12.81,2.31,2.4,24,98,1.15,1.09,.27,.83,5.7,.66,1.36,560
135 | 3,12.7,3.55,2.36,21.5,106,1.7,1.2,.17,.84,5,.78,1.29,600
136 | 3,12.51,1.24,2.25,17.5,85,2,.58,.6,1.25,5.45,.75,1.51,650
137 | 3,12.6,2.46,2.2,18.5,94,1.62,.66,.63,.94,7.1,.73,1.58,695
138 | 3,12.25,4.72,2.54,21,89,1.38,.47,.53,.8,3.85,.75,1.27,720
139 | 3,12.53,5.51,2.64,25,96,1.79,.6,.63,1.1,5,.82,1.69,515
140 | 3,13.49,3.59,2.19,19.5,88,1.62,.48,.58,.88,5.7,.81,1.82,580
141 | 3,12.84,2.96,2.61,24,101,2.32,.6,.53,.81,4.92,.89,2.15,590
142 | 3,12.93,2.81,2.7,21,96,1.54,.5,.53,.75,4.6,.77,2.31,600
143 | 3,13.36,2.56,2.35,20,89,1.4,.5,.37,.64,5.6,.7,2.47,780
144 | 3,13.52,3.17,2.72,23.5,97,1.55,.52,.5,.55,4.35,.89,2.06,520
145 | 3,13.62,4.95,2.35,20,92,2,.8,.47,1.02,4.4,.91,2.05,550
146 | 3,12.25,3.88,2.2,18.5,112,1.38,.78,.29,1.14,8.21,.65,2,855
147 | 3,13.16,3.57,2.15,21,102,1.5,.55,.43,1.3,4,.6,1.68,830
148 | 3,13.88,5.04,2.23,20,80,.98,.34,.4,.68,4.9,.58,1.33,415
149 | 3,12.87,4.61,2.48,21.5,86,1.7,.65,.47,.86,7.65,.54,1.86,625
150 | 3,13.32,3.24,2.38,21.5,92,1.93,.76,.45,1.25,8.42,.55,1.62,650
151 | 3,13.08,3.9,2.36,21.5,113,1.41,1.39,.34,1.14,9.40,.57,1.33,550
152 | 3,13.5,3.12,2.62,24,123,1.4,1.57,.22,1.25,8.60,.59,1.3,500
153 | 3,12.79,2.67,2.48,22,112,1.48,1.36,.24,1.26,10.8,.48,1.47,480
154 | 3,13.11,1.9,2.75,25.5,116,2.2,1.28,.26,1.56,7.1,.61,1.33,425
155 | 3,13.23,3.3,2.28,18.5,98,1.8,.83,.61,1.87,10.52,.56,1.51,675
156 | 3,12.58,1.29,2.1,20,103,1.48,.58,.53,1.4,7.6,.58,1.55,640
157 | 3,13.17,5.19,2.32,22,93,1.74,.63,.61,1.55,7.9,.6,1.48,725
158 | 3,13.84,4.12,2.38,19.5,89,1.8,.83,.48,1.56,9.01,.57,1.64,480
159 | 3,12.45,3.03,2.64,27,97,1.9,.58,.63,1.14,7.5,.67,1.73,880
160 | 3,14.34,1.68,2.7,25,98,2.8,1.31,.53,2.7,13,.57,1.96,660
161 | 3,13.48,1.67,2.64,22.5,89,2.6,1.1,.52,2.29,11.75,.57,1.78,620
162 | 3,12.36,3.83,2.38,21,88,2.3,.92,.5,1.04,7.65,.56,1.58,520
163 | 3,13.69,3.26,2.54,20,107,1.83,.56,.5,.8,5.88,.96,1.82,680
164 | 3,12.85,3.27,2.58,22,106,1.65,.6,.6,.96,5.58,.87,2.11,570
165 | 3,12.96,3.45,2.35,18.5,106,1.39,.7,.4,.94,5.28,.68,1.75,675
166 | 3,13.78,2.76,2.3,22,90,1.35,.68,.41,1.03,9.58,.7,1.68,615
167 | 3,13.73,4.36,2.26,22.5,88,1.28,.47,.52,1.15,6.62,.78,1.75,520
168 | 3,13.45,3.7,2.6,23,111,1.7,.92,.43,1.46,10.68,.85,1.56,695
169 | 3,12.82,3.37,2.3,19.5,88,1.48,.66,.4,.97,10.26,.72,1.75,685
170 | 3,13.58,2.58,2.69,24.5,105,1.55,.84,.39,1.54,8.66,.74,1.8,750
171 | 3,13.4,4.6,2.86,25,112,1.98,.96,.27,1.11,8.5,.67,1.92,630
172 | 3,12.2,3.03,2.32,19,96,1.25,.49,.4,.73,5.5,.66,1.83,510
173 | 3,12.77,2.39,2.28,19.5,86,1.39,.51,.48,.64,9.899999,.57,1.63,470
174 | 3,14.16,2.51,2.48,20,91,1.68,.7,.44,1.24,9.7,.62,1.71,660
175 | 3,13.71,5.65,2.45,20.5,95,1.68,.61,.52,1.06,7.7,.64,1.74,740
176 | 3,13.4,3.91,2.48,23,102,1.8,.75,.43,1.41,7.3,.7,1.56,750
177 | 3,13.27,4.28,2.26,20,120,1.59,.69,.43,1.35,10.2,.59,1.56,835
178 | 3,13.17,2.59,2.37,20,120,1.65,.68,.53,1.46,9.3,.6,1.62,840
179 | 3,14.13,4.1,2.74,24.5,96,2.05,.76,.56,1.35,9.2,.61,1.6,560
180 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/model/src/app.js:
--------------------------------------------------------------------------------
1 | import "@babel/polyfill";
2 | import * as tf from '@tensorflow/tfjs';
3 |
4 | /**
5 | * Convert an array to tensorflow matrix
6 | * @param {Array} value array like [[1,2,3,4]]
7 | * @param {Number} row row count of the matrix, if <=0 means auto
8 | * @param {Number} col column count of the matrix, if <=0 means auto
9 | */
10 | function arrayToMatrix(value, row = -1, col = -1) {
11 | if (row <= 0) {
12 | row = value.length;
13 | }
14 | if (col <= 0) {
15 | col = value.map(
16 | row => row.length
17 | ).reduce(
18 | (a, b) => Math.max(a, b)
19 | );
20 | }
21 | return tf.tensor2d(value, [row, col]);
22 | }
23 |
24 | let modelLoaded = undefined;
25 |
26 | const GLOBAL = Function("return this")();
27 |
28 | GLOBAL.isLoaded = function() {
29 | return typeof modelLoaded !== "undefined";
30 | }
31 |
32 | /**
33 | * Predict Function
34 | * @param {*} input_data Input data (maybe a matrix)
35 | */
36 | GLOBAL.predict = function (input_data) {
37 | if (!isLoaded()) {
38 | console.log("Model not prepared yet.")
39 | throw Error("Model not prepared yet.");
40 | }
41 | const array = [];
42 | modelLoaded.predict(
43 | arrayToMatrix(
44 | input_data
45 | )
46 | ).dataSync().forEach(
47 | x => {
48 | array.push(x)
49 | }
50 | );
51 | return [array];
52 | }
53 |
54 | tf.models.modelFromJSON(
55 | {"class_name":"Sequential","config":[{"class_name":"Dense","config":{"units":60,"activation":"sigmoid","use_bias":true,"kernel_initializer":{"class_name":"RandomUniform","config":{"minval":-0.05,"maxval":0.05,"seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_1","trainable":true,"batch_input_shape":[null,13],"dtype":"float32"}},{"class_name":"Dense","config":{"units":3,"activation":"softmax","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"uniform","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_2","trainable":true}}],"keras_version":"tfjs-layers 0.9.1","backend":"tensor_flow.js"}
56 | ).then(
57 | model => {
58 | model.setWeights([
59 | tf.tensor([-0.021056044846773148,-0.014577172696590424,0.0720711201429367,0.03756479546427727,0.055333830416202545,0.010612848214805126,0.01051992829889059,-0.009342617355287075,0.05250054970383644,-0.007788635790348053,0.1431025266647339,-0.00140042242128402,-0.0818636417388916,0.020150987431406975,0.12428591400384903,0.04719694331288338,-0.22246380150318146,-0.049321576952934265,-0.02204292081296444,0.05856313183903694,0.0077340141870081425,0.004248766228556633,-0.05110308900475502,0.00013767062046099454,-0.0783349797129631,-0.04641314223408699,-0.31617775559425354,0.026500480249524117,0.04136627912521362,0.036764439195394516,0.043444354087114334,-0.02714921347796917,-0.022775139659643173,-0.03802571818232536,0.12819279730319977,-0.0569247268140316,-0.010954746976494789,-0.04722165688872337,-0.011439396999776363,-0.04649980366230011,0.0425630621612072,-0.07054759562015533,-0.02585301175713539,0.12211961299180984,-0.06820251047611237,-0.06740126758813858,0.11005494743585587,0.02077459916472435,0.01496984250843525,0.0372060164809227,-0.048263534903526306,-0.009126266464591026,0.020650621503591537,-0.1067240983247757,0.033644307404756546,-0.09009963274002075,-0.18056271970272064,0.035460006445646286,0.22117790579795837,0.027822112664580345,0.041089825332164764,-0.03147904574871063,-0.5816784501075745,-0.014203730039298534,0.05216978117823601,-0.07214958965778351,-0.05107567086815834,-0.037678446620702744,0.00733117526397109,0.01520574651658535,0.0872785821557045,0.04955574870109558,0.0025634735357016325,0.016232216730713844,-0.6601211428642273,0.0364169105887413,0.2790226936340332,-0.0571998655796051,-0.007583477534353733,-0.5336252450942993,0.031871844083070755,0.013908232562243938,-0.004981649573892355,-0.04573231562972069,0.5470336079597473,0.014975262805819511,0.16683416068553925,0.41825637221336365,0.06733187288045883,0.0011657783761620522,0.043028824031353,0.0020412581507116556,-0.027276458218693733,-0.06972115486860275,-0.33119404315948486,0.4251951575279236,0.016760818660259247,0.01892831176519394,0.014600694179534912,-0.025195838883519173,0.0026092915795743465,0.028235455974936485,0.019220519810914993,0.04329271987080574,-0.05054245889186859,0.4755302667617798,-0.3045811057090759,-0.009784688241779804,-0.019952043890953064,0.00914226844906807,-0.016319820657372475,-0.011221705935895443,-0.006118347868323326,0.10965131968259811,0.06365571171045303,0.6705477833747864,0.3956843614578247,0.042350415140390396,-0.16981415450572968,0.05764627829194069,-0.017608892172574997,0.008697415702044964,-0.15415965020656586,-0.02017456293106079,0.05673418939113617,0.01569727435708046,-0.013908409513533115,-0.03147803619503975,0.01573275960981846,0.018425658345222473,-0.03482804819941521,0.005577599164098501,-0.07431681454181671,0.03444990515708923,-0.07282658666372299,0.04944104328751564,-0.011475764214992523,0.0025239093229174614,0.025798581540584564,-0.06544055044651031,0.06256423890590668,0.028879810124635696,-0.06919029355049133,-0.048723310232162476,0.15469278395175934,0.0018287173006683588,0.007963244803249836,0.07882870733737946,0.005665586329996586,0.07130764424800873,0.03431669622659683,0.023734448477625847,0.0038430083077400923,-0.08931470662355423,-0.028740378096699715,0.12328054755926132,-0.037015400826931,-0.04577546566724777,-0.04435225948691368,-0.05246516689658165,0.005647801794111729,-0.007647083606570959,-0.04107373580336571,-0.07152193784713745,-0.026965145021677017,0.06618767231702805,0.05979319289326668,-0.008137286640703678,0.049696970731019974,0.026086900383234024,-0.01660279370844364,-0.010693750344216824,0.04075724259018898,0.008825731463730335,0.059355005621910095,0.1287986785173416,0.0471222810447216,-0.031258586794137955,0.015065740793943405,-0.02287980355322361,-0.08132979273796082,-0.01618698611855507,-0.10246141254901886,0.015476292930543423,0.034429896622896194,-0.016335437074303627,0.04771573469042778,-0.020371712744235992,0.04365574195981026,0.04250698164105415,0.3419629633426666,0.08086830377578735,-0.07251127809286118,0.02759259194135666,0.20245257019996643,-0.000711092900019139,-0.20127561688423157,-0.015291146002709866,0.04918479919433594,0.49838849902153015,0.031832605600357056,0.0003915854904334992,-0.016048941761255264,0.03223727270960808,0.031092112883925438,-0.0349942147731781,-0.41855159401893616,0.1489357203245163,0.005073936656117439,0.0388793908059597,-0.008069471456110477,0.0018530016532167792,-0.0435536652803421,-0.026311025023460388,0.380520224571228,0.07967018336057663,-0.05353626608848572,-0.009626335464417934,-0.0023398883640766144,-0.0021852501668035984,0.006556833628565073,-0.06275463104248047,0.04130552336573601,0.2655917704105377,-0.0457727275788784,-0.5136157274246216,0.3884669244289398,-0.03939005732536316,0.007099721115082502,0.05853767320513725,0.03799138218164444,0.06171078234910965,0.04319723695516586,-0.3832164406776428,0.013775637373328209,-0.11349339783191681,-0.08452729880809784,0.0012881397269666195,0.16881290078163147,0.06819360703229904,0.024944189935922623,0.047961924225091934,0.01380886323750019,0.037899088114500046,0.0015245608519762754,-0.013269596733152866,-0.020450830459594727,0.01586988754570484,0.04811789467930794,0.04824450984597206,-0.03336939588189125,0.011984867975115776,-0.06115313991904259,-0.010457100346684456,0.0042232489213347435,0.0724499523639679,-0.031994760036468506,-0.026623232290148735,0.04185906797647476,0.026193609461188316,-0.004607465583831072,-0.07766104489564896,-0.06794790178537369,0.049310702830553055,0.0026388398837298155,-0.009144311770796776,0.008022014051675797,-0.021066686138510704,-0.004260621033608913,0.00041662619332782924,0.010313274338841438,-0.010084367357194424,-0.06093709170818329,-0.0373181477189064,0.0836629569530487,-0.02351517230272293,-0.06523098796606064,-0.005293250549584627,-0.028696496039628983,-0.06236852705478668,0.045463576912879944,-0.08039940893650055,-0.01425135601311922,-0.0030716462060809135,0.0035409778356552124,-0.06397753953933716,0.10439349710941315,0.04121661186218262,0.017017925158143044,0.008435393683612347,-0.002461589640006423,0.044686924666166306,-0.025449564680457115,-0.10613413155078888,0.07263689488172531,-0.01931707188487053,-0.08347635716199875,0.030540315434336662,0.11847925186157227,0.04658079892396927,-0.04523242637515068,-0.02810749039053917,0.4244759678840637,0.003136580577120185,-0.08090659230947495,-0.014483578503131866,0.07178129255771637,0.031434912234544754,0.02485468052327633,0.01999763771891594,-0.31260946393013,0.015450569801032543,-0.15212157368659973,0.017298150807619095,0.20150017738342285,-0.013625847175717354,-0.2622899115085602,-0.06923958659172058,-0.040599483996629715,-0.19237564504146576,0.02581716701388359,-0.020667143166065216,-0.0659412071108818,-0.041409216821193695,-0.35740330815315247,-0.04708688333630562,0.11863774061203003,-0.5499024987220764,0.034396812319755554,0.00860784761607647,0.03461539000272751,0.007314556743949652,-0.06495105475187302,-0.10083331912755966,0.07909708470106125,-0.45838791131973267,0.015296385623514652,0.0021829979959875345,0.034730613231658936,-0.01322104036808014,-0.0009044571779668331,-0.0025545298121869564,-0.02581687457859516,-0.4031813442707062,-0.06401700526475906,0.07337319850921631,0.012978323735296726,-0.048723120242357254,0.03717688098549843,0.0015203147195279598,-0.00696794968098402,0.0422724224627018,-0.0025242685806006193,-0.04521959647536278,0.005575785879045725,-0.33037543296813965,-0.21430914103984833,0.02302418276667595,0.29167357087135315,0.04397398605942726,-0.015510283410549164,-0.027412772178649902,1.450778603553772,-0.03725779429078102,-0.026610657572746277,0.0010965792462229729,0.14907251298427582,-0.03779450058937073,0.002889714203774929,-0.029248178005218506,-1.0029312372207642,0.008942946791648865,-0.29066577553749084,-0.005867110565304756,0.34170016646385193,0.04050574451684952,-0.1998898833990097,-0.042021118104457855,-0.03102889284491539,-0.727446973323822,0.03057081438601017,-0.04282774776220322,0.01640963740646839,-0.011533004231750965,-1.2638237476348877,-0.0036846997682005167,0.735418975353241,-1.5602216720581055,-0.013666313141584396,0.049459412693977356,0.07194031774997711,-0.06509029865264893,0.0023664478212594986,-0.0906665027141571,-0.27420708537101746,-1.697834849357605,-0.06422796100378036,0.013510551303625107,0.06969001889228821,-0.049743860960006714,0.04695696383714676,-0.04052193462848663,-0.01881594955921173,-1.0715794563293457,-0.052047714591026306,0.5620391964912415,-0.3997107446193695,-0.029195161536335945,0.00416022352874279,0.047438837587833405,-0.02336294576525688,0.07045122981071472,-0.017008699476718903,0.4916137754917145,0.02308289147913456,-0.6954506635665894,-0.430851548910141,0.031697217375040054,0.39948800206184387,-0.0157479140907526,0.01757887192070484,0.0014695811551064253,0.09009510278701782,-0.04206011816859245,0.03959645330905914,-0.06525818258523941,-0.04157913103699684,0.04174857214093208,0.03053142875432968,0.046513061970472336,0.39445075392723083,-0.021371155977249146,-0.0530693456530571,-0.0003793676442001015,0.2538014054298401,0.06394477933645248,-0.3703644871711731,-0.016694189980626106,0.03975014388561249,0.5579614043235779,0.04944591596722603,-0.02677888423204422,0.058927327394485474,0.0011476464569568634,-0.029818963259458542,0.03047405555844307,-0.7078211307525635,0.15216395258903503,-0.006991569884121418,0.0034869203809648752,0.022344164550304413,-0.0045562488958239555,-0.012790200300514698,-0.014500082470476627,0.104396291077137,-0.0446583591401577,-0.014299611561000347,-0.04746982455253601,-0.061801861971616745,-0.022402597591280937,0.0025975569151341915,0.000795049243606627,0.010137932375073433,0.5392898321151733,-0.06291737407445908,-0.18455110490322113,0.12924827635288239,-0.0003759156388696283,0.015537528321146965,0.04436205327510834,0.04214929789304733,0.036817409098148346,0.021887371316552162,-0.19678479433059692,0.05148925259709358,-0.24694018065929413,-0.292468398809433,0.05000948905944824,0.3440009355545044,-0.008412307128310204,-0.05981961265206337,-0.029839107766747475,0.8002030849456787,0.03925173357129097,0.008137512020766735,-0.015017475001513958,0.1329464465379715,-0.004515817388892174,-0.03761224076151848,-0.04450296610593796,-0.4151661694049835,-0.02043270319700241,-0.14779618382453918,0.046634431928396225,0.40514200925827026,0.02750159613788128,-0.29111889004707336,-0.015728943049907684,0.020013920962810516,-0.11731402575969696,0.04013973847031593,0.020738545805215836,-0.03566383570432663,0.03580887243151665,-0.6726241111755371,-0.07059834897518158,0.187076598405838,-0.8490246534347534,-0.013227722607553005,0.022620469331741333,-0.004083079285919666,-0.06163383647799492,-0.001427904819138348,-0.10550086945295334,0.01971580646932125,-0.8052213788032532,-0.015094851143658161,-0.006324695888906717,0.04361899942159653,-0.03489641100168228,0.020343631505966187,-0.040935270488262177,-0.029546158388257027,-0.49114763736724854,-0.05344165116548538,0.10102232545614243,0.01744081638753414,0.01387824583798647,-0.011680091731250286,-0.020911889150738716,0.0073126135393977165,0.0405685156583786,0.015730129554867744,0.04717463627457619,0.0639781504869461,-0.4636725187301636,-0.53641676902771,-0.03203793987631798,0.38564616441726685,0.010139652527868748,0.017438476905226707,0.023517584428191185,-0.783304750919342,-0.0031062995549291372,0.009047997184097767,0.02272156812250614,-0.0649132952094078,-0.03085772879421711,0.004307545721530914,0.013706336729228497,0.4826485216617584,0.021783728152513504,0.10265670716762543,0.0392187274992466,-0.7366588711738586,0.0706123560667038,0.32570457458496094,-0.061584632843732834,0.047782253473997116,-0.12703129649162292,0.06166009232401848,0.03381972014904022,0.06900963932275772,-0.027475185692310333,0.7235979437828064,-0.045393090695142746,-0.2959349453449249,0.5951822400093079,0.07214636355638504,0.07045252621173859,-0.01757403463125229,-0.008991374634206295,-0.025295935571193695,-0.07080432027578354,-0.34368181228637695,0.6150028705596924,-0.06153139844536781,-0.039399344474077225,-0.040516577661037445,-0.05931438133120537,0.01274136546999216,-0.03013615310192108,0.0028757979162037373,0.4192968010902405,0.00747917452827096,0.18513154983520508,-0.21358580887317657,-0.02734067663550377,-0.030008459463715553,0.018393121659755707,0.045272693037986755,0.07864547520875931,-0.028562551364302635,0.10778562724590302,0.019391419366002083,0.7241073250770569,0.4714205265045166,0.04607808589935303,-0.2867584824562073,0.05692563205957413,-0.04997305944561958,-0.011917677707970142,0.7534865736961365,-0.016150927171111107,-0.08547014743089676,0.02182169258594513,0.09041547030210495,0.008501601405441761,-0.014045433141291142,-0.04103679582476616,-0.23688232898712158,0.015028329566121101,-0.13448135554790497,-0.029015112668275833,0.644404411315918,0.05848173052072525,-0.5373463034629822,-0.018238281831145287,-0.04537268728017807,0.21668533980846405,0.04392686113715172,-0.001365505624562502,-0.08086349070072174,0.0021152871195226908,-0.6676747798919678,-0.008768646977841854,-0.2461652010679245,-0.693730354309082,0.03382061421871185,0.06923159956932068,0.07479595392942429,-0.04881836101412773,0.0008373681339435279,-0.03590631112456322,0.22831864655017853,-0.7014222145080566,-0.05003251135349274,-0.03711496293544769,0.010476252064108849,-0.04154225438833237,-0.00626727007329464,0.022880302742123604,0.0037896872963756323,-0.13703610002994537,-0.024852216243743896,-0.13816048204898834,0.22280792891979218,-0.005502067506313324,-0.047070909291505814,0.02067834697663784,-0.04190021753311157,0.06272883713245392,-0.019187485799193382,-0.09980089217424393,0.02317964844405651,-0.7433032393455505,-0.530398964881897,0.04367008060216904,0.5447679162025452,-0.01278246846050024,0.006967740599066019,0.03605728968977928,0.6838303804397583,0.005164843052625656,-0.005289326421916485,0.026536550372838974,0.0722421333193779,0.03943784534931183,0.007404607255011797,-0.012226826511323452,-0.5501675009727478,-0.015216395258903503,-0.1838967204093933,0.022937938570976257,0.2229921966791153,0.07755482941865921,-0.24397647380828857,-0.07171528786420822,-0.0448438860476017,-0.4337913393974304,0.01050518173724413,0.014848371967673302,0.013549300841987133,0.013805453665554523,-0.5483683347702026,-0.046201180666685104,0.34024345874786377,-0.8281351923942566,-0.013126054778695107,0.02374871075153351,-0.005161530803889036,-0.005225548520684242,-0.04845244437456131,-0.04412638023495674,-0.11190638691186905,-0.7178001403808594,-0.042663030326366425,0.025440825149416924,0.020164690911769867,-0.02131609246134758,-0.013528336770832539,-0.07120456546545029,-0.0009251655428670347,-0.5918094515800476,-0.07654403895139694,0.3171119689941406,-0.127276211977005,-0.025452779605984688,0.04617399722337723,0.06545393913984299,-0.04152248799800873,0.005221591331064701,-0.013873938471078873,0.15273918211460114,0.002388398163020611,-0.3498398959636688,-0.3597239851951599,0.036749813705682755,0.2697363793849945,0.06782647967338562,0.029390249401330948,0.05120377242565155,0.00004235085361870006,0.05465644225478172,0.03657811880111694,0.02626175247132778,-0.027580514550209045,0.05897260084748268,0.04511144384741783,0.043708425015211105,-0.004383088555186987,0.07361667603254318,-0.01617339253425598,-0.07277528196573257,-0.006053307559341192,0.03536826744675636,0.020201005041599274,-0.04403652623295784,0.06593422591686249,-0.007437602616846561,0.05026821419596672,-0.05253401771187782,-0.024046771228313446,0.04418885335326195,-0.0006517361616715789,-0.059518031775951385,-0.012451991438865662,0.0016233487986028194,0.0672704204916954,0.06763164699077606,0.06111014634370804,-0.07175502926111221,-0.035171762108802795,-0.052907053381204605,-0.026830261573195457,-0.02051129750907421,-0.02491683140397072,-0.0758221223950386,-0.04375277832150459,-0.027112549170851707,0.04462112858891487,-0.03372573107481003,-0.05409815534949303,-0.005593167617917061,-0.05522001534700394,0.013882076367735863,-0.01891038939356804,0.05338644981384277,0.055623024702072144,-0.02454286813735962,-0.06088072061538696,0.039384689182043076,-0.05557247996330261,0.018932634964585304,0.049176402390003204,0.006819610483944416,0.03908778727054596,0.051622238010168076,-0.020848959684371948,0.05292224884033203],[13,60]),
60 | tf.tensor([-0.027145469561219215,0.0001059084534063004,0.14073655009269714,0.00019628426525741816,-0.006731161382049322,0.010031435638666153,0.012294062413275242,0.00012011160288238898,0.000712853332515806,0.000023943552150740288,0.25000685453414917,0.007439255714416504,-0.07462171465158463,-0.0002715388545766473,0.2990383505821228,0.032123126089572906,-0.38519611954689026,-0.03098318725824356,0.0008266870281659067,0.2972564995288849,0.0350247360765934,-0.008908504620194435,-0.031613755971193314,0.000021398955141194165,-0.13208039104938507,-0.025903500616550446,-0.47814103960990906,-0.04316621646285057,0.026371654123067856,0.025245144963264465,0.027102598920464516,-0.014162841252982616,-0.04297730326652527,-0.06222250685095787,0.24933147430419922,-0.1002819761633873,-0.02564459666609764,-0.0004842208290938288,-0.018148967996239662,-0.028848547488451004,0.00004295755934435874,-0.016514811664819717,-0.000019098852135357447,0.2833649814128876,-0.03317856788635254,-0.27147892117500305,0.2727382183074951,0.0002514036896172911,0.00024187788949348032,0.012856491841375828,-0.00008692236588103697,0.033113397657871246,-0.00011503681889735162,-0.25729605555534363,0.014841764234006405,-0.26406386494636536,-0.2934871315956116,0.0000716315844329074,0.3174181282520294,0.015305815264582634],[60]),
61 | tf.tensor([0.34473833441734314,-0.33813321590423584,0.06299841403961182,-0.016733922064304352,0.01755589433014393,0.043051086366176605,0.3942551016807556,0.896715521812439,-1.3977947235107422,0.2148672491312027,0.22116878628730774,0.2729067802429199,0.1519974321126938,-0.1505003124475479,0.14823876321315765,0.3208441734313965,-0.005370482336729765,-0.20483791828155518,-0.17899514734745026,0.09097883850336075,-0.20045439898967743,-0.04412631690502167,-0.22161969542503357,-0.308207631111145,0.10746306926012039,-0.11249497532844543,-0.2267361730337143,-0.06549374014139175,-0.053670257329940796,-0.2530253529548645,-1.2936817407608032,-0.058010514825582504,0.7719929218292236,-0.2088337391614914,0.2664457857608795,0.22110886871814728,0.11176148802042007,0.06303910166025162,0.2594432234764099,0.062008608132600784,-0.25762939453125,-0.21876724064350128,-0.7485705018043518,0.898647665977478,-0.8355973958969116,-0.15079015493392944,-0.07889435440301895,-0.28616246581077576,0.611915111541748,-0.5422261953353882,0.08649790287017822,-0.2297493815422058,-0.15652313828468323,-0.06977567821741104,0.1858346313238144,0.22304055094718933,0.05702095478773117,-0.8436952233314514,0.2976223826408386,0.3886670172214508,-0.16990281641483307,0.0661974847316742,0.0983627438545227,0.016225093975663185,-0.0510978102684021,0.1667298823595047,-0.04608625918626785,-0.23929855227470398,0.20970042049884796,-0.13029302656650543,-0.02896823175251484,-0.19103683531284332,-0.37152737379074097,-0.8628399968147278,0.9102863073348999,-0.22322778403759003,-0.1378518044948578,0.14586788415908813,0.44500622153282166,-0.16128292679786682,-0.3437047004699707,-1.1704866886138916,-0.4385329782962799,1.2097264528274536,0.03733210265636444,-0.01652444712817669,-0.1204308271408081,0.05984184518456459,0.20332279801368713,-0.029503893107175827,0.032567206770181656,-0.07349271327257156,-0.2419033944606781,0.11868283152580261,-0.14185132086277008,-0.31810706853866577,0.006642171181738377,-0.25407150387763977,-0.21469487249851227,0.2560015618801117,-0.27848178148269653,-0.22956404089927673,-0.7948020696640015,0.46878644824028015,0.04014936462044716,-0.3857729732990265,-0.33857932686805725,0.5750985741615295,-0.17551027238368988,-0.031524818390607834,-0.19354157149791718,0.24239413440227509,-0.1789368987083435,0.16681769490242004,-0.23907162249088287,-0.18434487283229828,-0.21578888595104218,-0.2257264405488968,-0.16737453639507294,-0.06320451945066452,-0.03599086031317711,-0.022375399246811867,-0.2527298927307129,-0.24671751260757446,-0.1929473876953125,-0.2066258043050766,-0.01850638911128044,-0.17270465195178986,-0.2090453803539276,-0.8940732479095459,0.1574045866727829,0.8066116571426392,-0.009042734280228615,-0.16310423612594604,-0.13549375534057617,0.5990884304046631,-0.5900093913078308,-0.4887729585170746,-0.7917524576187134,0.0029946209397166967,-0.11939683556556702,-0.06660467386245728,-0.019897012040019035,0.16311217844486237,0.09120875597000122,-0.21075215935707092,-0.3231913447380066,-0.20446018874645233,0.1706184595823288,-0.15184733271598816,0.17193205654621124,0.05501939728856087,0.06280484795570374,-0.1344853788614273,0.2057722806930542,0.090342216193676,0.03262603282928467,-0.1424875110387802,-0.25739964842796326,0.8178532123565674,-0.5885924696922302,-0.5434867739677429,0.08860037475824356,0.13550011813640594,-0.3081905245780945,0.2882731556892395,-0.7108396291732788,0.8739856481552124,0.31389403343200684,-0.6526857018470764,0.16710297763347626,0.31490305066108704,0.18848803639411926,-0.16477398574352264,-0.34345823526382446,0.5029585361480713,-0.17576897144317627,-0.009158165194094181,0.006639262195676565,-0.2603282630443573],[60,3]),
62 | tf.tensor([0.09287726879119873,-0.03409605473279953,-0.034108716994524],[3])
63 | ]);
64 | modelLoaded = model;
65 | console.log("Model loaded successfully.")
66 | }
67 | ).catch(
68 | err => {
69 | console.error("Error while loading model:");
70 | console.error(err);
71 | }
72 | )
73 |
74 |
--------------------------------------------------------------------------------