MCPcopy Create free account
hub / github.com/daniel-e/rustml / from_file

Function from_file

src/vectors.rs:195–201  ·  view source on GitHub ↗

Returns a `VecReader` to read vectors line by line from a file. # Example ``` use rustml::vectors::*; // the file contains the following lines: // 1 2 3 // 4 5 6 let mut i = from_file:: ("datasets/testing/vecs.txt").unwrap(); assert_eq!(i.next().unwrap().unwrap(), vec![1, 2, 3]); assert_eq!(i.next().unwrap().unwrap(), vec![4, 5, 6]); ```

(path: &str)

Source from the content-addressed store, hash-verified

193/// ```
194///
195pub fn from_file<T: FromStr>(path: &str) -> Result<VecReader<BufReader<File>, T>> {
196
197 Ok(VecReader {
198 buf: BufReader::<File>::new(try!(File::open(path))),
199 phantom: PhantomData
200 })
201}
202
203///
204pub trait VectorIO {

Callers 15

plot_learning_curveFunction · 0.85
read_labelsMethod · 0.85
read_examplesMethod · 0.85
test_read_gzipFunction · 0.85
test_colorimageFunction · 0.85
test_mask_imageFunction · 0.85
test_mask_videoFunction · 0.85
test_image_to_fileFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by 6

test_read_gzipFunction · 0.68
test_colorimageFunction · 0.68
test_mask_imageFunction · 0.68
test_mask_videoFunction · 0.68
test_image_to_fileFunction · 0.68