BmiPlugin 1.0.1

.NET Standard 2.0
Install-Package BmiPlugin -Version 1.0.1
dotnet add package BmiPlugin --version 1.0.1
<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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: BmiPlugin, 1.0.1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. 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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

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 Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
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 78 4/6/2022
1.0.0 81 4/1/2022

Added human BMI calculator and gender assessment script with neural network