<commit_before>﻿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);
        }

        [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);

        [DllImport(dll_path + "xgboost_wrapper.dll")]
        public static extern string XGBoosterEvalOneIter(IntPtr handle, int iter, IntPtr[] dmats,
                                           string[] evnames, System.UInt32 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 Double[] XGBoosterPredict(IntPtr handle, IntPtr dmat, int output_margin, System.UInt32 len);
  /*!
   * \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);<commit_msg>sharp higgs demo - training<commit_after>﻿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);
        }

        [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);
  /*!
   * \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 Double[] XGBoosterPredict(IntPtr handle, IntPtr dmat, int output_margin, System.UInt32 len);
  /*!
   * \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);
{'fraction_non_alphanumeric': 0.08558994197292069, 'fraction_numerical': 0.004835589941972921, 'mean_word_length': 3.020408163265306, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '919862', 'n_tokens_mistral': 1246, 'n_tokens_neox': 1199, 'n_words': 321}