Comments (5)
I could not find anything in the library so far, and I am currently looking into it :)
from smartcore.
I'd like to give it a try!
from smartcore.
Hi @abhikjain360, sounds good!
The basic idea is to define a new function in the BaseVector
trait that loads data from CSV file. Once the function read_csv
is defined in BaseVector
trait it will be automatically available for every type of matrix we support. If the function's definition is too generic, it can always be redefined by a concrete implementation of the matrix later.
One way to implement the function is to read a file first, and use one of the matrix initialization functions to create an instance of BaseMatrix
and then push the values into the matrix using set method. I am also open to any additional abstract method you might find useful. E.g. you might want to define a new method on BaseMatrix
that can initialize a matrix directly from an iterator.
Things to keep in mind. I plan to redesign BaseMatrix
and BaseVector
in #85 . One of the problems you will face is a lack of support for integer and string data types. For now feel free to limit method read_csv
to floats only.
Let me know if you are stuck or have any questions!
from smartcore.
okay!
Seeing the read_csv
of pandas, I think it would be better to provide something like a builder struct which implements Default
, and functions to change the reading options. Should I add a ReadCsv
struct in the same file as BaseMatrix<T>
, or should I create a seperate file?
Also, in case of errors should I just reuse the Failed
? As it uses FailedError
which does not cover the cases when reading a file, should I add more options to it or create a new type specific to parsing files? In case of latter I think we can just use the std::io::Error
from the standard library.
from smartcore.
Has this been implemented/resolved?
from smartcore.
Related Issues (20)
- Use Default::default instead of new in traits HOT 2
- Improve and provide more tools for trees
- Consider implementing XGBoost HOT 2
- Run analysis for size and alignment of non-primitive types HOT 1
- Examples on website does not work with smartcore 0.3.0 HOT 3
- A roadmap to implement RL model-free algorithms
- Prediction of GaussianNB panics in some conditions HOT 2
- KFold for SVC in 0.3.0 HOT 1
- Survival analysis HOT 1
- Allow read/write of parquet files
- Implement LEURN
- index out of bounds error using logistic_regression HOT 12
- Have a guide for Wasm compilation HOT 2
- Performance HOT 1
- Cannot perform inference on deserialized SVC and SVR HOT 8
- how to read x/y from csv file? HOT 2
- smartcore::readers import causes error "could not find `readers` in `smartcore`"
- Panics in NaiveBayes
- Comparison with linfa HOT 1
- Add predict_proba method for LogisticRegression HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smartcore.