Repository navigation
Expand file tree
/
Copy pathcomponents.db.sql
More file actions
55 lines (47 loc) · 2.34 KB
/
Copy pathcomponents.db.sql
File metadata and controls
55 lines (47 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
-- SQLite schema for node editor components
CREATE TABLE IF NOT EXISTS components (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL UNIQUE,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE IF NOT EXISTS parameters (
id INTEGER PRIMARY KEY AUTOINCREMENT,
component_id INTEGER NOT NULL,
name TEXT NOT NULL,
datatype TEXT NOT NULL CHECK(datatype IN ('float', 'int', 'boolean', 'string')),
default_value TEXT,
description TEXT,
options TEXT, -- JSON array for dropdown options
FOREIGN KEY (component_id) REFERENCES components(id) ON DELETE CASCADE
);
-- Sample data
INSERT INTO components (name) VALUES
('darts'),
('linear_model'),
('data_processor'),
('evaluator'),
('neural_network');
-- darts parameters
INSERT INTO parameters (component_id, name, datatype, default_value, description) VALUES
(1, 'x', 'float', '0.0', 'X coordinate'),
(1, 'y', 'float', '0.0', 'Y coordinate');
-- linear_model parameters
INSERT INTO parameters (component_id, name, datatype, default_value, description, options) VALUES
(2, 'learning_rate', 'float', '0.01', 'Learning rate for gradient descent', NULL),
(2, 'max_iterations', 'int', '1000', 'Maximum training iterations', NULL),
(2, 'normalize', 'boolean', 'true', 'Normalize input features', NULL),
(2, 'optimizer', 'string', 'adam', 'Optimization algorithm', '["sgd", "adam", "rmsprop"]');
-- data_processor parameters
INSERT INTO parameters (component_id, name, datatype, default_value, description) VALUES
(3, 'batch_size', 'int', '32', 'Batch size for processing'),
(3, 'shuffle', 'boolean', 'true', 'Shuffle data'),
(3, 'num_workers', 'int', '4', 'Number of worker threads');
-- evaluator parameters
INSERT INTO parameters (component_id, name, datatype, default_value, description, options) VALUES
(4, 'metric', 'string', 'accuracy', 'Evaluation metric', '["accuracy", "f1", "precision", "recall"]'),
(4, 'threshold', 'float', '0.5', 'Classification threshold', NULL);
-- neural_network parameters
INSERT INTO parameters (component_id, name, datatype, default_value, description, options) VALUES
(5, 'hidden_layers', 'int', '3', 'Number of hidden layers', NULL),
(5, 'activation', 'string', 'relu', 'Activation function', '["relu", "tanh", "sigmoid"]'),
(5, 'dropout', 'float', '0.2', 'Dropout rate', NULL);