Skip to content

Conversation

@AbSsEnT
Copy link
Contributor

@AbSsEnT AbSsEnT commented Nov 23, 2023

No description provided.

@AbSsEnT AbSsEnT added documentation Improvements or additions to documentation enhancement New feature or request labels Nov 23, 2023
@AbSsEnT AbSsEnT requested a review from luca-martial November 23, 2023 12:27
@AbSsEnT AbSsEnT self-assigned this Nov 23, 2023
@AbSsEnT AbSsEnT changed the title Documentation fixes and refurbishing. Documentation fixes and refurbishing [GSK-2145, GSK-2144, GSK-2150]. Nov 23, 2023
@linear
Copy link

linear bot commented Nov 23, 2023

GSK-2145 Correct mistake in customize tests docs

In testing ( https://docs.giskard.ai/en/latest/guides/test-suite/index.html?_gl=1*3thgs5*_ga*MjA0OTkwMDg0Ni4xNjk3NzEzMTI4*_up*MQ..)
mistake in a comment:
# Increase the age by 10% to check if we have more "survived" probability
transformation_function(name="increase age")
def increase_age(row):
row["Age"] = row["Age"] * 0.1
return row
-> this code reduces the age by 90% instead of increasing

mistake in docs here:

https://docs.giskard.ai/en/latest/open_source/customize_tests/test_model/index.html?_gl=1162diil_gaNDY2ODkwMjkuMTY5OTYzNzExNg.._up*MQ..#metamorphic-tests

slack thread https://giskardai.slack.com/archives/C035J3M7WBC/p1699635886107549

GSK-2144 Correct mistake in slicing function

In slicing (https://docs.giskard.ai/en/latest/guides/slice/index.html?_gl=1*2ikezh*_ga*MjA0OTkwMDg0Ni4xNjk3NzEzMTI4*_up*MQ..)
There is a mistake in the cell_level
from giskard import slicing_function, demo
import pandas as pd
_, df = demo.titanic()
dataset = Dataset(df=df, target="Survived", cat_columns=['Pclass', 'Sex', "SibSp", "Parch", "Embarked"])
slicing_function(cell_level=True)
def my_func3(cell: int, threshold: int):
return cell>threshold
train_df.slice(my_func3(threshold=20), column_name='Age')
should be dataset and not train_df

link to docs: https://docs.giskard.ai/en/latest/open_source/customize_tests/data_slices/index.html#create-your-own-slicing-function

go to cell_level tab and correct based on comment above ^

reported in slack by candidate - https://giskardai.slack.com/archives/C035J3M7WBC/p1699635886107549

GSK-2150 Replace pip installs with magic command install in all notebooks

In notebooks, we prefer using the following:

%pip install "giskard[llm]" --upgrade

instead of

!pip install "giskard[llm]" --upgrade

task is to replace wherever applicable

@AbSsEnT AbSsEnT changed the title Documentation fixes and refurbishing [GSK-2145, GSK-2144, GSK-2150]. Documentation fixes and refurbishing [GSK-2144, GSK-2145, GSK-2146, GSK-2150]. Nov 23, 2023
@linear
Copy link

linear bot commented Nov 23, 2023

GSK-2146 Fix error when running test suite from docs code snippet

In testing ( https://docs.giskard.ai/en/latest/guides/test-suite/index.html?_gl=1*3thgs5*_ga*MjA0OTkwMDg0Ni4xNjk3NzEzMTI4*_up*MQ..)
Error message in
suite = (
Suite()
.add_test(
testing.test_f1(
dataset=wrapped_dataset, slicing_function=slice_sex(category="male")
)
)
.add_test(
testing.test_accuracy(
dataset=wrapped_dataset, slicing_function=slice_sex(category="female")
)
)
)

# Create our first model
my_first_model = Model(model=model, model_type="classification")
# Run the suite by specifying our model and display the results
passed_first, results_first = suite.run(model=my_first_model)

TypeError                                 Traceback (most recent call last)
Cell In[23], line 38
35 my_first_model = Model(model=model, model_type="classification")
37 # Run the suite by specifying our model and display the results
---> 38 passed_first, results_first = suite.run(model=my_first_model)
40 # Create an improved version of our model
41 my_improved_model = Model(model=model, model_type="classification")
TypeError: cannot unpack non-iterable TestSuiteResult object
Works well if:  passed = suite.run(model=my_first_model)

docs link: https://docs.giskard.ai/en/latest/open_source/customize_tests/test_model/index.html#create-execute-a-test-suite

error when running code cell, need to fix source of error in py code or modify docs snippet if error coming from there

@mattbit mattbit requested review from mattbit and removed request for luca-martial November 23, 2023 15:08
Copy link
Member

@mattbit mattbit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments, if you could solve before merging

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@kevinmessiaen kevinmessiaen merged commit d7f6014 into main Nov 27, 2023
@kevinmessiaen kevinmessiaen deleted the docs/refurbising branch November 27, 2023 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Development

Successfully merging this pull request may close these issues.

4 participants