picnet / xgboost.net Goto Github PK
View Code? Open in Web Editor NEW.Net wrappers for the awesome XGBoost library
.Net wrappers for the awesome XGBoost library
Be able to call "importance" function.
Currently only 64 bit projects are supported
Given that I'm unable to compile the XGBoostTest solution in Visual Studio 2022, I've written a notebook to follow the steps towards training and saving a model from scratch.
After loading the data from train.csv
I've called the Fit
method and I constantly get the following error Error: XGBoost.lib.DllFailException: value 0 for Parameter num_output_group should be greater equal to 1
. I've tried to use the SetParameter
method available and also modified the default parameters and passed them to the Fit
method, both without success.
These attempts were done using version 0.2.1 of the NuGet package since using the latest version would raise the following error Error: error CS0009: Metadata file ..\.nuget\packages\picnet.xgboost\0.2.2\lib\libxgboost.dll' could not be opened -- PE image doesn't contain managed metadata. (1,7): error CS0246: The type or namespace name 'XGBoost' could not be found (are you missing a using directive or an assembly reference?)
.
Any help would be appreciated.
Implement other parameters for Predict().
We cannot build multiclass models with the current version.
XGBClassifier.DumpModelEx throws EntryPointNotFoundException because entry point XGBoosterDumpModelEx is not found in libxgboost.dll. I inspected the DLL in question and I believe that the entry point was perhaps meant to be XGBoosterDumpModel.
Hi @gatapia ,
I am having an issue with the nuget package when used as a dependency for another package. It seems that nuget tries to add the native dll as a reference for the targeted project:
To avoid nuget trying to do this, you can add the following to your .nuspec file:
<references>
<reference file="XGBoost.dll" />
</references>
This will tell nuget that the XBoost.dll is the only dll to reference during install.
I tried this locally by modifying the PicNet.XGBoost.Net package, and it solves the issue.
Could you release a new version of the nuget package with this added to the .nuspec file? It would help me a lot since currently my own package doesn't work because of this issue.
best regards
Mads
Nuget package only supports projects with an output path with 2 levels. For example it supports "\bin\Debug" but not "\bin".
Hi there,
thanks for sharing your excellent work!
Is there any chance to get this project working (on Win 64 Bit) with the latest XGBoost version in a way that enables us to benefit from the GPU accelleration that XGBoost provides?
Thanks and best regards
Florian
Any clue as to what is happening?
I have a form project which accesses Xgboost but when I try to load Xgboost to create XGBRegressor, I get this.
I'm using 4.7.1 .NET for the form project and therefore had to upgrade the Xgboost project to 4.7.1. I'm not using the Nuget version. I added the Xgboost project as another project in my solution and updated it to 4.7.1 .net.
Inner Exception 1:
BadImageFormatException: Could not load file or assembly 'XGBoost, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
NuGet package failing with the following exception:
System.DllNotFoundException: Unable to load DLL 'lib/libxgboost.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at XGBoost.XGBOOST_NATIVE_METHODS.XGDMatrixCreateFromMat(Single[] data, UInt64 nrow, UInt64 ncol, Single missing, IntPtr& handle)
at XGBoost.DMatrix..ctor(Single[][] data, Single[] labels)
at XGBoost.XGBClassifier.Fit(Single[][] data, Single[] labels)
at TestXGBoost.UnitTest1.TestMethod1() in c:\dev\projects\test_xgb\TestXGBoost\TestXGBoost\UnitTest1.cs:line 18
This is in a 64 bit MSTest project.
Hi @gatapia,
I was trying to add support for sample weights in the XGBoost project in SharpLearning, related to this issue: mdabros/SharpLearning#82
However, it seems that the current DMatrix implementation in XGBoost.Net does not support setting the sample weights. This can be done via the python wrapper for instance, see this example: https://github.com/dmlc/xgboost/blob/master/demo/kaggle-higgs/higgs-numpy.py#L28
Would it be possible to add sample weight support to the DMatrix in XGBoost.Net?
Best regards
Mads
Implement other parameters for Fit().
I have moved the code written in python xgboost to c # xgboost.net
I did the same with the same data, but the results were different.
I have this problem because of the float-type decimal length problem,
It is expected that the data entered in python is different from the data entered in decimal length, resulting in different results.
Is there any possibility that I expected to happen?
I am trying to test this by changing float type to double type to solve this problem.
This article is written in Google Translator and may be difficult to read.
summary : I put the same data as python's xgboost, but got different results.
Thank you.
Hi,
I get error for this line:
public IntPtr Handle => handle;
Any solution?
XGBGetLastError returns:
Invalid Parameter format for base_score expect float but value='0,5'
Possible solution is to use System.Globalization.NumberFormatInfo
to specify dot as decimal separator:
public void SetParameters(IDictionary<string, Object> parameters)
{
var nfi = new NumberFormatInfo { NumberDecimalSeparator = "." };
SetParameter("max_depth", ((int)parameters["max_depth"]).ToString());
SetParameter("learning_rate", ((float)parameters["learning_rate"]).ToString(nfi));
....
}
Other documentation should go in the readme
Save models so they don't have to be trained every time
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.