Comments (6)
To be clear I compute real-time stream of data and need to do that so fast as possible. So, may be I can comment some checks at the code of library? Because It's seems library do some checks which slow down transformation.
from autofeat.
The time that the .transform() function needs scales with the number of features that are computed, not so much with the number of data points it is applied to (since this is internally parallelised by numpy/pandas). So maybe your best option might be to manually check which features are computed when calling transform and then hard code your own routines for computing these features in your pipeline. Indeed there is otherwise a lot of computation done to make sure the transformation works for different types of features, NaNs, etc, which you probably don't need.
from autofeat.
def fast(self, df):
feat_array = np.zeros((len(df), len(self.new_feat_cols_)))
for i, expr in enumerate(self.new_feat_cols_):
cols = [c for i, c in enumerate(self.feateng_cols_) if colnames2symbols(c, i) in expr]
f = lambdify([self.feature_formulas_[c] for c in cols], self.feature_formulas_[expr])
not_na_idx = df[cols].all(axis=1)
feat_array[not_na_idx, i] = f(*(df[c].to_numpy(dtype=float)[not_na_idx] for c in cols))
df = df.join(pd.DataFrame(feat_array, columns=self.new_feat_cols_, index=df.index))
return df
from autofeat.
I cutten everything I thought unneeded from code. Now performance is better, but not yet enough. May be you have any idea how to make it a bit faster, to not implement formula applying on my side? )
from autofeat.
you could probably parallelize the for loop, i.e., apply the transformations for each feature in parallel and then concatenate all the results and add them to the dataframe, but the slowest part is the sympy stuff that is happening in lambdify, where the symbolic function is translated into actual numpy computation, but this you only get rid of by implementing the transformations you need directly in numpy
from autofeat.
Nice idea to fork for each feature. Thank you!
from autofeat.
Related Issues (20)
- Data validation error when using Buckingham's Pi Theorem on Classification task HOT 1
- Is it possible to use autofeat without exceeding memory of the system? HOT 3
- possible point for verification HOT 3
- How to transform new data? HOT 1
- MemoryError: Unable to allocate 2.05 GiB for an array with shape (501, 550174) and data type float64
- pandas corr is too slow; use numpy instead HOT 1
- Correlation matrix can have inconsistent column and row names HOT 1
- Allow user to pass dict of Pint objects/ureg
- Input contains NaN, infinity or a value too large for dtype('float32') on fit_transform HOT 2
- ufunc '_lambdifygenerated' did not contain a loop with signature matching types (<class 'numpy.dtype[float32]'>, <class 'numpy.dtype[float32]'>) -> None HOT 6
- How to choose sin(x) and cos(x) etl. as features? HOT 1
- Scaling and Autofeat HOT 2
- [enhancement] add predict_proba for classifiers HOT 11
- TypeError: unsupported operand type(s) for |: 'type' and 'NoneType' HOT 1
- ValueError: Input X contains NaN. HOT 6
- Documentation Enhancement for getting model, features, coefficients HOT 1
- AutoFeatLight.fit_trasnform() take 2 positional arguments 3 given HOT 2
- Reproducibility issue HOT 2
- In toydata, autofeat finds the correct function (square) only under some circumstances 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 autofeat.