Logo

Contents:

  • emlearn
    • Status
    • License
    • Key features
    • Platform support
    • Projects using emlearn
    • Model support
    • Documentation
      • Other learning resources
    • Installing
    • Usage
      • Simple classifiers
      • Neural net regressor
    • Contributing
    • Contributors
    • Citations
  • User Guide
    • 1. Getting started on PC (Linux/MacOS/Windows)
      • 1.1. Prerequisites
      • 1.2. Install scikit-learn
      • 1.3. Install emlearn
      • 1.4. Create model in Python
      • 1.5. Use in C code
      • 1.6. Try it out
      • 1.7. Next
    • 2. Getting started on hardware (Arduino)
      • 2.1. Prerequisites
      • 2.2. Create Arduino project
      • 2.3. Create model in Python
      • 2.4. Copy model files into Arduino
      • 2.5. Install emlearn as Arduino library
      • 2.6. Build and upload the code
      • 2.7. Test it out
      • 2.8. Next
    • 3. Getting started on Zephyr RTOS
      • 3.1. Prerequisites
      • 3.2. Add emlearn to your Zephyr project
      • 3.3. Enable emlearn in your Zephyr project
      • 3.4. Create model in Python
      • 3.5. Example application code
      • 3.6. Build and run in simulator
    • 4. Getting started on browser (WASM/Emscripten)
      • 4.1. Prerequisites
      • 4.2. Install scikit-learn
      • 4.3. Install emlearn
      • 4.4. Create model in Python
      • 4.5. Use in C code for WASM module
      • 4.6. Load WASM module in webpage
      • 4.7. Try it out
      • 4.8. Next
    • 5. Getting started with MicroPython
    • 6. Platform support
      • 6.1. Software frameworks and RTOS
      • 6.2. Microcontroller hardware platforms
      • 6.3. Embedded OS platforms
      • 6.4. Other programming languages
      • 6.5. More
    • 7. Feature extraction
      • 7.1. Time-domain features
      • 7.2. Statistical summaries
      • 7.3. Digital filters
      • 7.4. Spectrum (frequency domain)
      • 7.5. Spectrogram (time-frequency domain)
      • 7.6. Integrating feature extraction
    • 8. Classification
      • 8.1. Applications
      • 8.2. Classification models
      • 8.3. Related
    • 9. Regression
      • 9.1. Applications
      • 9.2. Regression models
      • 9.3. Related
    • 10. Anomaly Detection
      • 10.1. Applications
      • 10.2. Trade-off between False Alarms and Missed Detections
      • 10.3. Selecting anomaly threshold
      • 10.4. Anomaly Detection models
      • 10.5. Outlier detection for handling unknown data
    • 11. Event Detection
      • 11.1. Applications
      • 11.2. Binary or multi-class
      • 11.3. Sliding time windows
      • 11.4. Classification models for Event Detection
      • 11.5. Training with class imbalance
      • 11.6. Trade-off between False Alarms and Missed Detections
      • 11.7. Evaluation metrics
      • 11.8. Frame-wise evaluation
      • 11.9. Event-wise evaluation
    • 12. Model optimization
      • 12.1. Goals for efficient models
      • 12.2. Measuring model costs
    • 13. Tree-based models
      • 13.1. Basic usage
      • 13.2. Probability output
      • 13.3. Regression
      • 13.4. Inference method: Inline vs loadable
      • 13.5. Feature representation
      • 13.6. Hard voting (majority) vs soft voting (proportions)
      • 13.7. Target quantization and leaf-deduplication
      • 13.8. Optimizing model complexity
      • 13.9. Optimization of features
  • Examples
    • Regression models
      • Create dataset
      • Train, convert and run model
      • Run all models
    • XOR classification
      • Create dataset
      • Train ML model
      • Convert model to C using emlearn
      • Use generated C model to make predictions
    • Feature data-types for trees
      • Train a RandomForest model
      • Measure how feature datatype impacts program size
      • Plot results
    • Anomaly Detection comparison
      • Create dataset
      • Models to compare
      • Plotting tools
      • Run comparison
    • Voting options for trees
      • Load datasets
      • Train a RandomForest model
      • Experiments with different leaf_bits settings
      • Sonar dataset
      • Heart disease dataset
      • Digits dataset
      • Visualize results
    • Classifier comparison
      • Create dataset
      • Correctness checking
      • Plotting tools
      • Train, convert and run model
      • Classifiers to compare
      • Run all classifiers
    • Optimizing model size for trees
      • Load dataset
      • Visualize data
      • Setup model evaluation and optimization
      • Build a baseline model
      • Optimize hyper-parameters
      • Check effect of depth parameter
      • Trade-off between predictive performance and model costs
      • Summarize Pareto-optimal models
  • Python API
    • 1. Model conversion
    • Model
      • Model.predict()
      • Model.predict_proba()
      • Model.save()
      • Model.score_samples()
    • convert()
    • 2. Pareto-optimal evaluation
    • find_pareto_front()
    • is_pareto_efficient_simple()
    • plot_pareto_front()
    • 3. Tree evaluation metrics
    • compute_cost_estimate()
    • count_trees()
    • get_tree_estimators()
    • model_size_bytes()
    • model_size_leaves()
    • model_size_nodes()
    • tree_depth_average()
    • tree_depth_difference()
    • check_build_tools()
    • get_program_size()
    • parse_binutils_size_a_output()
    • run_binutils_size()
    • 4. Utilities
    • compile_executable()
    • get_include_dir()
    • 5. C code generation utilities
    • array_declare()
    • array_declare_fixedpoint()
    • assert_valid_identifier()
    • constant()
    • constant_declare()
    • identifier_is_reserved()
    • identifier_is_valid()
    • struct_declare()
    • struct_init()
  • C API
    • Tree-based models (C API)
      • EmlTrees
      • eml_trees_predict()
      • eml_trees_regress1()
      • eml_trees_regress()
    • Neural Network (C API)
      • EmlNet
      • eml_net_predict_proba()
      • eml_net_predict()
    • Gaussian Naive Bayes (C API)
      • EmlBayesModel
      • eml_bayes_predict()
    • Distance-based models (C API)
      • EmlEllipticEnvelope
      • eml_elliptic_envelope_predict()
      • eml_mahalanobis_distance_squared()
    • Mixture models (C API)
      • EmlMixtureModel
      • eml_mixture_score()
    • Nearest Neighbors models (C API)
      • EmlNeighborsModel
      • eml_neighbors_predict()
      • eml_neighbors_add_item()
      • EmlNeighborsDistanceItem
    • IIR digital filters (C API)
      • EmlIIR
      • eml_iir_check()
      • eml_iir_filter()
    • Fast Fourier Transform (C API)
      • EmlFFT
      • eml_fft_fill()
      • eml_fft_forward()
    • Audio processing (C API)
      • eml_audio_melspectrogram()
      • eml_audio_melspec()
      • eml_audio_power_spectrogram()
      • eml_sparse_filterbank()
    • Utilities (C API)
      • EmlError
      • _EmlError
      • eml_error_str()
    • Logging (C API)
      • EML_LOG_ENABLE
      • EML_LOG_PRINTF
      • EML_LOG_PRINT_ARRAY
      • EML_LOG_BOOL_STR
      • EML_LOG_BEGIN
      • EML_LOG_END
      • EML_LOG_ADD
      • EML_LOG_ADD_INTEGER
      • EML_LOG_ADD_BOOL
      • EML_LOG_ADD_FLOAT
      • EML_LOG_ADD_ARRAY
  • Made with emlearn
    • Projects using emlearn
  • The MIT License
emlearn
  • C API: contents
  • View page source

C API

  • Tree-based models (C API)
  • Neural Network (C API)
  • Gaussian Naive Bayes (C API)
  • Distance-based models (C API)
  • Mixture models (C API)
  • Nearest Neighbors models (C API)
  • IIR digital filters (C API)
  • Fast Fourier Transform (C API)
  • Audio processing (C API)
  • Utilities (C API)
  • Logging (C API)
Previous Next

© Copyright 2019-2023, Jon Nordby.

Built with Sphinx using a theme provided by Read the Docs.