BmiPlugin 1.0.1

dotnet add package BmiPlugin --version 1.0.1                
NuGet\Install-Package BmiPlugin -Version 1.0.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BmiPlugin" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add BmiPlugin --version 1.0.1                
#r "nuget: BmiPlugin, 1.0.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install BmiPlugin as a Cake Addin
#addin nuget:?package=BmiPlugin&version=1.0.1

// Install BmiPlugin as a Cake Tool
#tool nuget:?package=BmiPlugin&version=1.0.1                

Overview

BmiPlugin is a C# plugin for BMI calculating and gender assessment.

Getting started

Here are the details of using the BmiPlugin and a complete usage example.

Installation

You can download and install package by searching in NuGet or by inserting the following code in Package Manager Console:

Install-Package BmiPlugin

Implementation

To use BmiPlugin you need to embed this namespace into your code.

using BmiPlugin;

BMI calculating

You can do it with Height, Weigth and Age (optional) params:

double bmi = Bmi.GetBmi(height: 180, weigth: 80, age: 20);

or you can set the UsingData earlier and run the method with it:

Bmi.UsingData = new BiometricData
{
    Height = 180,
    Weigth = 80,
    Age = 20,
};

double bmi = Bmi.GetBmi();
Notes
  • you must set Height and Weigth values, else you'll get the Exception;
  • Age value is not necessary, because it has the default value;

Gender asessment calculating

Notes
  • the result value characterizes the ratio of the set of input data to the reference values.
  • it is a number of double type in range from 0 to 1, where 0-0,5 - female, 0,5-1 - male.
  • but 1 is long, fat or old man, and 0 is full opposite.

First of all, you must set the UsingData or initialize a new instance of the class:

var Data = new BiometricData
{
    Height = 180,
    Weigth = 80,
    Age = 20,
};

Then you need to start the machine learning process with this Data. Also you can set the Deepness value for machine learning:

Bmi.Start(Data, Deepness.High);
Notes
  • you must set values for not less than 2 properties, else you'll get the Exception;
  • this method has default value - Deepness.Medium, and you can run it without params.
  • if you'll set Deepness.No value then it wouldn't be any iterations of machine learning.

And finally you need to run the calculating method:

double gender = Bmi.GetGenderAssessment();

You can also set anew instance of the BiometricData class as a parameter:

double gender = Bmi.GetGenderAssessment(new BiometricData
{
  Height = 176,
  Weigth = 66,
  Age = 22
});

Complete example code

Here is an example of code with MVVM pattern:

using BmiPlugin;

internal class BmiViewModel
{
  public double Height { get; set; } = 180;
  public double Weigth { get; set; } = 80;
  public double Age { get; set; } = 20;

  public Command StartBmiCommand => new Command(sender => StartBmi());

  private void StartBmi()
  {
    Bmi.UsingData = new BiometricData
    {
      Height = Height,
      Weigth = Weigth,
      Age = Age,
    };

    Bmi.Start(Deepness.High);

    double bmi = Bmi.GetBmi();
    double gender = Bmi.GetGenderAssessment();
  }
}

your BiometricData properties values with double types must be more than 0 and less than 4294967295 (uint.MaxValue), else you'll get the Exception;

License

You can check out the full license here

This project is licensed under the terms of the MIT license.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 528 4/6/2022
1.0.0 552 4/1/2022 1.0.0 is deprecated because it has critical bugs.

Added human BMI calculator and gender assessment script with neural network