5 ms·
There are scikit-learn (sklearn) API-compatible wrappers for e.g. PyTorch and TensorFlow. Skorch: https://github.com/skorch-dev/skorch https://github.com/skorc
by westurner 5y ago
There are scikit-learn (sklearn) API-compatible wrappers for e.g. PyTorch and TensorFlow.
Skorch: https://github.com/skorch-dev/skorch https://github.com/skorch-dev/skorch
tf.keras.wrappers.scikit_learn: https://www.tensorflow.org/api_docs/python/tf/keras/wrappers/scikit_learn https://www.tensorflow.org/api_docs/python/tf/keras/wrappers...
AFAIU, there are not Yellowbrick visualizers for PyTorch or TensorFlow; though PyTorch abd TensorFlow work with TensorBoard for visualizing CFG execution.
> Many machine learning libraries implement the scikit-learn `estimator API` to easily integrate alternative optimization or decision methods into a data science workflow. Because of this, it seems like it should be simple to drop in a non-scikit-learn estimator into a Yellowbrick visualizer, and in principle, it is. However, the reality is a bit more complicated.
> Yellowbrick visualizers often utilize more than just the method interface of estimators (e.g. `fit()` and `predict()`), relying on the learned attributes (object properties with a single underscore suffix, e.g. `coef_`). The issue is that when a third-party estimator does not expose these attributes, truly gnarly exceptions and tracebacks occur. Yellowbrick is meant to aid machine learning diagnostics reasoning, therefore instead of just allowing drop-in functionality that may cause confusion, we’ve created a wrapper functionality that is a bit kinder with it’s messaging.
Looks like there are Yellowbrick wrappers for XGBoost, CatBoost, CuML, and Spark MLib; but not for NNs yet.
https://www.scikit-yb.org/en/latest/api/contrib/wrapper.html#tested-libraries https://www.scikit-yb.org/en/latest/api/contrib/wrapper.html...
From the RAPIDS.ai CuML team: https://docs.rapids.ai/api/cuml/stable/ https://docs.rapids.ai/api/cuml/stable/ :
> cuML is a suite of fast, GPU-accelerated machine learning algorithms designed for data science and analytical tasks. Our API mirrors Sklearn’s, and we provide practitioners with the easy fit-predict-transform paradigm without ever having to program on a GPU.
> As data gets larger, algorithms running on a CPU becomes slow and cumbersome. RAPIDS provides users a streamlined approach where data is intially loaded in the GPU, and compute tasks can be performed on it directly.
CuML is not an NN library; but there are likely performance optimizations from CuDF and CuML that would accelerate performance of NNs as well.
Dask ML works with models with sklearn interfaces, XGBoost, LightGBM, PyTorch, and TensorFlow: https://ml.dask.org/ https://ml.dask.org/ :
> Scikit-Learn API
> In all cases Dask-ML endeavors to provide a single unified interface around the familiar NumPy, Pandas, and Scikit-Learn APIs. Users familiar with Scikit-Learn should feel at home with Dask-ML.
dask-labextension for JupyterLab helps to visualize Dask ML CFGs which call predictors and classifiers with sklearn interfaces: https://github.com/dask/dask-labextension https://github.com/dask/dask-labextension
- zibzab 5y agowell, this is realy the reason i asked my question. It is a pain to move in and out of scikit and write all these wrappers and converters. I would prefer to do more in one framework. For example, doing hyperparameter optimization in pytorch using scikit can be a bit painful sometimes
- westurner 5y agoCtrl-F automl https://westurner.github.io/hnlog/ https://westurner.github.io/hnlog/ > /? hierarchical automl "sklearn" site:github.com : https://www.google.com/search?q=hierarchical+automl+%22sklearn%22+site%3Agithub.com https://www.google.com/search?q=hierarchical+automl+%22sklea... https://westurner.github.io/hnlog/#comment-18798244 https://westurner.github.io/hnlog/#comment-18798244 > Dask-ML works with {scikit-learn, xgboost, tensorflow, TPOT,}. ETL is your responsibility. Loading things into parquet format affords a lot of flexibility in terms of (non-SQL) datastores or just efficiently packed files on disk that need to be paged into/over in RAM. (Edit) scale-scikit-learn https://examples.dask.org/machine-learning/scale-scikit-learn.html https://examples.dask.org/machine-learning/scale-scikit-lear... -> dask.distributed parallel predication: https://examples.dask.org/machine-learning/parallel-prediction.html https://examples.dask.org/machine-learning/parallel-predicti... "Hyperparameter optimization with Dask" https://examples.dask.org/machine-learning/hyperparam-opt.html https://examples.dask.org/machine-learning/hyperparam-opt.ht... > Sklearn.pipeline.Pipeline API: {fit(), transform(), predict(), score(),} https://scikit-learn.org/stable/modules/generated/sklearn.pipeline.Pipeline.html#sklearn.pipeline.Pipeline https://scikit-learn.org/stable/modules/generated/sklearn.pi... : ``` decision_function(X) # Apply transforms, and decision_function of the final estimator fit(X[, y]) # Fit the model fit_predict(X[, y]) # Applies fit_predict of last step in pipeline after transforms. fit_transform(X[, y]) # Fit the model and transform with the final estimator get_params([deep]) # Get parameters for this estimator. predict(X, *predict_params) # Apply transforms to the data, and predict with the final estimator predict_log_proba(X) # Apply transforms, and predict_log_proba of the final estimator predict_proba(X) # Apply transforms, and predict_proba of the final estimator score(X[, y, sample_weight]) # Apply transforms, and score with the final estimator score_samples(X) # Apply transforms, and score_samples of the final estimator. set_params(**kwargs) # Set the parameters of this estimator ``` > https://docs.featuretools.com https://docs.featuretools.com can also minimize ad-hoc boilerplate ETL / feature engineering : >> Featuretools is a framework to perform automated feature engineering. It excels at transforming temporal and relational datasets into feature matrices for machine learning From https://featuretools.alteryx.com/en/stable/guides/using_dask_entitysets.html https://featuretools.alteryx.com/en/stable/guides/using_dask... : > Creating a feature matrix from a very large dataset can be problematic if the underlying pandas dataframes that make up the entities cannot easily fit in memory. To help get around this issue, Featuretools supports creating Entity and EntitySet objects from Dask dataframes. A Dask EntitySet can then be passed to featuretools.dfs or featuretools.calculate_feature_matrix to create a feature matrix, which will be returned as a Dask dataframe. In addition to working on larger than memory datasets, this approach also allows users to take advantage of the parallel and distributed processing capabilities offered by Dask