Tue 27 Aug 00:14:56 CEST 2024
This commit is contained in:
		
							parent
							
								
									34a20e40c8
								
							
						
					
					
						commit
						cc6e117186
					
				
							
								
								
									
										16
									
								
								test/test-dti1.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								test/test-dti1.js
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,16 @@
 | 
			
		|||
var x = [[0, 0, 0], [0, 1, 1], [1, 1, 0], [2, 2, 2], [1, 2, 2], [2, 1, 2]];
 | 
			
		||||
var y = [0, 0.2, 0.4, 1, 1.2, 1.4];
 | 
			
		||||
 | 
			
		||||
var model = ml.learn({
 | 
			
		||||
  algorithm:ml.ML.DTI,
 | 
			
		||||
  x:x, 
 | 
			
		||||
  y:y,
 | 
			
		||||
  eps:0.2
 | 
			
		||||
});
 | 
			
		||||
print(toJSON(model).length+' Bytes')
 | 
			
		||||
 | 
			
		||||
var test_data =[[0, 1.2, 0],
 | 
			
		||||
                [2.1, 2, 3]];
 | 
			
		||||
 | 
			
		||||
print(ml.print(model))
 | 
			
		||||
print(ml.classify(model,test_data))
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user