same version

reset changes
This commit is contained in:
giuliohome 2014-09-05 13:37:18 +02:00
parent 1d90288655
commit 59e1e75857
5 changed files with 52 additions and 254 deletions

52
README.md Normal file
View File

@ -0,0 +1,52 @@
xgboost: eXtreme Gradient Boosting
======
An optimized general purpose gradient boosting library. The library is parallelized using OpenMP. It implements machine learning algorithm under gradient boosting framework, including generalized linear model and gradient boosted regression tree.
Contributors: https://github.com/tqchen/xgboost/graphs/contributors
Turorial and Documentation: https://github.com/tqchen/xgboost/wiki
Questions and Issues: [https://github.com/tqchen/xgboost/issues](https://github.com/tqchen/xgboost/issues?q=is%3Aissue+label%3Aquestion)
Examples Code: [Learning to use xgboost by examples](demo)
Notes on the Code: [Code Guide](src)
What's New
=====
* See the updated [demo folder](demo) for feature walkthrough
* Thanks to Tong He, the new [R package](R-package) is available
Features
======
* Sparse feature format:
- Sparse feature format allows easy handling of missing values, and improve computation efficiency.
* Push the limit on single machine:
- Efficient implementation that optimizes memory and computation.
* Speed: XGBoost is very fast
- IN [demo/higgs/speedtest.py](demo/kaggle-higgs/speedtest.py), kaggle higgs data it is faster(on our machine 20 times faster using 4 threads) than sklearn.ensemble.GradientBoostingClassifier
* Layout of gradient boosting algorithm to support user defined objective
* Python interface, works with numpy and scipy.sparse matrix
Build
=====
* Simply type make
* If your compiler does not come with OpenMP support, it will fire an warning telling you that the code will compile into single thread mode, and you will get single thread xgboost
* You may get a error: -lgomp is not found
- You can type ```make no_omp=1```, this will get you single thread xgboost
- Alternatively, you can upgrade your compiler to compile multi-thread version
* Windows(VS 2010): see [windows](windows) folder
- In principle, you put all the cpp files in the Makefile to the project, and build
Version
======
* This version xgboost-0.3, the code has been refactored from 0.2x to be cleaner and more flexibility
* This version of xgboost is not compatible with 0.2x, due to huge amount of changes in code structure
- This means the model and buffer file of previous version can not be loaded in xgboost-3.0
* For legacy 0.2x code, refer to [Here](https://github.com/tqchen/xgboost/releases/tag/v0.22)
* Change log in [CHANGES.md](CHANGES.md)
XGBoost in Graphlab Create
======
* XGBoost is adopted as part of boosted tree toolkit in Graphlab Create (GLC). Graphlab Create is a powerful python toolkit that allows you to data manipulation, graph processing, hyper-parameter search, and visualization of TeraBytes scale data in one framework. Try the Graphlab Create in http://graphlab.com/products/create/quick-start-guide.html
* Nice blogpost by Jay Gu using GLC boosted tree to solve kaggle bike sharing challenge: http://blog.graphlab.com/using-gradient-boosted-trees-to-predict-bike-sharing-demand

View File

@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Le informazioni generali relative a un assembly sono controllate dal seguente
// set di attributi. Per modificare le informazioni associate a un assembly
// occorre quindi modificare i valori di questi attributi.
[assembly: AssemblyTitle("xgboost_sharp_wrapper")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("xgboost_sharp_wrapper")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Se si imposta ComVisible su false, i tipi in questo assembly non saranno visibili
// ai componenti COM. Se è necessario accedere a un tipo in questo assembly da
// COM, impostare su true l'attributo ComVisible per tale tipo.
[assembly: ComVisible(false)]
// Se il progetto viene esposto a COM, il GUID che segue verrà utilizzato per creare l'ID della libreria dei tipi
[assembly: Guid("accc4026-fa8e-41d8-aaa8-1ca69c2b2db5")]
// Le informazioni sulla versione di un assembly sono costituite dai seguenti quattro valori:
//
// Numero di versione principale
// Numero di versione secondario
// Numero build
// Revisione
//
// È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build
// utilizzando l'asterisco (*) come descritto di seguito:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -1,109 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
namespace xgboost_sharp_wrapper
{
public class xgboost
{
private const string dll_path = "..\\x64\\Release\\";
[DllImport(dll_path + "xgboost_wrapper.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr XGDMatrixCreateFromFile(string fname, int silent);
public IntPtr SharpXGDMatrixCreateFromFile(string fname, int silent)
{
return XGDMatrixCreateFromFile(fname, silent);
}
/*!
* \brief set float vector to a content in info
* \param handle a instance of data matrix
* \param field field name, can be label, weight
* \param array pointer to float vector
* \param len length of array
*/
[DllImport(dll_path + "xgboost_wrapper.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void XGDMatrixSetFloatInfo(IntPtr handle, string field, IntPtr array, System.UInt32 len);
[DllImport(dll_path + "xgboost_wrapper.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void XGBoosterSetParam(IntPtr handle, string name, string value);
public void SharpXGBoosterSetParam(IntPtr handle, string name, string value)
{
XGBoosterSetParam(handle,name,value);
}
[DllImport(dll_path + "xgboost_wrapper.dll")]
public static extern IntPtr XGBoosterCreate(IntPtr[] dmats, System.UInt32 len);
public IntPtr SharpXGBoosterCreate(IntPtr[] dmats, System.UInt32 len)
{
return XGBoosterCreate(dmats, len);
}
[DllImport(dll_path + "xgboost_wrapper.dll")]
public static extern void XGBoosterUpdateOneIter(IntPtr handle, int iter, IntPtr dtrain);
public void SharpXGBoosterUpdateOneIter(IntPtr handle, int iter, IntPtr dtrain)
{
XGBoosterUpdateOneIter(handle, iter, dtrain);
}
[DllImport(dll_path + "xgboost_wrapper.dll")]
public static extern string XGBoosterEvalOneIter(IntPtr handle, int iter, IntPtr[] dmats,
string[] evnames, System.UInt32 len);
public string SharpXGBoosterEvalOneIter(IntPtr handle, int iter, IntPtr[] dmats,
string[] evnames, System.UInt32 len)
{
return XGBoosterEvalOneIter(handle, iter, dmats, evnames, len);
}
/*!
* \brief make prediction based on dmat
* \param handle handle
* \param dmat data matrix
* \param output_margin whether only output raw margin value
* \param len used to store length of returning result
*/
[DllImport(dll_path + "xgboost_wrapper.dll")]
public static extern IntPtr XGBoosterPredict(IntPtr handle, IntPtr dmat, int output_margin, ref System.UInt32 len);
public float[] SharpXGBoosterPredict(IntPtr handle, IntPtr dmat, int output_margin, System.UInt32 len)
{
IntPtr buf = XGBoosterPredict(handle, dmat, output_margin, ref len);
float[] buffer = new float[len];
Marshal.Copy(buf, buffer, 0, buffer.Length);
return buffer;
}
/*!
* \brief load model from existing file
* \param handle handle
* \param fname file name
*/
[DllImport(dll_path + "xgboost_wrapper.dll")]
public static extern void XGBoosterLoadModel(IntPtr handle, string fname);
/*!
* \brief save model into existing file
* \param handle handle
* \param fname file name
*/
[DllImport(dll_path + "xgboost_wrapper.dll")]
public static extern void XGBoosterSaveModel(IntPtr handle, string fname);
/*!
* \brief dump model, return array of strings representing model dump
* \param handle handle
* \param fmap name to fmap can be empty string
* \param out_len length of output array
* \return char *data[], representing dump of each model
*/
[DllImport(dll_path + "xgboost_wrapper.dll")]
public static extern string XGBoosterDumpModel(IntPtr handle, string fmap,
System.UInt32 out_len);
}
}

View File

@ -1,71 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{2D0E7F78-53DD-4501-8BD9-69E21A5051E3}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>xgboost_sharp_wrapper</RootNamespace>
<AssemblyName>xgboost_sharp_wrapper</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>ManagedMinimumRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>ManagedMinimumRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="xgboost.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -1,38 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2013 for Windows Desktop
VisualStudioVersion = 12.0.30723.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "xgboost_sharp_wrapper", "xgboost_sharp_wrapper.csproj", "{2D0E7F78-53DD-4501-8BD9-69E21A5051E3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "kaggle_higgs_demo", "..\kaggle_higgs_demo\kaggle_higgs_demo.csproj", "{2EB1B15E-B7CA-494A-B4DC-BF56897A3F2F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2D0E7F78-53DD-4501-8BD9-69E21A5051E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2D0E7F78-53DD-4501-8BD9-69E21A5051E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2D0E7F78-53DD-4501-8BD9-69E21A5051E3}.Debug|x64.ActiveCfg = Debug|x64
{2D0E7F78-53DD-4501-8BD9-69E21A5051E3}.Debug|x64.Build.0 = Debug|x64
{2D0E7F78-53DD-4501-8BD9-69E21A5051E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2D0E7F78-53DD-4501-8BD9-69E21A5051E3}.Release|Any CPU.Build.0 = Release|Any CPU
{2D0E7F78-53DD-4501-8BD9-69E21A5051E3}.Release|x64.ActiveCfg = Release|x64
{2D0E7F78-53DD-4501-8BD9-69E21A5051E3}.Release|x64.Build.0 = Release|x64
{2EB1B15E-B7CA-494A-B4DC-BF56897A3F2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2EB1B15E-B7CA-494A-B4DC-BF56897A3F2F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2EB1B15E-B7CA-494A-B4DC-BF56897A3F2F}.Debug|x64.ActiveCfg = Debug|x64
{2EB1B15E-B7CA-494A-B4DC-BF56897A3F2F}.Debug|x64.Build.0 = Debug|x64
{2EB1B15E-B7CA-494A-B4DC-BF56897A3F2F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2EB1B15E-B7CA-494A-B4DC-BF56897A3F2F}.Release|Any CPU.Build.0 = Release|Any CPU
{2EB1B15E-B7CA-494A-B4DC-BF56897A3F2F}.Release|x64.ActiveCfg = Release|x64
{2EB1B15E-B7CA-494A-B4DC-BF56897A3F2F}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal