Git Product home page Git Product logo

Comments (3)

ThomasHepworth avatar ThomasHepworth commented on June 17, 2024

@RobinL, I've quickly drafted up a potential solution to address this issue, available for review here.

The proposed changes include:

  1. Removal of Templated Names from the Cache: For example, the name __splink__df_concat_with_tf will no longer appear in the cache.

  2. Addition of a Method for Templated Name Checks: This method sequentially checks a list of provided templated names. This means that if you wish to search for both tf_first_name and concat_with_tf; __splink_df_tf_first_name is return immediately if found; otherwise we search for __splink_df_concat_with_tf and return it if found. This functionality is only intended for use with term frequency tables to determine if they have been generated without requiring any SQL hashing.

  3. Term Frequency Table Registration Changes - Given the changes above, table registration will now overwrite the originally registered tf table. i.e. if __splink__df_concat_with_tf already exists (with any given hashed name), we will now overwrite this table with the table being registered.

It's important to note that this update is based on the assumption (which needs verification and may be incorrect) that in any single Splink session, only one term frequency table should be assigned per column or input nodes table.

Consequently, instead of generating two tables when running compute_tf_table or initialise_df_concat_with_tf, a single table will now be generated and its corresponding templated name will be utilised for cache references.

Term Frequency Caching Demo

Replace compute_tf_table(...) with _initialise_df_concat_with_tf to check the input nodes version.

from splink.duckdb.duckdb_linker import DuckDBLinker
import pandas as pd

from tests.basic_settings import get_settings_dict

df = pd.read_csv("./tests/datasets/fake_1000_from_splink_demos.csv")

linker = DuckDBLinker(
    df,
    get_settings_dict(),
)

# Generates our primary tf table for 'first_name'
tf_table = linker.compute_tf_table("first_name").as_pandas_dataframe()

linker.register_term_frequency_lookup(tf_table, "first_name")  # errors
linker.register_term_frequency_lookup(tf_table, "first_name", overwrite=True)  # registers

from splink.

RobinL avatar RobinL commented on June 17, 2024

Link to our discussion about this so it doesn't get lost:
https://asdslack.slack.com/archives/D02TEUPB6H3/p1700482818591709

from splink.

ThomasHepworth avatar ThomasHepworth commented on June 17, 2024

Closing as this is stale and we are content with the current caching methodology.

from splink.

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.