Coder Social home page Coder Social logo

Comments (3)

serengil avatar serengil commented on July 22, 2024

could you share your data set?

from chefboost.

Gabomfim avatar Gabomfim commented on July 22, 2024

Sorry for keeping you waiting.

I'm sharing with you my notebook with all the files, including the databases used (in the data file).
I managed to fix the problem by importing the database as txt instead of csv.

allstroke.txt is the txt version of the healthcare-dataset-stroke-data.csv database. That did the fix.

We now import the database in this way:
df = pd.read_csv("./data/allStroke.txt", index_col=0)

I don't have the old code with me now, but I can send it to you the next week if needed.

from chefboost.

serengil avatar serengil commented on July 22, 2024

When I run this in my environment, it works well. I have Python 3.8.12, pandas==1.3.5. I recommend you to upgrade or downgrade to my environment level.

from chefboost import Chefboost as chef
import pandas as pd

df = pd.read_csv("healthcare-dataset-stroke-data.csv", index_col=0)

print(df.head())

configGBM = {'algorithm': 'C4.5', 'enableGBM': True, 'epochs': 7, 'learning_rate': 1, 'max_depth': 5, 'enableParallelism': False}
modelGBM = chef.fit(df = df, config = configGBM)

Output logs:
(sefik) sefik@Sefiks-MacBook-Pro Desktop % python hello.py
gender age hypertension heart_disease ever_married work_type Residence_type avg_glucose_level bmi smoking_status Decision
id
9046 Male 67.0 0 1 Yes Private Urban 228.69 36.6 formerly smoked Yes
51676 Female 61.0 0 0 Yes Self-employed Rural 202.21 NaN never smoked Yes
31112 Male 80.0 0 1 Yes Private Rural 105.92 32.5 never smoked Yes
60182 Female 49.0 0 0 Yes Private Urban 171.23 34.4 smokes Yes
1665 Female 79.0 1 0 Yes Self-employed Rural 174.12 24.0 never smoked Yes
Gradient Boosting Machines...
Regression tree is going to be built...
gradient boosting for classification
Epoch 7. Accuracy: 82. Process: : 100%|█████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:42<00:00, 6.02s/it]
The best accuracy got in 6 epoch with the score 82.78210116731518

finished in 42.12960386276245 seconds

Evaluate train set

Accuracy: 82.00389105058366 % on 1028 instances
Labels: ['Yes' 'No']
Confusion matrix: [[99, 35], [150, 744]]
Precision: 73.8806 %, Recall: 39.759 %, F1: 51.6971 %

from chefboost.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.