repo stringlengths 7 54 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 20 28.4k | docstring stringlengths 1 46.3k | docstring_tokens listlengths 1 1.66k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value | summary stringlengths 4 350 | obf_code stringlengths 7.85k 764k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
modin-project/modin | modin/engines/dask/pandas_on_dask_delayed/frame/partition.py | DaskFramePartition.add_to_apply_calls | def add_to_apply_calls(self, func, **kwargs):
"""Add the function to the apply function call stack.
This function will be executed when apply is called. It will be executed
in the order inserted; apply's func operates the last and return
"""
import dask
self.delayed_cal... | python | def add_to_apply_calls(self, func, **kwargs):
"""Add the function to the apply function call stack.
This function will be executed when apply is called. It will be executed
in the order inserted; apply's func operates the last and return
"""
import dask
self.delayed_cal... | [
"def",
"add_to_apply_calls",
"(",
"self",
",",
"func",
",",
"*",
"*",
"kwargs",
")",
":",
"import",
"dask",
"self",
".",
"delayed_call",
"=",
"dask",
".",
"delayed",
"(",
"func",
")",
"(",
"self",
".",
"delayed_call",
",",
"*",
"*",
"kwargs",
")",
"r... | Add the function to the apply function call stack.
This function will be executed when apply is called. It will be executed
in the order inserted; apply's func operates the last and return | [
"Add",
"the",
"function",
"to",
"the",
"apply",
"function",
"call",
"stack",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/dask/pandas_on_dask_delayed/frame/partition.py#L50-L59 | train | Add the function to the apply function call stack. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/experimental/engines/pyarrow_on_ray/io.py | _read_csv_with_offset_pyarrow_on_ray | def _read_csv_with_offset_pyarrow_on_ray(
fname, num_splits, start, end, kwargs, header
): # pragma: no cover
"""Use a Ray task to read a chunk of a CSV into a pyarrow Table.
Note: Ray functions are not detected by codecov (thus pragma: no cover)
Args:
fname: The filename of the file to open.... | python | def _read_csv_with_offset_pyarrow_on_ray(
fname, num_splits, start, end, kwargs, header
): # pragma: no cover
"""Use a Ray task to read a chunk of a CSV into a pyarrow Table.
Note: Ray functions are not detected by codecov (thus pragma: no cover)
Args:
fname: The filename of the file to open.... | [
"def",
"_read_csv_with_offset_pyarrow_on_ray",
"(",
"fname",
",",
"num_splits",
",",
"start",
",",
"end",
",",
"kwargs",
",",
"header",
")",
":",
"# pragma: no cover",
"bio",
"=",
"open",
"(",
"fname",
",",
"\"rb\"",
")",
"# The header line for the CSV file",
"fir... | Use a Ray task to read a chunk of a CSV into a pyarrow Table.
Note: Ray functions are not detected by codecov (thus pragma: no cover)
Args:
fname: The filename of the file to open.
num_splits: The number of splits (partitions) to separate the DataFrame into.
start: The start byte offse... | [
"Use",
"a",
"Ray",
"task",
"to",
"read",
"a",
"chunk",
"of",
"a",
"CSV",
"into",
"a",
"pyarrow",
"Table",
".",
"Note",
":",
"Ray",
"functions",
"are",
"not",
"detected",
"by",
"codecov",
"(",
"thus",
"pragma",
":",
"no",
"cover",
")",
"Args",
":",
... | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/experimental/engines/pyarrow_on_ray/io.py#L23-L54 | train | Use a Ray task to read a CSV into a list of pyarrow Tables. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/data_management/utils.py | compute_chunksize | def compute_chunksize(df, num_splits, default_block_size=32, axis=None):
"""Computes the number of rows and/or columns to include in each partition.
Args:
df: The DataFrame to split.
num_splits: The maximum number of splits to separate the DataFrame into.
default_block_size: Minimum num... | python | def compute_chunksize(df, num_splits, default_block_size=32, axis=None):
"""Computes the number of rows and/or columns to include in each partition.
Args:
df: The DataFrame to split.
num_splits: The maximum number of splits to separate the DataFrame into.
default_block_size: Minimum num... | [
"def",
"compute_chunksize",
"(",
"df",
",",
"num_splits",
",",
"default_block_size",
"=",
"32",
",",
"axis",
"=",
"None",
")",
":",
"if",
"axis",
"==",
"0",
"or",
"axis",
"is",
"None",
":",
"row_chunksize",
"=",
"get_default_chunksize",
"(",
"len",
"(",
... | Computes the number of rows and/or columns to include in each partition.
Args:
df: The DataFrame to split.
num_splits: The maximum number of splits to separate the DataFrame into.
default_block_size: Minimum number of rows/columns (default set to 32x32).
axis: The axis to split. (0:... | [
"Computes",
"the",
"number",
"of",
"rows",
"and",
"/",
"or",
"columns",
"to",
"include",
"in",
"each",
"partition",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/data_management/utils.py#L24-L52 | train | Computes the number of rows and columns to include in each partition. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/data_management/utils.py | _get_nan_block_id | def _get_nan_block_id(partition_class, n_row=1, n_col=1, transpose=False):
"""A memory efficient way to get a block of NaNs.
Args:
partition_class (BaseFramePartition): The class to use to put the object
in the remote format.
n_row(int): The number of rows.
n_col(int): The n... | python | def _get_nan_block_id(partition_class, n_row=1, n_col=1, transpose=False):
"""A memory efficient way to get a block of NaNs.
Args:
partition_class (BaseFramePartition): The class to use to put the object
in the remote format.
n_row(int): The number of rows.
n_col(int): The n... | [
"def",
"_get_nan_block_id",
"(",
"partition_class",
",",
"n_row",
"=",
"1",
",",
"n_col",
"=",
"1",
",",
"transpose",
"=",
"False",
")",
":",
"global",
"_NAN_BLOCKS",
"if",
"transpose",
":",
"n_row",
",",
"n_col",
"=",
"n_col",
",",
"n_row",
"shape",
"="... | A memory efficient way to get a block of NaNs.
Args:
partition_class (BaseFramePartition): The class to use to put the object
in the remote format.
n_row(int): The number of rows.
n_col(int): The number of columns.
transpose(bool): If true, swap rows and columns.
Ret... | [
"A",
"memory",
"efficient",
"way",
"to",
"get",
"a",
"block",
"of",
"NaNs",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/data_management/utils.py#L55-L75 | train | A memory efficient way to get a new objectID for NaNs. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/data_management/utils.py | split_result_of_axis_func_pandas | def split_result_of_axis_func_pandas(axis, num_splits, result, length_list=None):
"""Split the Pandas result evenly based on the provided number of splits.
Args:
axis: The axis to split across.
num_splits: The number of even splits to create.
result: The result of the computation. This ... | python | def split_result_of_axis_func_pandas(axis, num_splits, result, length_list=None):
"""Split the Pandas result evenly based on the provided number of splits.
Args:
axis: The axis to split across.
num_splits: The number of even splits to create.
result: The result of the computation. This ... | [
"def",
"split_result_of_axis_func_pandas",
"(",
"axis",
",",
"num_splits",
",",
"result",
",",
"length_list",
"=",
"None",
")",
":",
"if",
"num_splits",
"==",
"1",
":",
"return",
"result",
"if",
"length_list",
"is",
"not",
"None",
":",
"length_list",
".",
"i... | Split the Pandas result evenly based on the provided number of splits.
Args:
axis: The axis to split across.
num_splits: The number of even splits to create.
result: The result of the computation. This should be a Pandas
DataFrame.
length_list: The list of lengths to spl... | [
"Split",
"the",
"Pandas",
"result",
"evenly",
"based",
"on",
"the",
"provided",
"number",
"of",
"splits",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/data_management/utils.py#L78-L111 | train | This function splits the Pandas result into num_splits blocks of size num_splits. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/pandas/indexing.py | _parse_tuple | def _parse_tuple(tup):
"""Unpack the user input for getitem and setitem and compute ndim
loc[a] -> ([a], :), 1D
loc[[a,b],] -> ([a,b], :),
loc[a,b] -> ([a], [b]), 0D
"""
row_loc, col_loc = slice(None), slice(None)
if is_tuple(tup):
row_loc = tup[0]
if len(tup) == 2:
... | python | def _parse_tuple(tup):
"""Unpack the user input for getitem and setitem and compute ndim
loc[a] -> ([a], :), 1D
loc[[a,b],] -> ([a,b], :),
loc[a,b] -> ([a], [b]), 0D
"""
row_loc, col_loc = slice(None), slice(None)
if is_tuple(tup):
row_loc = tup[0]
if len(tup) == 2:
... | [
"def",
"_parse_tuple",
"(",
"tup",
")",
":",
"row_loc",
",",
"col_loc",
"=",
"slice",
"(",
"None",
")",
",",
"slice",
"(",
"None",
")",
"if",
"is_tuple",
"(",
"tup",
")",
":",
"row_loc",
"=",
"tup",
"[",
"0",
"]",
"if",
"len",
"(",
"tup",
")",
... | Unpack the user input for getitem and setitem and compute ndim
loc[a] -> ([a], :), 1D
loc[[a,b],] -> ([a,b], :),
loc[a,b] -> ([a], [b]), 0D | [
"Unpack",
"the",
"user",
"input",
"for",
"getitem",
"and",
"setitem",
"and",
"compute",
"ndim"
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/indexing.py#L77-L101 | train | Unpack the user input for getitem and setitem and compute ndim | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/pandas/indexing.py | _is_enlargement | def _is_enlargement(locator, global_index):
"""Determine if a locator will enlarge the global index.
Enlargement happens when you trying to locate using labels isn't in the
original index. In other words, enlargement == adding NaNs !
"""
if (
is_list_like(locator)
and not is_slice(l... | python | def _is_enlargement(locator, global_index):
"""Determine if a locator will enlarge the global index.
Enlargement happens when you trying to locate using labels isn't in the
original index. In other words, enlargement == adding NaNs !
"""
if (
is_list_like(locator)
and not is_slice(l... | [
"def",
"_is_enlargement",
"(",
"locator",
",",
"global_index",
")",
":",
"if",
"(",
"is_list_like",
"(",
"locator",
")",
"and",
"not",
"is_slice",
"(",
"locator",
")",
"and",
"len",
"(",
"locator",
")",
">",
"0",
"and",
"not",
"is_boolean_array",
"(",
"l... | Determine if a locator will enlarge the global index.
Enlargement happens when you trying to locate using labels isn't in the
original index. In other words, enlargement == adding NaNs ! | [
"Determine",
"if",
"a",
"locator",
"will",
"enlarge",
"the",
"global",
"index",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/indexing.py#L104-L120 | train | Determine if a locator will enlarge the global index. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/pandas/indexing.py | _compute_ndim | def _compute_ndim(row_loc, col_loc):
"""Compute the ndim of result from locators
"""
row_scaler = is_scalar(row_loc)
col_scaler = is_scalar(col_loc)
if row_scaler and col_scaler:
ndim = 0
elif row_scaler ^ col_scaler:
ndim = 1
else:
ndim = 2
return ndim | python | def _compute_ndim(row_loc, col_loc):
"""Compute the ndim of result from locators
"""
row_scaler = is_scalar(row_loc)
col_scaler = is_scalar(col_loc)
if row_scaler and col_scaler:
ndim = 0
elif row_scaler ^ col_scaler:
ndim = 1
else:
ndim = 2
return ndim | [
"def",
"_compute_ndim",
"(",
"row_loc",
",",
"col_loc",
")",
":",
"row_scaler",
"=",
"is_scalar",
"(",
"row_loc",
")",
"col_scaler",
"=",
"is_scalar",
"(",
"col_loc",
")",
"if",
"row_scaler",
"and",
"col_scaler",
":",
"ndim",
"=",
"0",
"elif",
"row_scaler",
... | Compute the ndim of result from locators | [
"Compute",
"the",
"ndim",
"of",
"result",
"from",
"locators"
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/indexing.py#L127-L140 | train | Compute the ndim of result from locators
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/pandas/indexing.py | _LocationIndexerBase._broadcast_item | def _broadcast_item(self, row_lookup, col_lookup, item, to_shape):
"""Use numpy to broadcast or reshape item.
Notes:
- Numpy is memory efficient, there shouldn't be performance issue.
"""
# It is valid to pass a DataFrame or Series to __setitem__ that is larger than
... | python | def _broadcast_item(self, row_lookup, col_lookup, item, to_shape):
"""Use numpy to broadcast or reshape item.
Notes:
- Numpy is memory efficient, there shouldn't be performance issue.
"""
# It is valid to pass a DataFrame or Series to __setitem__ that is larger than
... | [
"def",
"_broadcast_item",
"(",
"self",
",",
"row_lookup",
",",
"col_lookup",
",",
"item",
",",
"to_shape",
")",
":",
"# It is valid to pass a DataFrame or Series to __setitem__ that is larger than",
"# the target the user is trying to overwrite. This",
"if",
"isinstance",
"(",
... | Use numpy to broadcast or reshape item.
Notes:
- Numpy is memory efficient, there shouldn't be performance issue. | [
"Use",
"numpy",
"to",
"broadcast",
"or",
"reshape",
"item",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/indexing.py#L187-L221 | train | Use numpy to broadcast or reshape an item. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/pandas/indexing.py | _LocationIndexerBase._write_items | def _write_items(self, row_lookup, col_lookup, item):
"""Perform remote write and replace blocks.
"""
self.qc.write_items(row_lookup, col_lookup, item) | python | def _write_items(self, row_lookup, col_lookup, item):
"""Perform remote write and replace blocks.
"""
self.qc.write_items(row_lookup, col_lookup, item) | [
"def",
"_write_items",
"(",
"self",
",",
"row_lookup",
",",
"col_lookup",
",",
"item",
")",
":",
"self",
".",
"qc",
".",
"write_items",
"(",
"row_lookup",
",",
"col_lookup",
",",
"item",
")"
] | Perform remote write and replace blocks. | [
"Perform",
"remote",
"write",
"and",
"replace",
"blocks",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/indexing.py#L223-L226 | train | Perform remote write and replace blocks.
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/pandas/indexing.py | _LocIndexer._handle_enlargement | def _handle_enlargement(self, row_loc, col_loc):
"""Handle Enlargement (if there is one).
Returns:
None
"""
if _is_enlargement(row_loc, self.qc.index) or _is_enlargement(
col_loc, self.qc.columns
):
_warn_enlargement()
self.qc.enla... | python | def _handle_enlargement(self, row_loc, col_loc):
"""Handle Enlargement (if there is one).
Returns:
None
"""
if _is_enlargement(row_loc, self.qc.index) or _is_enlargement(
col_loc, self.qc.columns
):
_warn_enlargement()
self.qc.enla... | [
"def",
"_handle_enlargement",
"(",
"self",
",",
"row_loc",
",",
"col_loc",
")",
":",
"if",
"_is_enlargement",
"(",
"row_loc",
",",
"self",
".",
"qc",
".",
"index",
")",
"or",
"_is_enlargement",
"(",
"col_loc",
",",
"self",
".",
"qc",
".",
"columns",
")",... | Handle Enlargement (if there is one).
Returns:
None | [
"Handle",
"Enlargement",
"(",
"if",
"there",
"is",
"one",
")",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/indexing.py#L279-L292 | train | Handle Enlargement. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/pandas/indexing.py | _LocIndexer._compute_enlarge_labels | def _compute_enlarge_labels(self, locator, base_index):
"""Helper for _enlarge_axis, compute common labels and extra labels.
Returns:
nan_labels: The labels needs to be added
"""
# base_index_type can be pd.Index or pd.DatetimeIndex
# depending on user input and pan... | python | def _compute_enlarge_labels(self, locator, base_index):
"""Helper for _enlarge_axis, compute common labels and extra labels.
Returns:
nan_labels: The labels needs to be added
"""
# base_index_type can be pd.Index or pd.DatetimeIndex
# depending on user input and pan... | [
"def",
"_compute_enlarge_labels",
"(",
"self",
",",
"locator",
",",
"base_index",
")",
":",
"# base_index_type can be pd.Index or pd.DatetimeIndex",
"# depending on user input and pandas behavior",
"# See issue #2264",
"base_index_type",
"=",
"type",
"(",
"base_index",
")",
"lo... | Helper for _enlarge_axis, compute common labels and extra labels.
Returns:
nan_labels: The labels needs to be added | [
"Helper",
"for",
"_enlarge_axis",
"compute",
"common",
"labels",
"and",
"extra",
"labels",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/indexing.py#L294-L315 | train | Helper for _enlarge_axis compute common labels and extra labels. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/ray/pandas_on_ray/io.py | _split_result_for_readers | def _split_result_for_readers(axis, num_splits, df): # pragma: no cover
"""Splits the DataFrame read into smaller DataFrames and handles all edge cases.
Args:
axis: Which axis to split over.
num_splits: The number of splits to create.
df: The DataFrame after it has been read.
Retu... | python | def _split_result_for_readers(axis, num_splits, df): # pragma: no cover
"""Splits the DataFrame read into smaller DataFrames and handles all edge cases.
Args:
axis: Which axis to split over.
num_splits: The number of splits to create.
df: The DataFrame after it has been read.
Retu... | [
"def",
"_split_result_for_readers",
"(",
"axis",
",",
"num_splits",
",",
"df",
")",
":",
"# pragma: no cover",
"splits",
"=",
"split_result_of_axis_func_pandas",
"(",
"axis",
",",
"num_splits",
",",
"df",
")",
"if",
"not",
"isinstance",
"(",
"splits",
",",
"list... | Splits the DataFrame read into smaller DataFrames and handles all edge cases.
Args:
axis: Which axis to split over.
num_splits: The number of splits to create.
df: The DataFrame after it has been read.
Returns:
A list of pandas DataFrames. | [
"Splits",
"the",
"DataFrame",
"read",
"into",
"smaller",
"DataFrames",
"and",
"handles",
"all",
"edge",
"cases",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/pandas_on_ray/io.py#L18-L32 | train | Splits the DataFrame read into smaller DataFrames and handles all edge cases. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/ray/pandas_on_ray/io.py | _read_parquet_columns | def _read_parquet_columns(path, columns, num_splits, kwargs): # pragma: no cover
"""Use a Ray task to read columns from Parquet into a Pandas DataFrame.
Note: Ray functions are not detected by codecov (thus pragma: no cover)
Args:
path: The path of the Parquet file.
columns: The list of c... | python | def _read_parquet_columns(path, columns, num_splits, kwargs): # pragma: no cover
"""Use a Ray task to read columns from Parquet into a Pandas DataFrame.
Note: Ray functions are not detected by codecov (thus pragma: no cover)
Args:
path: The path of the Parquet file.
columns: The list of c... | [
"def",
"_read_parquet_columns",
"(",
"path",
",",
"columns",
",",
"num_splits",
",",
"kwargs",
")",
":",
"# pragma: no cover",
"import",
"pyarrow",
".",
"parquet",
"as",
"pq",
"df",
"=",
"pq",
".",
"read_pandas",
"(",
"path",
",",
"columns",
"=",
"columns",
... | Use a Ray task to read columns from Parquet into a Pandas DataFrame.
Note: Ray functions are not detected by codecov (thus pragma: no cover)
Args:
path: The path of the Parquet file.
columns: The list of column names to read.
num_splits: The number of partitions to split the column int... | [
"Use",
"a",
"Ray",
"task",
"to",
"read",
"columns",
"from",
"Parquet",
"into",
"a",
"Pandas",
"DataFrame",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/pandas_on_ray/io.py#L36-L56 | train | Use a Ray task to read columns from Parquet into a Pandas DataFrame. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/ray/pandas_on_ray/io.py | _read_csv_with_offset_pandas_on_ray | def _read_csv_with_offset_pandas_on_ray(
fname, num_splits, start, end, kwargs, header
): # pragma: no cover
"""Use a Ray task to read a chunk of a CSV into a Pandas DataFrame.
Note: Ray functions are not detected by codecov (thus pragma: no cover)
Args:
fname: The filename of the file to ope... | python | def _read_csv_with_offset_pandas_on_ray(
fname, num_splits, start, end, kwargs, header
): # pragma: no cover
"""Use a Ray task to read a chunk of a CSV into a Pandas DataFrame.
Note: Ray functions are not detected by codecov (thus pragma: no cover)
Args:
fname: The filename of the file to ope... | [
"def",
"_read_csv_with_offset_pandas_on_ray",
"(",
"fname",
",",
"num_splits",
",",
"start",
",",
"end",
",",
"kwargs",
",",
"header",
")",
":",
"# pragma: no cover",
"index_col",
"=",
"kwargs",
".",
"get",
"(",
"\"index_col\"",
",",
"None",
")",
"bio",
"=",
... | Use a Ray task to read a chunk of a CSV into a Pandas DataFrame.
Note: Ray functions are not detected by codecov (thus pragma: no cover)
Args:
fname: The filename of the file to open.
num_splits: The number of splits (partitions) to separate the DataFrame into.
start: The start byte of... | [
"Use",
"a",
"Ray",
"task",
"to",
"read",
"a",
"chunk",
"of",
"a",
"CSV",
"into",
"a",
"Pandas",
"DataFrame",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/pandas_on_ray/io.py#L60-L96 | train | Use a Ray task to read a chunk of a CSV into a Pandas DataFrame. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/ray/pandas_on_ray/io.py | _read_hdf_columns | def _read_hdf_columns(path_or_buf, columns, num_splits, kwargs): # pragma: no cover
"""Use a Ray task to read columns from HDF5 into a Pandas DataFrame.
Note: Ray functions are not detected by codecov (thus pragma: no cover)
Args:
path_or_buf: The path of the HDF5 file.
columns: The list ... | python | def _read_hdf_columns(path_or_buf, columns, num_splits, kwargs): # pragma: no cover
"""Use a Ray task to read columns from HDF5 into a Pandas DataFrame.
Note: Ray functions are not detected by codecov (thus pragma: no cover)
Args:
path_or_buf: The path of the HDF5 file.
columns: The list ... | [
"def",
"_read_hdf_columns",
"(",
"path_or_buf",
",",
"columns",
",",
"num_splits",
",",
"kwargs",
")",
":",
"# pragma: no cover",
"df",
"=",
"pandas",
".",
"read_hdf",
"(",
"path_or_buf",
",",
"columns",
"=",
"columns",
",",
"*",
"*",
"kwargs",
")",
"# Appen... | Use a Ray task to read columns from HDF5 into a Pandas DataFrame.
Note: Ray functions are not detected by codecov (thus pragma: no cover)
Args:
path_or_buf: The path of the HDF5 file.
columns: The list of column names to read.
num_splits: The number of partitions to split the column in... | [
"Use",
"a",
"Ray",
"task",
"to",
"read",
"columns",
"from",
"HDF5",
"into",
"a",
"Pandas",
"DataFrame",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/pandas_on_ray/io.py#L100-L119 | train | Use a Ray task to read columns from HDF5 into a Pandas DataFrame. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/ray/pandas_on_ray/io.py | _read_feather_columns | def _read_feather_columns(path, columns, num_splits): # pragma: no cover
"""Use a Ray task to read columns from Feather into a Pandas DataFrame.
Note: Ray functions are not detected by codecov (thus pragma: no cover)
Args:
path: The path of the Feather file.
columns: The list of column na... | python | def _read_feather_columns(path, columns, num_splits): # pragma: no cover
"""Use a Ray task to read columns from Feather into a Pandas DataFrame.
Note: Ray functions are not detected by codecov (thus pragma: no cover)
Args:
path: The path of the Feather file.
columns: The list of column na... | [
"def",
"_read_feather_columns",
"(",
"path",
",",
"columns",
",",
"num_splits",
")",
":",
"# pragma: no cover",
"from",
"pyarrow",
"import",
"feather",
"df",
"=",
"feather",
".",
"read_feather",
"(",
"path",
",",
"columns",
"=",
"columns",
")",
"# Append the len... | Use a Ray task to read columns from Feather into a Pandas DataFrame.
Note: Ray functions are not detected by codecov (thus pragma: no cover)
Args:
path: The path of the Feather file.
columns: The list of column names to read.
num_splits: The number of partitions to split the column int... | [
"Use",
"a",
"Ray",
"task",
"to",
"read",
"columns",
"from",
"Feather",
"into",
"a",
"Pandas",
"DataFrame",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/pandas_on_ray/io.py#L123-L143 | train | Use a Ray task to read columns from Feather into a Pandas DataFrame. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/ray/pandas_on_ray/io.py | _read_sql_with_limit_offset | def _read_sql_with_limit_offset(
num_splits, sql, con, index_col, kwargs
): # pragma: no cover
"""Use a Ray task to read a chunk of SQL source.
Note: Ray functions are not detected by codecov (thus pragma: no cover)
"""
pandas_df = pandas.read_sql(sql, con, index_col=index_col, **kwargs)
if in... | python | def _read_sql_with_limit_offset(
num_splits, sql, con, index_col, kwargs
): # pragma: no cover
"""Use a Ray task to read a chunk of SQL source.
Note: Ray functions are not detected by codecov (thus pragma: no cover)
"""
pandas_df = pandas.read_sql(sql, con, index_col=index_col, **kwargs)
if in... | [
"def",
"_read_sql_with_limit_offset",
"(",
"num_splits",
",",
"sql",
",",
"con",
",",
"index_col",
",",
"kwargs",
")",
":",
"# pragma: no cover",
"pandas_df",
"=",
"pandas",
".",
"read_sql",
"(",
"sql",
",",
"con",
",",
"index_col",
"=",
"index_col",
",",
"*... | Use a Ray task to read a chunk of SQL source.
Note: Ray functions are not detected by codecov (thus pragma: no cover) | [
"Use",
"a",
"Ray",
"task",
"to",
"read",
"a",
"chunk",
"of",
"SQL",
"source",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/pandas_on_ray/io.py#L147-L159 | train | Use a Ray task to read a chunk of SQL source. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/ray/generic/io.py | get_index | def get_index(index_name, *partition_indices): # pragma: no cover
"""Get the index from the indices returned by the workers.
Note: Ray functions are not detected by codecov (thus pragma: no cover)"""
index = partition_indices[0].append(partition_indices[1:])
index.names = index_name
return index | python | def get_index(index_name, *partition_indices): # pragma: no cover
"""Get the index from the indices returned by the workers.
Note: Ray functions are not detected by codecov (thus pragma: no cover)"""
index = partition_indices[0].append(partition_indices[1:])
index.names = index_name
return index | [
"def",
"get_index",
"(",
"index_name",
",",
"*",
"partition_indices",
")",
":",
"# pragma: no cover",
"index",
"=",
"partition_indices",
"[",
"0",
"]",
".",
"append",
"(",
"partition_indices",
"[",
"1",
":",
"]",
")",
"index",
".",
"names",
"=",
"index_name"... | Get the index from the indices returned by the workers.
Note: Ray functions are not detected by codecov (thus pragma: no cover) | [
"Get",
"the",
"index",
"from",
"the",
"indices",
"returned",
"by",
"the",
"workers",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/generic/io.py#L64-L70 | train | Get the index from the indices returned by the workers. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/ray/generic/io.py | RayIO.read_parquet | def read_parquet(cls, path, engine, columns, **kwargs):
"""Load a parquet object from the file path, returning a DataFrame.
Ray DataFrame only supports pyarrow engine for now.
Args:
path: The filepath of the parquet file.
We only support local files for now.
... | python | def read_parquet(cls, path, engine, columns, **kwargs):
"""Load a parquet object from the file path, returning a DataFrame.
Ray DataFrame only supports pyarrow engine for now.
Args:
path: The filepath of the parquet file.
We only support local files for now.
... | [
"def",
"read_parquet",
"(",
"cls",
",",
"path",
",",
"engine",
",",
"columns",
",",
"*",
"*",
"kwargs",
")",
":",
"from",
"pyarrow",
".",
"parquet",
"import",
"ParquetFile",
"if",
"cls",
".",
"read_parquet_remote_task",
"is",
"None",
":",
"return",
"super"... | Load a parquet object from the file path, returning a DataFrame.
Ray DataFrame only supports pyarrow engine for now.
Args:
path: The filepath of the parquet file.
We only support local files for now.
engine: Ray only support pyarrow reader.
... | [
"Load",
"a",
"parquet",
"object",
"from",
"the",
"file",
"path",
"returning",
"a",
"DataFrame",
".",
"Ray",
"DataFrame",
"only",
"supports",
"pyarrow",
"engine",
"for",
"now",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/generic/io.py#L129-L193 | train | Load a parquet file into a DataFrame. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/ray/generic/io.py | RayIO._read_csv_from_file_pandas_on_ray | def _read_csv_from_file_pandas_on_ray(cls, filepath, kwargs={}):
"""Constructs a DataFrame from a CSV file.
Args:
filepath (str): path to the CSV file.
npartitions (int): number of partitions for the DataFrame.
kwargs (dict): args excluding filepath provided to read_... | python | def _read_csv_from_file_pandas_on_ray(cls, filepath, kwargs={}):
"""Constructs a DataFrame from a CSV file.
Args:
filepath (str): path to the CSV file.
npartitions (int): number of partitions for the DataFrame.
kwargs (dict): args excluding filepath provided to read_... | [
"def",
"_read_csv_from_file_pandas_on_ray",
"(",
"cls",
",",
"filepath",
",",
"kwargs",
"=",
"{",
"}",
")",
":",
"names",
"=",
"kwargs",
".",
"get",
"(",
"\"names\"",
",",
"None",
")",
"index_col",
"=",
"kwargs",
".",
"get",
"(",
"\"index_col\"",
",",
"N... | Constructs a DataFrame from a CSV file.
Args:
filepath (str): path to the CSV file.
npartitions (int): number of partitions for the DataFrame.
kwargs (dict): args excluding filepath provided to read_csv.
Returns:
DataFrame or Series constructed from CSV ... | [
"Constructs",
"a",
"DataFrame",
"from",
"a",
"CSV",
"file",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/generic/io.py#L242-L357 | train | Reads a DataFrame from a CSV file and returns a Series or DataFrame. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/ray/generic/io.py | RayIO._read | def _read(cls, filepath_or_buffer, **kwargs):
"""Read csv file from local disk.
Args:
filepath_or_buffer:
The filepath of the csv file.
We only support local files for now.
kwargs: Keyword arguments in pandas.read_csv
"""
# The ... | python | def _read(cls, filepath_or_buffer, **kwargs):
"""Read csv file from local disk.
Args:
filepath_or_buffer:
The filepath of the csv file.
We only support local files for now.
kwargs: Keyword arguments in pandas.read_csv
"""
# The ... | [
"def",
"_read",
"(",
"cls",
",",
"filepath_or_buffer",
",",
"*",
"*",
"kwargs",
")",
":",
"# The intention of the inspection code is to reduce the amount of",
"# communication we have to do between processes and nodes. We take a quick",
"# pass over the arguments and remove those that ar... | Read csv file from local disk.
Args:
filepath_or_buffer:
The filepath of the csv file.
We only support local files for now.
kwargs: Keyword arguments in pandas.read_csv | [
"Read",
"csv",
"file",
"from",
"local",
"disk",
".",
"Args",
":",
"filepath_or_buffer",
":",
"The",
"filepath",
"of",
"the",
"csv",
"file",
".",
"We",
"only",
"support",
"local",
"files",
"for",
"now",
".",
"kwargs",
":",
"Keyword",
"arguments",
"in",
"p... | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/generic/io.py#L483-L551 | train | Read a single entry from a local file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/ray/generic/io.py | RayIO.read_hdf | def read_hdf(cls, path_or_buf, **kwargs):
"""Load a h5 file from the file path or buffer, returning a DataFrame.
Args:
path_or_buf: string, buffer or path object
Path to the file to open, or an open :class:`pandas.HDFStore` object.
kwargs: Pass into pandas.read_h... | python | def read_hdf(cls, path_or_buf, **kwargs):
"""Load a h5 file from the file path or buffer, returning a DataFrame.
Args:
path_or_buf: string, buffer or path object
Path to the file to open, or an open :class:`pandas.HDFStore` object.
kwargs: Pass into pandas.read_h... | [
"def",
"read_hdf",
"(",
"cls",
",",
"path_or_buf",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"cls",
".",
"read_hdf_remote_task",
"is",
"None",
":",
"return",
"super",
"(",
"RayIO",
",",
"cls",
")",
".",
"read_hdf",
"(",
"path_or_buf",
",",
"*",
"*",
"... | Load a h5 file from the file path or buffer, returning a DataFrame.
Args:
path_or_buf: string, buffer or path object
Path to the file to open, or an open :class:`pandas.HDFStore` object.
kwargs: Pass into pandas.read_hdf function.
Returns:
DataFrame ... | [
"Load",
"a",
"h5",
"file",
"from",
"the",
"file",
"path",
"or",
"buffer",
"returning",
"a",
"DataFrame",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/generic/io.py#L565-L625 | train | Load a h5 file from the file path or buffer returning a DataFrame. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/ray/generic/io.py | RayIO.read_feather | def read_feather(cls, path, columns=None, use_threads=True):
"""Read a pandas.DataFrame from Feather format.
Ray DataFrame only supports pyarrow engine for now.
Args:
path: The filepath of the feather file.
We only support local files for now.
mu... | python | def read_feather(cls, path, columns=None, use_threads=True):
"""Read a pandas.DataFrame from Feather format.
Ray DataFrame only supports pyarrow engine for now.
Args:
path: The filepath of the feather file.
We only support local files for now.
mu... | [
"def",
"read_feather",
"(",
"cls",
",",
"path",
",",
"columns",
"=",
"None",
",",
"use_threads",
"=",
"True",
")",
":",
"if",
"cls",
".",
"read_feather_remote_task",
"is",
"None",
":",
"return",
"super",
"(",
"RayIO",
",",
"cls",
")",
".",
"read_feather"... | Read a pandas.DataFrame from Feather format.
Ray DataFrame only supports pyarrow engine for now.
Args:
path: The filepath of the feather file.
We only support local files for now.
multi threading is set to True by default
columns: not support... | [
"Read",
"a",
"pandas",
".",
"DataFrame",
"from",
"Feather",
"format",
".",
"Ray",
"DataFrame",
"only",
"supports",
"pyarrow",
"engine",
"for",
"now",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/generic/io.py#L628-L686 | train | Read a pandas. DataFrame from Feather format. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/ray/generic/io.py | RayIO.to_sql | def to_sql(cls, qc, **kwargs):
"""Write records stored in a DataFrame to a SQL database.
Args:
qc: the query compiler of the DF that we want to run to_sql on
kwargs: parameters for pandas.to_sql(**kwargs)
"""
# we first insert an empty DF in order to create the fu... | python | def to_sql(cls, qc, **kwargs):
"""Write records stored in a DataFrame to a SQL database.
Args:
qc: the query compiler of the DF that we want to run to_sql on
kwargs: parameters for pandas.to_sql(**kwargs)
"""
# we first insert an empty DF in order to create the fu... | [
"def",
"to_sql",
"(",
"cls",
",",
"qc",
",",
"*",
"*",
"kwargs",
")",
":",
"# we first insert an empty DF in order to create the full table in the database",
"# This also helps to validate the input against pandas",
"# we would like to_sql() to complete only when all rows have been inser... | Write records stored in a DataFrame to a SQL database.
Args:
qc: the query compiler of the DF that we want to run to_sql on
kwargs: parameters for pandas.to_sql(**kwargs) | [
"Write",
"records",
"stored",
"in",
"a",
"DataFrame",
"to",
"a",
"SQL",
"database",
".",
"Args",
":",
"qc",
":",
"the",
"query",
"compiler",
"of",
"the",
"DF",
"that",
"we",
"want",
"to",
"run",
"to_sql",
"on",
"kwargs",
":",
"parameters",
"for",
"pand... | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/generic/io.py#L689-L715 | train | Write records stored in a DataFrame to a SQL database. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/ray/generic/io.py | RayIO.read_sql | def read_sql(cls, sql, con, index_col=None, **kwargs):
"""Reads a SQL query or database table into a DataFrame.
Args:
sql: string or SQLAlchemy Selectable (select or text object) SQL query to be
executed or a table name.
con: SQLAlchemy connectable (engine/connect... | python | def read_sql(cls, sql, con, index_col=None, **kwargs):
"""Reads a SQL query or database table into a DataFrame.
Args:
sql: string or SQLAlchemy Selectable (select or text object) SQL query to be
executed or a table name.
con: SQLAlchemy connectable (engine/connect... | [
"def",
"read_sql",
"(",
"cls",
",",
"sql",
",",
"con",
",",
"index_col",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"cls",
".",
"read_sql_remote_task",
"is",
"None",
":",
"return",
"super",
"(",
"RayIO",
",",
"cls",
")",
".",
"read_sql",
... | Reads a SQL query or database table into a DataFrame.
Args:
sql: string or SQLAlchemy Selectable (select or text object) SQL query to be
executed or a table name.
con: SQLAlchemy connectable (engine/connection) or database string URI or
DBAPI2 connection (... | [
"Reads",
"a",
"SQL",
"query",
"or",
"database",
"table",
"into",
"a",
"DataFrame",
".",
"Args",
":",
"sql",
":",
"string",
"or",
"SQLAlchemy",
"Selectable",
"(",
"select",
"or",
"text",
"object",
")",
"SQL",
"query",
"to",
"be",
"executed",
"or",
"a",
... | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/generic/io.py#L718-L763 | train | Reads a SQL query or database table into a DataFrame. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/pandas/datetimes.py | to_datetime | def to_datetime(
arg,
errors="raise",
dayfirst=False,
yearfirst=False,
utc=None,
box=True,
format=None,
exact=True,
unit=None,
infer_datetime_format=False,
origin="unix",
cache=False,
):
"""Convert the arg to datetime format. If not Ray DataFrame, this falls
ba... | python | def to_datetime(
arg,
errors="raise",
dayfirst=False,
yearfirst=False,
utc=None,
box=True,
format=None,
exact=True,
unit=None,
infer_datetime_format=False,
origin="unix",
cache=False,
):
"""Convert the arg to datetime format. If not Ray DataFrame, this falls
ba... | [
"def",
"to_datetime",
"(",
"arg",
",",
"errors",
"=",
"\"raise\"",
",",
"dayfirst",
"=",
"False",
",",
"yearfirst",
"=",
"False",
",",
"utc",
"=",
"None",
",",
"box",
"=",
"True",
",",
"format",
"=",
"None",
",",
"exact",
"=",
"True",
",",
"unit",
... | Convert the arg to datetime format. If not Ray DataFrame, this falls
back on pandas.
Args:
errors ('raise' or 'ignore'): If 'ignore', errors are silenced.
Pandas blatantly ignores this argument so we will too.
dayfirst (bool): Date format is passed in as day first.
yearfi... | [
"Convert",
"the",
"arg",
"to",
"datetime",
"format",
".",
"If",
"not",
"Ray",
"DataFrame",
"this",
"falls",
"back",
"on",
"pandas",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/datetimes.py#L10-L77 | train | Convert the argument to a datetime object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/experimental/pandas/io_exp.py | read_sql | def read_sql(
sql,
con,
index_col=None,
coerce_float=True,
params=None,
parse_dates=None,
columns=None,
chunksize=None,
partition_column=None,
lower_bound=None,
upper_bound=None,
max_sessions=None,
):
""" Read SQL query or database table into a DataFrame.
Args:
... | python | def read_sql(
sql,
con,
index_col=None,
coerce_float=True,
params=None,
parse_dates=None,
columns=None,
chunksize=None,
partition_column=None,
lower_bound=None,
upper_bound=None,
max_sessions=None,
):
""" Read SQL query or database table into a DataFrame.
Args:
... | [
"def",
"read_sql",
"(",
"sql",
",",
"con",
",",
"index_col",
"=",
"None",
",",
"coerce_float",
"=",
"True",
",",
"params",
"=",
"None",
",",
"parse_dates",
"=",
"None",
",",
"columns",
"=",
"None",
",",
"chunksize",
"=",
"None",
",",
"partition_column",
... | Read SQL query or database table into a DataFrame.
Args:
sql: string or SQLAlchemy Selectable (select or text object) SQL query to be executed or a table name.
con: SQLAlchemy connectable (engine/connection) or database string URI or DBAPI2 connection (fallback mode)
index_col: Column(s) to... | [
"Read",
"SQL",
"query",
"or",
"database",
"table",
"into",
"a",
"DataFrame",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/experimental/pandas/io_exp.py#L7-L53 | train | Read SQL query or database table into DataFrame. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/ray/generic/frame/partition_manager.py | RayFrameManager.block_lengths | def block_lengths(self):
"""Gets the lengths of the blocks.
Note: This works with the property structure `_lengths_cache` to avoid
having to recompute these values each time they are needed.
"""
if self._lengths_cache is None:
try:
# The first col... | python | def block_lengths(self):
"""Gets the lengths of the blocks.
Note: This works with the property structure `_lengths_cache` to avoid
having to recompute these values each time they are needed.
"""
if self._lengths_cache is None:
try:
# The first col... | [
"def",
"block_lengths",
"(",
"self",
")",
":",
"if",
"self",
".",
"_lengths_cache",
"is",
"None",
":",
"try",
":",
"# The first column will have the correct lengths. We have an",
"# invariant that requires that all blocks be the same length in a",
"# row of blocks.",
"self",
".... | Gets the lengths of the blocks.
Note: This works with the property structure `_lengths_cache` to avoid
having to recompute these values each time they are needed. | [
"Gets",
"the",
"lengths",
"of",
"the",
"blocks",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/generic/frame/partition_manager.py#L24-L42 | train | Gets the lengths of the blocks. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/ray/generic/frame/partition_manager.py | RayFrameManager.block_widths | def block_widths(self):
"""Gets the widths of the blocks.
Note: This works with the property structure `_widths_cache` to avoid
having to recompute these values each time they are needed.
"""
if self._widths_cache is None:
try:
# The first column ... | python | def block_widths(self):
"""Gets the widths of the blocks.
Note: This works with the property structure `_widths_cache` to avoid
having to recompute these values each time they are needed.
"""
if self._widths_cache is None:
try:
# The first column ... | [
"def",
"block_widths",
"(",
"self",
")",
":",
"if",
"self",
".",
"_widths_cache",
"is",
"None",
":",
"try",
":",
"# The first column will have the correct lengths. We have an",
"# invariant that requires that all blocks be the same width in a",
"# column of blocks.",
"self",
".... | Gets the widths of the blocks.
Note: This works with the property structure `_widths_cache` to avoid
having to recompute these values each time they are needed. | [
"Gets",
"the",
"widths",
"of",
"the",
"blocks",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/generic/frame/partition_manager.py#L45-L63 | train | Gets the widths of the blocks. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/ray/pandas_on_ray/frame/partition.py | deploy_ray_func | def deploy_ray_func(func, partition, kwargs): # pragma: no cover
"""Deploy a function to a partition in Ray.
Note: Ray functions are not detected by codecov (thus pragma: no cover)
Args:
func: The function to apply.
partition: The partition to apply the function to.
kwargs: A dict... | python | def deploy_ray_func(func, partition, kwargs): # pragma: no cover
"""Deploy a function to a partition in Ray.
Note: Ray functions are not detected by codecov (thus pragma: no cover)
Args:
func: The function to apply.
partition: The partition to apply the function to.
kwargs: A dict... | [
"def",
"deploy_ray_func",
"(",
"func",
",",
"partition",
",",
"kwargs",
")",
":",
"# pragma: no cover",
"try",
":",
"return",
"func",
"(",
"partition",
",",
"*",
"*",
"kwargs",
")",
"# Sometimes Arrow forces us to make a copy of an object before we operate",
"# on it. W... | Deploy a function to a partition in Ray.
Note: Ray functions are not detected by codecov (thus pragma: no cover)
Args:
func: The function to apply.
partition: The partition to apply the function to.
kwargs: A dictionary of keyword arguments for the function.
Returns:
The r... | [
"Deploy",
"a",
"function",
"to",
"a",
"partition",
"in",
"Ray",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/pandas_on_ray/frame/partition.py#L124-L143 | train | Deploy a function to a partition in Ray.
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/ray/pandas_on_ray/frame/partition.py | PandasOnRayFramePartition.get | def get(self):
"""Gets the object out of the plasma store.
Returns:
The object from the plasma store.
"""
if len(self.call_queue):
return self.apply(lambda x: x).get()
try:
return ray.get(self.oid)
except RayTaskError as e:
... | python | def get(self):
"""Gets the object out of the plasma store.
Returns:
The object from the plasma store.
"""
if len(self.call_queue):
return self.apply(lambda x: x).get()
try:
return ray.get(self.oid)
except RayTaskError as e:
... | [
"def",
"get",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"call_queue",
")",
":",
"return",
"self",
".",
"apply",
"(",
"lambda",
"x",
":",
"x",
")",
".",
"get",
"(",
")",
"try",
":",
"return",
"ray",
".",
"get",
"(",
"self",
".",
"o... | Gets the object out of the plasma store.
Returns:
The object from the plasma store. | [
"Gets",
"the",
"object",
"out",
"of",
"the",
"plasma",
"store",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/pandas_on_ray/frame/partition.py#L21-L32 | train | Gets the object out of the plasma store. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/base/frame/partition_manager.py | BaseFrameManager.block_lengths | def block_lengths(self):
"""Gets the lengths of the blocks.
Note: This works with the property structure `_lengths_cache` to avoid
having to recompute these values each time they are needed.
"""
if self._lengths_cache is None:
# The first column will have the cor... | python | def block_lengths(self):
"""Gets the lengths of the blocks.
Note: This works with the property structure `_lengths_cache` to avoid
having to recompute these values each time they are needed.
"""
if self._lengths_cache is None:
# The first column will have the cor... | [
"def",
"block_lengths",
"(",
"self",
")",
":",
"if",
"self",
".",
"_lengths_cache",
"is",
"None",
":",
"# The first column will have the correct lengths. We have an",
"# invariant that requires that all blocks be the same length in a",
"# row of blocks.",
"self",
".",
"_lengths_c... | Gets the lengths of the blocks.
Note: This works with the property structure `_lengths_cache` to avoid
having to recompute these values each time they are needed. | [
"Gets",
"the",
"lengths",
"of",
"the",
"blocks",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L132-L147 | train | Gets the lengths of the blocks. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/base/frame/partition_manager.py | BaseFrameManager.block_widths | def block_widths(self):
"""Gets the widths of the blocks.
Note: This works with the property structure `_widths_cache` to avoid
having to recompute these values each time they are needed.
"""
if self._widths_cache is None:
# The first column will have the correct... | python | def block_widths(self):
"""Gets the widths of the blocks.
Note: This works with the property structure `_widths_cache` to avoid
having to recompute these values each time they are needed.
"""
if self._widths_cache is None:
# The first column will have the correct... | [
"def",
"block_widths",
"(",
"self",
")",
":",
"if",
"self",
".",
"_widths_cache",
"is",
"None",
":",
"# The first column will have the correct lengths. We have an",
"# invariant that requires that all blocks be the same width in a",
"# column of blocks.",
"self",
".",
"_widths_ca... | Gets the widths of the blocks.
Note: This works with the property structure `_widths_cache` to avoid
having to recompute these values each time they are needed. | [
"Gets",
"the",
"widths",
"of",
"the",
"blocks",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L153-L168 | train | Gets the widths of the blocks. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/base/frame/partition_manager.py | BaseFrameManager.map_across_blocks | def map_across_blocks(self, map_func):
"""Applies `map_func` to every partition.
Args:
map_func: The function to apply.
Returns:
A new BaseFrameManager object, the type of object that called this.
"""
preprocessed_map_func = self.preprocess_func(map_func... | python | def map_across_blocks(self, map_func):
"""Applies `map_func` to every partition.
Args:
map_func: The function to apply.
Returns:
A new BaseFrameManager object, the type of object that called this.
"""
preprocessed_map_func = self.preprocess_func(map_func... | [
"def",
"map_across_blocks",
"(",
"self",
",",
"map_func",
")",
":",
"preprocessed_map_func",
"=",
"self",
".",
"preprocess_func",
"(",
"map_func",
")",
"new_partitions",
"=",
"np",
".",
"array",
"(",
"[",
"[",
"part",
".",
"apply",
"(",
"preprocessed_map_func"... | Applies `map_func` to every partition.
Args:
map_func: The function to apply.
Returns:
A new BaseFrameManager object, the type of object that called this. | [
"Applies",
"map_func",
"to",
"every",
"partition",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L200-L216 | train | Applies map_func to every partition of the base frame manager. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/base/frame/partition_manager.py | BaseFrameManager.copartition_datasets | def copartition_datasets(self, axis, other, left_func, right_func):
"""Copartition two BlockPartitions objects.
Args:
axis: The axis to copartition.
other: The other BlockPartitions object to copartition with.
left_func: The function to apply to left. If None, just u... | python | def copartition_datasets(self, axis, other, left_func, right_func):
"""Copartition two BlockPartitions objects.
Args:
axis: The axis to copartition.
other: The other BlockPartitions object to copartition with.
left_func: The function to apply to left. If None, just u... | [
"def",
"copartition_datasets",
"(",
"self",
",",
"axis",
",",
"other",
",",
"left_func",
",",
"right_func",
")",
":",
"if",
"left_func",
"is",
"None",
":",
"new_self",
"=",
"self",
"else",
":",
"new_self",
"=",
"self",
".",
"map_across_full_axis",
"(",
"ax... | Copartition two BlockPartitions objects.
Args:
axis: The axis to copartition.
other: The other BlockPartitions object to copartition with.
left_func: The function to apply to left. If None, just use the dimension
of self (based on axis).
right_fun... | [
"Copartition",
"two",
"BlockPartitions",
"objects",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L231-L275 | train | Copartition two BlockPartitions objects. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/base/frame/partition_manager.py | BaseFrameManager.map_across_full_axis | def map_across_full_axis(self, axis, map_func):
"""Applies `map_func` to every partition.
Note: This method should be used in the case that `map_func` relies on
some global information about the axis.
Args:
axis: The axis to perform the map across (0 - index, 1 - column... | python | def map_across_full_axis(self, axis, map_func):
"""Applies `map_func` to every partition.
Note: This method should be used in the case that `map_func` relies on
some global information about the axis.
Args:
axis: The axis to perform the map across (0 - index, 1 - column... | [
"def",
"map_across_full_axis",
"(",
"self",
",",
"axis",
",",
"map_func",
")",
":",
"# Since we are already splitting the DataFrame back up after an",
"# operation, we will just use this time to compute the number of",
"# partitions as best we can right now.",
"num_splits",
"=",
"self"... | Applies `map_func` to every partition.
Note: This method should be used in the case that `map_func` relies on
some global information about the axis.
Args:
axis: The axis to perform the map across (0 - index, 1 - columns).
map_func: The function to apply.
R... | [
"Applies",
"map_func",
"to",
"every",
"partition",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L277-L313 | train | Applies a function to every partition of the BaseFrameManager. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/base/frame/partition_manager.py | BaseFrameManager.take | def take(self, axis, n):
"""Take the first (or last) n rows or columns from the blocks
Note: Axis = 0 will be equivalent to `head` or `tail`
Axis = 1 will be equivalent to `front` or `back`
Args:
axis: The axis to extract (0 for extracting rows, 1 for extracting colum... | python | def take(self, axis, n):
"""Take the first (or last) n rows or columns from the blocks
Note: Axis = 0 will be equivalent to `head` or `tail`
Axis = 1 will be equivalent to `front` or `back`
Args:
axis: The axis to extract (0 for extracting rows, 1 for extracting colum... | [
"def",
"take",
"(",
"self",
",",
"axis",
",",
"n",
")",
":",
"# These are the partitions that we will extract over",
"if",
"not",
"axis",
":",
"partitions",
"=",
"self",
".",
"partitions",
"bin_lengths",
"=",
"self",
".",
"block_lengths",
"else",
":",
"partition... | Take the first (or last) n rows or columns from the blocks
Note: Axis = 0 will be equivalent to `head` or `tail`
Axis = 1 will be equivalent to `front` or `back`
Args:
axis: The axis to extract (0 for extracting rows, 1 for extracting columns)
n: The number of row... | [
"Take",
"the",
"first",
"(",
"or",
"last",
")",
"n",
"rows",
"or",
"columns",
"from",
"the",
"blocks"
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L315-L396 | train | Take the first n rows or columns from the blocks of the specified axis. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/base/frame/partition_manager.py | BaseFrameManager.concat | def concat(self, axis, other_blocks):
"""Concatenate the blocks with another set of blocks.
Note: Assumes that the blocks are already the same shape on the
dimension being concatenated. A ValueError will be thrown if this
condition is not met.
Args:
axis: Th... | python | def concat(self, axis, other_blocks):
"""Concatenate the blocks with another set of blocks.
Note: Assumes that the blocks are already the same shape on the
dimension being concatenated. A ValueError will be thrown if this
condition is not met.
Args:
axis: Th... | [
"def",
"concat",
"(",
"self",
",",
"axis",
",",
"other_blocks",
")",
":",
"if",
"type",
"(",
"other_blocks",
")",
"is",
"list",
":",
"other_blocks",
"=",
"[",
"blocks",
".",
"partitions",
"for",
"blocks",
"in",
"other_blocks",
"]",
"return",
"self",
".",... | Concatenate the blocks with another set of blocks.
Note: Assumes that the blocks are already the same shape on the
dimension being concatenated. A ValueError will be thrown if this
condition is not met.
Args:
axis: The axis to concatenate to.
other_block... | [
"Concatenate",
"the",
"blocks",
"with",
"another",
"set",
"of",
"blocks",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L398-L421 | train | Concatenate the blocks with another set of blocks. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/base/frame/partition_manager.py | BaseFrameManager.to_pandas | def to_pandas(self, is_transposed=False):
"""Convert this object into a Pandas DataFrame from the partitions.
Args:
is_transposed: A flag for telling this object that the external
representation is transposed, but not the internal.
Returns:
A Pandas Data... | python | def to_pandas(self, is_transposed=False):
"""Convert this object into a Pandas DataFrame from the partitions.
Args:
is_transposed: A flag for telling this object that the external
representation is transposed, but not the internal.
Returns:
A Pandas Data... | [
"def",
"to_pandas",
"(",
"self",
",",
"is_transposed",
"=",
"False",
")",
":",
"# In the case this is transposed, it is easier to just temporarily",
"# transpose back then transpose after the conversion. The performance",
"# is the same as if we individually transposed the blocks and",
"# ... | Convert this object into a Pandas DataFrame from the partitions.
Args:
is_transposed: A flag for telling this object that the external
representation is transposed, but not the internal.
Returns:
A Pandas DataFrame | [
"Convert",
"this",
"object",
"into",
"a",
"Pandas",
"DataFrame",
"from",
"the",
"partitions",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L439-L481 | train | Convert this object into a Pandas DataFrame from the partitions. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/base/frame/partition_manager.py | BaseFrameManager.get_indices | def get_indices(self, axis=0, index_func=None, old_blocks=None):
"""This gets the internal indices stored in the partitions.
Note: These are the global indices of the object. This is mostly useful
when you have deleted rows/columns internally, but do not know
which ones were del... | python | def get_indices(self, axis=0, index_func=None, old_blocks=None):
"""This gets the internal indices stored in the partitions.
Note: These are the global indices of the object. This is mostly useful
when you have deleted rows/columns internally, but do not know
which ones were del... | [
"def",
"get_indices",
"(",
"self",
",",
"axis",
"=",
"0",
",",
"index_func",
"=",
"None",
",",
"old_blocks",
"=",
"None",
")",
":",
"ErrorMessage",
".",
"catch_bugs_and_request_email",
"(",
"not",
"callable",
"(",
"index_func",
")",
")",
"func",
"=",
"self... | This gets the internal indices stored in the partitions.
Note: These are the global indices of the object. This is mostly useful
when you have deleted rows/columns internally, but do not know
which ones were deleted.
Args:
axis: This axis to extract the labels. (0 -... | [
"This",
"gets",
"the",
"internal",
"indices",
"stored",
"in",
"the",
"partitions",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L503-L566 | train | This function gets the internal indices of the objects in the partitions. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/base/frame/partition_manager.py | BaseFrameManager._get_blocks_containing_index | def _get_blocks_containing_index(self, axis, index):
"""Convert a global index to a block index and local index.
Note: This method is primarily used to convert a global index into a
partition index (along the axis provided) and local index (useful
for `iloc` or similar operation... | python | def _get_blocks_containing_index(self, axis, index):
"""Convert a global index to a block index and local index.
Note: This method is primarily used to convert a global index into a
partition index (along the axis provided) and local index (useful
for `iloc` or similar operation... | [
"def",
"_get_blocks_containing_index",
"(",
"self",
",",
"axis",
",",
"index",
")",
":",
"if",
"not",
"axis",
":",
"ErrorMessage",
".",
"catch_bugs_and_request_email",
"(",
"index",
">",
"sum",
"(",
"self",
".",
"block_widths",
")",
")",
"cumulative_column_width... | Convert a global index to a block index and local index.
Note: This method is primarily used to convert a global index into a
partition index (along the axis provided) and local index (useful
for `iloc` or similar operations.
Args:
axis: The axis along which to get ... | [
"Convert",
"a",
"global",
"index",
"to",
"a",
"block",
"index",
"and",
"local",
"index",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L580-L618 | train | Convert a global index into a block index and internal index. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/base/frame/partition_manager.py | BaseFrameManager._get_dict_of_block_index | def _get_dict_of_block_index(self, axis, indices, ordered=False):
"""Convert indices to a dict of block index to internal index mapping.
Note: See `_get_blocks_containing_index` for primary usage. This method
accepts a list of indices rather than just a single value, and uses
`_... | python | def _get_dict_of_block_index(self, axis, indices, ordered=False):
"""Convert indices to a dict of block index to internal index mapping.
Note: See `_get_blocks_containing_index` for primary usage. This method
accepts a list of indices rather than just a single value, and uses
`_... | [
"def",
"_get_dict_of_block_index",
"(",
"self",
",",
"axis",
",",
"indices",
",",
"ordered",
"=",
"False",
")",
":",
"# Get the internal index and create a dictionary so we only have to",
"# travel to each partition once.",
"all_partitions_and_idx",
"=",
"[",
"self",
".",
"... | Convert indices to a dict of block index to internal index mapping.
Note: See `_get_blocks_containing_index` for primary usage. This method
accepts a list of indices rather than just a single value, and uses
`_get_blocks_containing_index`.
Args:
axis: The axis along... | [
"Convert",
"indices",
"to",
"a",
"dict",
"of",
"block",
"index",
"to",
"internal",
"index",
"mapping",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L620-L668 | train | Convert indices to a dictionary of block index to internal index mapping. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/base/frame/partition_manager.py | BaseFrameManager._apply_func_to_list_of_partitions | def _apply_func_to_list_of_partitions(self, func, partitions, **kwargs):
"""Applies a function to a list of remote partitions.
Note: The main use for this is to preprocess the func.
Args:
func: The func to apply
partitions: The list of partitions
Returns:
... | python | def _apply_func_to_list_of_partitions(self, func, partitions, **kwargs):
"""Applies a function to a list of remote partitions.
Note: The main use for this is to preprocess the func.
Args:
func: The func to apply
partitions: The list of partitions
Returns:
... | [
"def",
"_apply_func_to_list_of_partitions",
"(",
"self",
",",
"func",
",",
"partitions",
",",
"*",
"*",
"kwargs",
")",
":",
"preprocessed_func",
"=",
"self",
".",
"preprocess_func",
"(",
"func",
")",
"return",
"[",
"obj",
".",
"apply",
"(",
"preprocessed_func"... | Applies a function to a list of remote partitions.
Note: The main use for this is to preprocess the func.
Args:
func: The func to apply
partitions: The list of partitions
Returns:
A list of BaseFramePartition objects. | [
"Applies",
"a",
"function",
"to",
"a",
"list",
"of",
"remote",
"partitions",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L670-L683 | train | Applies a function to a list of remote partitions. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/base/frame/partition_manager.py | BaseFrameManager.apply_func_to_select_indices | def apply_func_to_select_indices(self, axis, func, indices, keep_remaining=False):
"""Applies a function to select indices.
Note: Your internal function must take a kwarg `internal_indices` for
this to work correctly. This prevents information leakage of the
internal index to th... | python | def apply_func_to_select_indices(self, axis, func, indices, keep_remaining=False):
"""Applies a function to select indices.
Note: Your internal function must take a kwarg `internal_indices` for
this to work correctly. This prevents information leakage of the
internal index to th... | [
"def",
"apply_func_to_select_indices",
"(",
"self",
",",
"axis",
",",
"func",
",",
"indices",
",",
"keep_remaining",
"=",
"False",
")",
":",
"if",
"self",
".",
"partitions",
".",
"size",
"==",
"0",
":",
"return",
"np",
".",
"array",
"(",
"[",
"[",
"]",... | Applies a function to select indices.
Note: Your internal function must take a kwarg `internal_indices` for
this to work correctly. This prevents information leakage of the
internal index to the external representation.
Args:
axis: The axis to apply the func over.
... | [
"Applies",
"a",
"function",
"to",
"select",
"indices",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L685-L803 | train | Applies a function to select indices over a specific axis. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/base/frame/partition_manager.py | BaseFrameManager.apply_func_to_select_indices_along_full_axis | def apply_func_to_select_indices_along_full_axis(
self, axis, func, indices, keep_remaining=False
):
"""Applies a function to a select subset of full columns/rows.
Note: This should be used when you need to apply a function that relies
on some global information for the entire c... | python | def apply_func_to_select_indices_along_full_axis(
self, axis, func, indices, keep_remaining=False
):
"""Applies a function to a select subset of full columns/rows.
Note: This should be used when you need to apply a function that relies
on some global information for the entire c... | [
"def",
"apply_func_to_select_indices_along_full_axis",
"(",
"self",
",",
"axis",
",",
"func",
",",
"indices",
",",
"keep_remaining",
"=",
"False",
")",
":",
"if",
"self",
".",
"partitions",
".",
"size",
"==",
"0",
":",
"return",
"self",
".",
"__constructor__",... | Applies a function to a select subset of full columns/rows.
Note: This should be used when you need to apply a function that relies
on some global information for the entire column/row, but only need
to apply a function to a subset.
Important: For your func to operate directly ... | [
"Applies",
"a",
"function",
"to",
"a",
"select",
"subset",
"of",
"full",
"columns",
"/",
"rows",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L805-L905 | train | Applies a function to a select subset of full columns or rows. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/base/frame/partition_manager.py | BaseFrameManager.apply_func_to_indices_both_axis | def apply_func_to_indices_both_axis(
self,
func,
row_indices,
col_indices,
lazy=False,
keep_remaining=True,
mutate=False,
item_to_distribute=None,
):
"""
Apply a function to along both axis
Important: For your func to operate d... | python | def apply_func_to_indices_both_axis(
self,
func,
row_indices,
col_indices,
lazy=False,
keep_remaining=True,
mutate=False,
item_to_distribute=None,
):
"""
Apply a function to along both axis
Important: For your func to operate d... | [
"def",
"apply_func_to_indices_both_axis",
"(",
"self",
",",
"func",
",",
"row_indices",
",",
"col_indices",
",",
"lazy",
"=",
"False",
",",
"keep_remaining",
"=",
"True",
",",
"mutate",
"=",
"False",
",",
"item_to_distribute",
"=",
"None",
",",
")",
":",
"if... | Apply a function to along both axis
Important: For your func to operate directly on the indices provided,
it must use `row_internal_indices, col_internal_indices` as keyword
arguments. | [
"Apply",
"a",
"function",
"to",
"along",
"both",
"axis"
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L907-L987 | train | Applies a function to the items in the row and column of the log entries along the both axes. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/base/frame/partition_manager.py | BaseFrameManager.inter_data_operation | def inter_data_operation(self, axis, func, other):
"""Apply a function that requires two BaseFrameManager objects.
Args:
axis: The axis to apply the function over (0 - rows, 1 - columns)
func: The function to apply
other: The other BaseFrameManager object to apply fu... | python | def inter_data_operation(self, axis, func, other):
"""Apply a function that requires two BaseFrameManager objects.
Args:
axis: The axis to apply the function over (0 - rows, 1 - columns)
func: The function to apply
other: The other BaseFrameManager object to apply fu... | [
"def",
"inter_data_operation",
"(",
"self",
",",
"axis",
",",
"func",
",",
"other",
")",
":",
"if",
"axis",
":",
"partitions",
"=",
"self",
".",
"row_partitions",
"other_partitions",
"=",
"other",
".",
"row_partitions",
"else",
":",
"partitions",
"=",
"self"... | Apply a function that requires two BaseFrameManager objects.
Args:
axis: The axis to apply the function over (0 - rows, 1 - columns)
func: The function to apply
other: The other BaseFrameManager object to apply func to.
Returns:
A new BaseFrameManager ob... | [
"Apply",
"a",
"function",
"that",
"requires",
"two",
"BaseFrameManager",
"objects",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L989-L1017 | train | Apply a function that requires two BaseFrameManager objects. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/base/frame/partition_manager.py | BaseFrameManager.manual_shuffle | def manual_shuffle(self, axis, shuffle_func, lengths):
"""Shuffle the partitions based on the `shuffle_func`.
Args:
axis: The axis to shuffle across.
shuffle_func: The function to apply before splitting the result.
lengths: The length of each partition to split the r... | python | def manual_shuffle(self, axis, shuffle_func, lengths):
"""Shuffle the partitions based on the `shuffle_func`.
Args:
axis: The axis to shuffle across.
shuffle_func: The function to apply before splitting the result.
lengths: The length of each partition to split the r... | [
"def",
"manual_shuffle",
"(",
"self",
",",
"axis",
",",
"shuffle_func",
",",
"lengths",
")",
":",
"if",
"axis",
":",
"partitions",
"=",
"self",
".",
"row_partitions",
"else",
":",
"partitions",
"=",
"self",
".",
"column_partitions",
"func",
"=",
"self",
".... | Shuffle the partitions based on the `shuffle_func`.
Args:
axis: The axis to shuffle across.
shuffle_func: The function to apply before splitting the result.
lengths: The length of each partition to split the result into.
Returns:
A new BaseFrameManager ... | [
"Shuffle",
"the",
"partitions",
"based",
"on",
"the",
"shuffle_func",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L1019-L1036 | train | Shuffle the partitions based on the shuffle_func. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/pandas/io.py | read_parquet | def read_parquet(path, engine="auto", columns=None, **kwargs):
"""Load a parquet object from the file path, returning a DataFrame.
Args:
path: The filepath of the parquet file.
We only support local files for now.
engine: This argument doesn't do anything for now.
kwargs: ... | python | def read_parquet(path, engine="auto", columns=None, **kwargs):
"""Load a parquet object from the file path, returning a DataFrame.
Args:
path: The filepath of the parquet file.
We only support local files for now.
engine: This argument doesn't do anything for now.
kwargs: ... | [
"def",
"read_parquet",
"(",
"path",
",",
"engine",
"=",
"\"auto\"",
",",
"columns",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"DataFrame",
"(",
"query_compiler",
"=",
"BaseFactory",
".",
"read_parquet",
"(",
"path",
"=",
"path",
",",
"col... | Load a parquet object from the file path, returning a DataFrame.
Args:
path: The filepath of the parquet file.
We only support local files for now.
engine: This argument doesn't do anything for now.
kwargs: Pass into parquet's read_pandas function. | [
"Load",
"a",
"parquet",
"object",
"from",
"the",
"file",
"path",
"returning",
"a",
"DataFrame",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/io.py#L18-L31 | train | Load a parquet file into a DataFrame. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/pandas/io.py | _make_parser_func | def _make_parser_func(sep):
"""Creates a parser function from the given sep.
Args:
sep: The separator default to use for the parser.
Returns:
A function object.
"""
def parser_func(
filepath_or_buffer,
sep=sep,
delimiter=None,
header="infer",
... | python | def _make_parser_func(sep):
"""Creates a parser function from the given sep.
Args:
sep: The separator default to use for the parser.
Returns:
A function object.
"""
def parser_func(
filepath_or_buffer,
sep=sep,
delimiter=None,
header="infer",
... | [
"def",
"_make_parser_func",
"(",
"sep",
")",
":",
"def",
"parser_func",
"(",
"filepath_or_buffer",
",",
"sep",
"=",
"sep",
",",
"delimiter",
"=",
"None",
",",
"header",
"=",
"\"infer\"",
",",
"names",
"=",
"None",
",",
"index_col",
"=",
"None",
",",
"use... | Creates a parser function from the given sep.
Args:
sep: The separator default to use for the parser.
Returns:
A function object. | [
"Creates",
"a",
"parser",
"function",
"from",
"the",
"given",
"sep",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/io.py#L35-L101 | train | Creates a parser function from the given separator. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/pandas/io.py | _read | def _read(**kwargs):
"""Read csv file from local disk.
Args:
filepath_or_buffer:
The filepath of the csv file.
We only support local files for now.
kwargs: Keyword arguments in pandas.read_csv
"""
pd_obj = BaseFactory.read_csv(**kwargs)
# This happens when... | python | def _read(**kwargs):
"""Read csv file from local disk.
Args:
filepath_or_buffer:
The filepath of the csv file.
We only support local files for now.
kwargs: Keyword arguments in pandas.read_csv
"""
pd_obj = BaseFactory.read_csv(**kwargs)
# This happens when... | [
"def",
"_read",
"(",
"*",
"*",
"kwargs",
")",
":",
"pd_obj",
"=",
"BaseFactory",
".",
"read_csv",
"(",
"*",
"*",
"kwargs",
")",
"# This happens when `read_csv` returns a TextFileReader object for iterating through",
"if",
"isinstance",
"(",
"pd_obj",
",",
"pandas",
... | Read csv file from local disk.
Args:
filepath_or_buffer:
The filepath of the csv file.
We only support local files for now.
kwargs: Keyword arguments in pandas.read_csv | [
"Read",
"csv",
"file",
"from",
"local",
"disk",
".",
"Args",
":",
"filepath_or_buffer",
":",
"The",
"filepath",
"of",
"the",
"csv",
"file",
".",
"We",
"only",
"support",
"local",
"files",
"for",
"now",
".",
"kwargs",
":",
"Keyword",
"arguments",
"in",
"p... | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/io.py#L104-L120 | train | Read the CSV file from local disk. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/pandas/io.py | read_sql | def read_sql(
sql,
con,
index_col=None,
coerce_float=True,
params=None,
parse_dates=None,
columns=None,
chunksize=None,
):
""" Read SQL query or database table into a DataFrame.
Args:
sql: string or SQLAlchemy Selectable (select or text object) SQL query to be executed o... | python | def read_sql(
sql,
con,
index_col=None,
coerce_float=True,
params=None,
parse_dates=None,
columns=None,
chunksize=None,
):
""" Read SQL query or database table into a DataFrame.
Args:
sql: string or SQLAlchemy Selectable (select or text object) SQL query to be executed o... | [
"def",
"read_sql",
"(",
"sql",
",",
"con",
",",
"index_col",
"=",
"None",
",",
"coerce_float",
"=",
"True",
",",
"params",
"=",
"None",
",",
"parse_dates",
"=",
"None",
",",
"columns",
"=",
"None",
",",
"chunksize",
"=",
"None",
",",
")",
":",
"_",
... | Read SQL query or database table into a DataFrame.
Args:
sql: string or SQLAlchemy Selectable (select or text object) SQL query to be executed or a table name.
con: SQLAlchemy connectable (engine/connection) or database string URI or DBAPI2 connection (fallback mode)
index_col: Column(s) to... | [
"Read",
"SQL",
"query",
"or",
"database",
"table",
"into",
"a",
"DataFrame",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/io.py#L286-L324 | train | Read SQL query or database table into a Modin Dataframe. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/base/io.py | BaseIO.read_parquet | def read_parquet(cls, path, engine, columns, **kwargs):
"""Load a parquet object from the file path, returning a DataFrame.
Ray DataFrame only supports pyarrow engine for now.
Args:
path: The filepath of the parquet file.
We only support local files for now.
... | python | def read_parquet(cls, path, engine, columns, **kwargs):
"""Load a parquet object from the file path, returning a DataFrame.
Ray DataFrame only supports pyarrow engine for now.
Args:
path: The filepath of the parquet file.
We only support local files for now.
... | [
"def",
"read_parquet",
"(",
"cls",
",",
"path",
",",
"engine",
",",
"columns",
",",
"*",
"*",
"kwargs",
")",
":",
"ErrorMessage",
".",
"default_to_pandas",
"(",
"\"`read_parquet`\"",
")",
"return",
"cls",
".",
"from_pandas",
"(",
"pandas",
".",
"read_parquet... | Load a parquet object from the file path, returning a DataFrame.
Ray DataFrame only supports pyarrow engine for now.
Args:
path: The filepath of the parquet file.
We only support local files for now.
engine: Ray only support pyarrow reader.
... | [
"Load",
"a",
"parquet",
"object",
"from",
"the",
"file",
"path",
"returning",
"a",
"DataFrame",
".",
"Ray",
"DataFrame",
"only",
"supports",
"pyarrow",
"engine",
"for",
"now",
"."
] | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/io.py#L17-L33 | train | Load a DataFrame from a parquet file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
modin-project/modin | modin/engines/base/io.py | BaseIO._read | def _read(cls, **kwargs):
"""Read csv file from local disk.
Args:
filepath_or_buffer:
The filepath of the csv file.
We only support local files for now.
kwargs: Keyword arguments in pandas.read_csv
"""
pd_obj = pandas.read_csv(*... | python | def _read(cls, **kwargs):
"""Read csv file from local disk.
Args:
filepath_or_buffer:
The filepath of the csv file.
We only support local files for now.
kwargs: Keyword arguments in pandas.read_csv
"""
pd_obj = pandas.read_csv(*... | [
"def",
"_read",
"(",
"cls",
",",
"*",
"*",
"kwargs",
")",
":",
"pd_obj",
"=",
"pandas",
".",
"read_csv",
"(",
"*",
"*",
"kwargs",
")",
"if",
"isinstance",
"(",
"pd_obj",
",",
"pandas",
".",
"DataFrame",
")",
":",
"return",
"cls",
".",
"from_pandas",
... | Read csv file from local disk.
Args:
filepath_or_buffer:
The filepath of the csv file.
We only support local files for now.
kwargs: Keyword arguments in pandas.read_csv | [
"Read",
"csv",
"file",
"from",
"local",
"disk",
".",
"Args",
":",
"filepath_or_buffer",
":",
"The",
"filepath",
"of",
"the",
"csv",
"file",
".",
"We",
"only",
"support",
"local",
"files",
"for",
"now",
".",
"kwargs",
":",
"Keyword",
"arguments",
"in",
"p... | 5b77d242596560c646b8405340c9ce64acb183cb | https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/io.py#L143-L161 | train | Read the naculiacute entry from local disk. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/builtins/one_hot_encoder.py | auto_select_categorical_features | def auto_select_categorical_features(X, threshold=10):
"""Make a feature mask of categorical features in X.
Features with less than 10 unique values are considered categorical.
Parameters
----------
X : array-like or sparse matrix, shape=(n_samples, n_features)
Dense array or sparse matrix... | python | def auto_select_categorical_features(X, threshold=10):
"""Make a feature mask of categorical features in X.
Features with less than 10 unique values are considered categorical.
Parameters
----------
X : array-like or sparse matrix, shape=(n_samples, n_features)
Dense array or sparse matrix... | [
"def",
"auto_select_categorical_features",
"(",
"X",
",",
"threshold",
"=",
"10",
")",
":",
"feature_mask",
"=",
"[",
"]",
"for",
"column",
"in",
"range",
"(",
"X",
".",
"shape",
"[",
"1",
"]",
")",
":",
"if",
"sparse",
".",
"issparse",
"(",
"X",
")"... | Make a feature mask of categorical features in X.
Features with less than 10 unique values are considered categorical.
Parameters
----------
X : array-like or sparse matrix, shape=(n_samples, n_features)
Dense array or sparse matrix.
threshold : int
Maximum number of unique values... | [
"Make",
"a",
"feature",
"mask",
"of",
"categorical",
"features",
"in",
"X",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/builtins/one_hot_encoder.py#L45-L75 | train | Auto - selects categorical features in X. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/builtins/one_hot_encoder.py | _X_selected | def _X_selected(X, selected):
"""Split X into selected features and other features"""
n_features = X.shape[1]
ind = np.arange(n_features)
sel = np.zeros(n_features, dtype=bool)
sel[np.asarray(selected)] = True
non_sel = np.logical_not(sel)
n_selected = np.sum(sel)
X_sel = X[:, ind[sel]]
... | python | def _X_selected(X, selected):
"""Split X into selected features and other features"""
n_features = X.shape[1]
ind = np.arange(n_features)
sel = np.zeros(n_features, dtype=bool)
sel[np.asarray(selected)] = True
non_sel = np.logical_not(sel)
n_selected = np.sum(sel)
X_sel = X[:, ind[sel]]
... | [
"def",
"_X_selected",
"(",
"X",
",",
"selected",
")",
":",
"n_features",
"=",
"X",
".",
"shape",
"[",
"1",
"]",
"ind",
"=",
"np",
".",
"arange",
"(",
"n_features",
")",
"sel",
"=",
"np",
".",
"zeros",
"(",
"n_features",
",",
"dtype",
"=",
"bool",
... | Split X into selected features and other features | [
"Split",
"X",
"into",
"selected",
"features",
"and",
"other",
"features"
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/builtins/one_hot_encoder.py#L78-L88 | train | Split X into selected features and other features | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/builtins/one_hot_encoder.py | _transform_selected | def _transform_selected(X, transform, selected, copy=True):
"""Apply a transform function to portion of selected features.
Parameters
----------
X : array-like or sparse matrix, shape=(n_samples, n_features)
Dense array or sparse matrix.
transform : callable
A callable transform(X)... | python | def _transform_selected(X, transform, selected, copy=True):
"""Apply a transform function to portion of selected features.
Parameters
----------
X : array-like or sparse matrix, shape=(n_samples, n_features)
Dense array or sparse matrix.
transform : callable
A callable transform(X)... | [
"def",
"_transform_selected",
"(",
"X",
",",
"transform",
",",
"selected",
",",
"copy",
"=",
"True",
")",
":",
"if",
"selected",
"==",
"\"all\"",
":",
"return",
"transform",
"(",
"X",
")",
"if",
"len",
"(",
"selected",
")",
"==",
"0",
":",
"return",
... | Apply a transform function to portion of selected features.
Parameters
----------
X : array-like or sparse matrix, shape=(n_samples, n_features)
Dense array or sparse matrix.
transform : callable
A callable transform(X) -> X_transformed
copy : boolean, optional
Copy X even... | [
"Apply",
"a",
"transform",
"function",
"to",
"portion",
"of",
"selected",
"features",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/builtins/one_hot_encoder.py#L91-L133 | train | Apply a transform function to portion of selected features. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/builtins/one_hot_encoder.py | OneHotEncoder._matrix_adjust | def _matrix_adjust(self, X):
"""Adjust all values in X to encode for NaNs and infinities in the data.
Parameters
----------
X : array-like, shape=(n_samples, n_feature)
Input array of type int.
Returns
-------
X : array-like, shape=(n_samples, n_feat... | python | def _matrix_adjust(self, X):
"""Adjust all values in X to encode for NaNs and infinities in the data.
Parameters
----------
X : array-like, shape=(n_samples, n_feature)
Input array of type int.
Returns
-------
X : array-like, shape=(n_samples, n_feat... | [
"def",
"_matrix_adjust",
"(",
"self",
",",
"X",
")",
":",
"data_matrix",
"=",
"X",
".",
"data",
"if",
"sparse",
".",
"issparse",
"(",
"X",
")",
"else",
"X",
"# Shift all values to specially encode for NAN/infinity/OTHER and 0",
"# Old value New Value",
"# --... | Adjust all values in X to encode for NaNs and infinities in the data.
Parameters
----------
X : array-like, shape=(n_samples, n_feature)
Input array of type int.
Returns
-------
X : array-like, shape=(n_samples, n_feature)
Input array without any... | [
"Adjust",
"all",
"values",
"in",
"X",
"to",
"encode",
"for",
"NaNs",
"and",
"infinities",
"in",
"the",
"data",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/builtins/one_hot_encoder.py#L239-L267 | train | Adjust all values in X to encode for NaNs and infinities in the data. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/builtins/one_hot_encoder.py | OneHotEncoder._fit_transform | def _fit_transform(self, X):
"""Assume X contains only categorical features.
Parameters
----------
X : array-like or sparse matrix, shape=(n_samples, n_features)
Dense array or sparse matrix.
"""
X = self._matrix_adjust(X)
X = check_array(
... | python | def _fit_transform(self, X):
"""Assume X contains only categorical features.
Parameters
----------
X : array-like or sparse matrix, shape=(n_samples, n_features)
Dense array or sparse matrix.
"""
X = self._matrix_adjust(X)
X = check_array(
... | [
"def",
"_fit_transform",
"(",
"self",
",",
"X",
")",
":",
"X",
"=",
"self",
".",
"_matrix_adjust",
"(",
"X",
")",
"X",
"=",
"check_array",
"(",
"X",
",",
"accept_sparse",
"=",
"'csc'",
",",
"force_all_finite",
"=",
"False",
",",
"dtype",
"=",
"int",
... | Assume X contains only categorical features.
Parameters
----------
X : array-like or sparse matrix, shape=(n_samples, n_features)
Dense array or sparse matrix. | [
"Assume",
"X",
"contains",
"only",
"categorical",
"features",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/builtins/one_hot_encoder.py#L269-L374 | train | Fits the transform to the internal representation of the object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/builtins/one_hot_encoder.py | OneHotEncoder.fit_transform | def fit_transform(self, X, y=None):
"""Fit OneHotEncoder to X, then transform X.
Equivalent to self.fit(X).transform(X), but more convenient and more
efficient. See fit for the parameters, transform for the return value.
Parameters
----------
X : array-like or sparse ma... | python | def fit_transform(self, X, y=None):
"""Fit OneHotEncoder to X, then transform X.
Equivalent to self.fit(X).transform(X), but more convenient and more
efficient. See fit for the parameters, transform for the return value.
Parameters
----------
X : array-like or sparse ma... | [
"def",
"fit_transform",
"(",
"self",
",",
"X",
",",
"y",
"=",
"None",
")",
":",
"if",
"self",
".",
"categorical_features",
"==",
"\"auto\"",
":",
"self",
".",
"categorical_features",
"=",
"auto_select_categorical_features",
"(",
"X",
",",
"threshold",
"=",
"... | Fit OneHotEncoder to X, then transform X.
Equivalent to self.fit(X).transform(X), but more convenient and more
efficient. See fit for the parameters, transform for the return value.
Parameters
----------
X : array-like or sparse matrix, shape=(n_samples, n_features)
... | [
"Fit",
"OneHotEncoder",
"to",
"X",
"then",
"transform",
"X",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/builtins/one_hot_encoder.py#L376-L397 | train | Fit OneHotEncoder to X then transform X. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/builtins/one_hot_encoder.py | OneHotEncoder._transform | def _transform(self, X):
"""Asssume X contains only categorical features.
Parameters
----------
X : array-like or sparse matrix, shape=(n_samples, n_features)
Dense array or sparse matrix.
"""
X = self._matrix_adjust(X)
X = check_array(X, accept_spar... | python | def _transform(self, X):
"""Asssume X contains only categorical features.
Parameters
----------
X : array-like or sparse matrix, shape=(n_samples, n_features)
Dense array or sparse matrix.
"""
X = self._matrix_adjust(X)
X = check_array(X, accept_spar... | [
"def",
"_transform",
"(",
"self",
",",
"X",
")",
":",
"X",
"=",
"self",
".",
"_matrix_adjust",
"(",
"X",
")",
"X",
"=",
"check_array",
"(",
"X",
",",
"accept_sparse",
"=",
"'csc'",
",",
"force_all_finite",
"=",
"False",
",",
"dtype",
"=",
"int",
")",... | Asssume X contains only categorical features.
Parameters
----------
X : array-like or sparse matrix, shape=(n_samples, n_features)
Dense array or sparse matrix. | [
"Asssume",
"X",
"contains",
"only",
"categorical",
"features",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/builtins/one_hot_encoder.py#L399-L479 | train | Assume X contains only categorical features. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/builtins/one_hot_encoder.py | OneHotEncoder.transform | def transform(self, X):
"""Transform X using one-hot encoding.
Parameters
----------
X : array-like or sparse matrix, shape=(n_samples, n_features)
Dense array or sparse matrix.
Returns
-------
X_out : sparse matrix if sparse=True else a 2-d array, d... | python | def transform(self, X):
"""Transform X using one-hot encoding.
Parameters
----------
X : array-like or sparse matrix, shape=(n_samples, n_features)
Dense array or sparse matrix.
Returns
-------
X_out : sparse matrix if sparse=True else a 2-d array, d... | [
"def",
"transform",
"(",
"self",
",",
"X",
")",
":",
"return",
"_transform_selected",
"(",
"X",
",",
"self",
".",
"_transform",
",",
"self",
".",
"categorical_features",
",",
"copy",
"=",
"True",
")"
] | Transform X using one-hot encoding.
Parameters
----------
X : array-like or sparse matrix, shape=(n_samples, n_features)
Dense array or sparse matrix.
Returns
-------
X_out : sparse matrix if sparse=True else a 2-d array, dtype=int
Transformed in... | [
"Transform",
"X",
"using",
"one",
"-",
"hot",
"encoding",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/builtins/one_hot_encoder.py#L481-L498 | train | Transform X using one - hot encoding. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/base.py | TPOTBase.fit | def fit(self, features, target, sample_weight=None, groups=None):
"""Fit an optimized machine learning pipeline.
Uses genetic programming to optimize a machine learning pipeline that
maximizes score on the provided features and target. Performs internal
k-fold cross-validaton to avoid o... | python | def fit(self, features, target, sample_weight=None, groups=None):
"""Fit an optimized machine learning pipeline.
Uses genetic programming to optimize a machine learning pipeline that
maximizes score on the provided features and target. Performs internal
k-fold cross-validaton to avoid o... | [
"def",
"fit",
"(",
"self",
",",
"features",
",",
"target",
",",
"sample_weight",
"=",
"None",
",",
"groups",
"=",
"None",
")",
":",
"self",
".",
"_fit_init",
"(",
")",
"features",
",",
"target",
"=",
"self",
".",
"_check_dataset",
"(",
"features",
",",... | Fit an optimized machine learning pipeline.
Uses genetic programming to optimize a machine learning pipeline that
maximizes score on the provided features and target. Performs internal
k-fold cross-validaton to avoid overfitting on the provided data. The
best pipeline is then trained on... | [
"Fit",
"an",
"optimized",
"machine",
"learning",
"pipeline",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L621-L780 | train | Fit an optimized machine learning pipeline. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/base.py | TPOTBase._setup_memory | def _setup_memory(self):
"""Setup Memory object for memory caching.
"""
if self.memory:
if isinstance(self.memory, str):
if self.memory == "auto":
# Create a temporary folder to store the transformers of the pipeline
self._cache... | python | def _setup_memory(self):
"""Setup Memory object for memory caching.
"""
if self.memory:
if isinstance(self.memory, str):
if self.memory == "auto":
# Create a temporary folder to store the transformers of the pipeline
self._cache... | [
"def",
"_setup_memory",
"(",
"self",
")",
":",
"if",
"self",
".",
"memory",
":",
"if",
"isinstance",
"(",
"self",
".",
"memory",
",",
"str",
")",
":",
"if",
"self",
".",
"memory",
"==",
"\"auto\"",
":",
"# Create a temporary folder to store the transformers of... | Setup Memory object for memory caching. | [
"Setup",
"Memory",
"object",
"for",
"memory",
"caching",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L783-L809 | train | Setup Memory object for memory caching. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/base.py | TPOTBase._update_top_pipeline | def _update_top_pipeline(self):
"""Helper function to update the _optimized_pipeline field."""
# Store the pipeline with the highest internal testing score
if self._pareto_front:
self._optimized_pipeline_score = -float('inf')
for pipeline, pipeline_scores in zip(self._par... | python | def _update_top_pipeline(self):
"""Helper function to update the _optimized_pipeline field."""
# Store the pipeline with the highest internal testing score
if self._pareto_front:
self._optimized_pipeline_score = -float('inf')
for pipeline, pipeline_scores in zip(self._par... | [
"def",
"_update_top_pipeline",
"(",
"self",
")",
":",
"# Store the pipeline with the highest internal testing score",
"if",
"self",
".",
"_pareto_front",
":",
"self",
".",
"_optimized_pipeline_score",
"=",
"-",
"float",
"(",
"'inf'",
")",
"for",
"pipeline",
",",
"pipe... | Helper function to update the _optimized_pipeline field. | [
"Helper",
"function",
"to",
"update",
"the",
"_optimized_pipeline",
"field",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L819-L848 | train | Private method to update the _optimized_pipeline field. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/base.py | TPOTBase._summary_of_best_pipeline | def _summary_of_best_pipeline(self, features, target):
"""Print out best pipeline at the end of optimization process.
Parameters
----------
features: array-like {n_samples, n_features}
Feature matrix
target: array-like {n_samples}
List of class labels fo... | python | def _summary_of_best_pipeline(self, features, target):
"""Print out best pipeline at the end of optimization process.
Parameters
----------
features: array-like {n_samples, n_features}
Feature matrix
target: array-like {n_samples}
List of class labels fo... | [
"def",
"_summary_of_best_pipeline",
"(",
"self",
",",
"features",
",",
"target",
")",
":",
"if",
"not",
"self",
".",
"_optimized_pipeline",
":",
"raise",
"RuntimeError",
"(",
"'There was an error in the TPOT optimization '",
"'process. This could be because the data was '",
... | Print out best pipeline at the end of optimization process.
Parameters
----------
features: array-like {n_samples, n_features}
Feature matrix
target: array-like {n_samples}
List of class labels for prediction
Returns
-------
self: object... | [
"Print",
"out",
"best",
"pipeline",
"at",
"the",
"end",
"of",
"optimization",
"process",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L850-L895 | train | Print out the best pipeline for the current object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/base.py | TPOTBase.predict | def predict(self, features):
"""Use the optimized pipeline to predict the target for a feature set.
Parameters
----------
features: array-like {n_samples, n_features}
Feature matrix
Returns
----------
array-like: {n_samples}
Predicted tar... | python | def predict(self, features):
"""Use the optimized pipeline to predict the target for a feature set.
Parameters
----------
features: array-like {n_samples, n_features}
Feature matrix
Returns
----------
array-like: {n_samples}
Predicted tar... | [
"def",
"predict",
"(",
"self",
",",
"features",
")",
":",
"if",
"not",
"self",
".",
"fitted_pipeline_",
":",
"raise",
"RuntimeError",
"(",
"'A pipeline has not yet been optimized. Please call fit() first.'",
")",
"features",
"=",
"self",
".",
"_check_dataset",
"(",
... | Use the optimized pipeline to predict the target for a feature set.
Parameters
----------
features: array-like {n_samples, n_features}
Feature matrix
Returns
----------
array-like: {n_samples}
Predicted target for the samples in the feature matri... | [
"Use",
"the",
"optimized",
"pipeline",
"to",
"predict",
"the",
"target",
"for",
"a",
"feature",
"set",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L897-L916 | train | Use the optimized pipeline to predict the target for a feature set. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/base.py | TPOTBase.fit_predict | def fit_predict(self, features, target, sample_weight=None, groups=None):
"""Call fit and predict in sequence.
Parameters
----------
features: array-like {n_samples, n_features}
Feature matrix
target: array-like {n_samples}
List of class labels for predic... | python | def fit_predict(self, features, target, sample_weight=None, groups=None):
"""Call fit and predict in sequence.
Parameters
----------
features: array-like {n_samples, n_features}
Feature matrix
target: array-like {n_samples}
List of class labels for predic... | [
"def",
"fit_predict",
"(",
"self",
",",
"features",
",",
"target",
",",
"sample_weight",
"=",
"None",
",",
"groups",
"=",
"None",
")",
":",
"self",
".",
"fit",
"(",
"features",
",",
"target",
",",
"sample_weight",
"=",
"sample_weight",
",",
"groups",
"="... | Call fit and predict in sequence.
Parameters
----------
features: array-like {n_samples, n_features}
Feature matrix
target: array-like {n_samples}
List of class labels for prediction
sample_weight: array-like {n_samples}, optional
Per-sample w... | [
"Call",
"fit",
"and",
"predict",
"in",
"sequence",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L918-L942 | train | Call fit and predict in sequence. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/base.py | TPOTBase.score | def score(self, testing_features, testing_target):
"""Return the score on the given testing data using the user-specified scoring function.
Parameters
----------
testing_features: array-like {n_samples, n_features}
Feature matrix of the testing set
testing_target: ar... | python | def score(self, testing_features, testing_target):
"""Return the score on the given testing data using the user-specified scoring function.
Parameters
----------
testing_features: array-like {n_samples, n_features}
Feature matrix of the testing set
testing_target: ar... | [
"def",
"score",
"(",
"self",
",",
"testing_features",
",",
"testing_target",
")",
":",
"if",
"self",
".",
"fitted_pipeline_",
"is",
"None",
":",
"raise",
"RuntimeError",
"(",
"'A pipeline has not yet been optimized. Please call fit() first.'",
")",
"testing_features",
"... | Return the score on the given testing data using the user-specified scoring function.
Parameters
----------
testing_features: array-like {n_samples, n_features}
Feature matrix of the testing set
testing_target: array-like {n_samples}
List of class labels for pred... | [
"Return",
"the",
"score",
"on",
"the",
"given",
"testing",
"data",
"using",
"the",
"user",
"-",
"specified",
"scoring",
"function",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L944-L972 | train | Return the score on the given testing data using the user - specified scoring function. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/base.py | TPOTBase.predict_proba | def predict_proba(self, features):
"""Use the optimized pipeline to estimate the class probabilities for a feature set.
Parameters
----------
features: array-like {n_samples, n_features}
Feature matrix of the testing set
Returns
-------
array-like: {... | python | def predict_proba(self, features):
"""Use the optimized pipeline to estimate the class probabilities for a feature set.
Parameters
----------
features: array-like {n_samples, n_features}
Feature matrix of the testing set
Returns
-------
array-like: {... | [
"def",
"predict_proba",
"(",
"self",
",",
"features",
")",
":",
"if",
"not",
"self",
".",
"fitted_pipeline_",
":",
"raise",
"RuntimeError",
"(",
"'A pipeline has not yet been optimized. Please call fit() first.'",
")",
"else",
":",
"if",
"not",
"(",
"hasattr",
"(",
... | Use the optimized pipeline to estimate the class probabilities for a feature set.
Parameters
----------
features: array-like {n_samples, n_features}
Feature matrix of the testing set
Returns
-------
array-like: {n_samples, n_target}
The class pro... | [
"Use",
"the",
"optimized",
"pipeline",
"to",
"estimate",
"the",
"class",
"probabilities",
"for",
"a",
"feature",
"set",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L974-L996 | train | Use the optimized pipeline to estimate the class probabilities for a feature set. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/base.py | TPOTBase.clean_pipeline_string | def clean_pipeline_string(self, individual):
"""Provide a string of the individual without the parameter prefixes.
Parameters
----------
individual: individual
Individual which should be represented by a pretty string
Returns
-------
A string like st... | python | def clean_pipeline_string(self, individual):
"""Provide a string of the individual without the parameter prefixes.
Parameters
----------
individual: individual
Individual which should be represented by a pretty string
Returns
-------
A string like st... | [
"def",
"clean_pipeline_string",
"(",
"self",
",",
"individual",
")",
":",
"dirty_string",
"=",
"str",
"(",
"individual",
")",
"# There are many parameter prefixes in the pipeline strings, used solely for",
"# making the terminal name unique, eg. LinearSVC__.",
"parameter_prefixes",
... | Provide a string of the individual without the parameter prefixes.
Parameters
----------
individual: individual
Individual which should be represented by a pretty string
Returns
-------
A string like str(individual), but with parameter prefixes removed. | [
"Provide",
"a",
"string",
"of",
"the",
"individual",
"without",
"the",
"parameter",
"prefixes",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L999-L1021 | train | Provide a string of the individual without the parameter prefixes removed. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/base.py | TPOTBase._check_periodic_pipeline | def _check_periodic_pipeline(self, gen):
"""If enough time has passed, save a new optimized pipeline. Currently used in the per generation hook in the optimization loop.
Parameters
----------
gen: int
Generation number
Returns
-------
None
"""... | python | def _check_periodic_pipeline(self, gen):
"""If enough time has passed, save a new optimized pipeline. Currently used in the per generation hook in the optimization loop.
Parameters
----------
gen: int
Generation number
Returns
-------
None
"""... | [
"def",
"_check_periodic_pipeline",
"(",
"self",
",",
"gen",
")",
":",
"self",
".",
"_update_top_pipeline",
"(",
")",
"if",
"self",
".",
"periodic_checkpoint_folder",
"is",
"not",
"None",
":",
"total_since_last_pipeline_save",
"=",
"(",
"datetime",
".",
"now",
"(... | If enough time has passed, save a new optimized pipeline. Currently used in the per generation hook in the optimization loop.
Parameters
----------
gen: int
Generation number
Returns
-------
None | [
"If",
"enough",
"time",
"has",
"passed",
"save",
"a",
"new",
"optimized",
"pipeline",
".",
"Currently",
"used",
"in",
"the",
"per",
"generation",
"hook",
"in",
"the",
"optimization",
"loop",
".",
"Parameters",
"----------",
"gen",
":",
"int",
"Generation",
"... | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1023-L1044 | train | Checks if enough time has passed save a new optimized pipeline. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/base.py | TPOTBase.export | def export(self, output_file_name, data_file_path=''):
"""Export the optimized pipeline as Python code.
Parameters
----------
output_file_name: string
String containing the path and file name of the desired output file
data_file_path: string (default: '')
... | python | def export(self, output_file_name, data_file_path=''):
"""Export the optimized pipeline as Python code.
Parameters
----------
output_file_name: string
String containing the path and file name of the desired output file
data_file_path: string (default: '')
... | [
"def",
"export",
"(",
"self",
",",
"output_file_name",
",",
"data_file_path",
"=",
"''",
")",
":",
"if",
"self",
".",
"_optimized_pipeline",
"is",
"None",
":",
"raise",
"RuntimeError",
"(",
"'A pipeline has not yet been optimized. Please call fit() first.'",
")",
"to_... | Export the optimized pipeline as Python code.
Parameters
----------
output_file_name: string
String containing the path and file name of the desired output file
data_file_path: string (default: '')
By default, the path of input dataset is 'PATH/TO/DATA/FILE' by d... | [
"Export",
"the",
"optimized",
"pipeline",
"as",
"Python",
"code",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1086-L1113 | train | Exports the optimized pipeline as Python code. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/base.py | TPOTBase._impute_values | def _impute_values(self, features):
"""Impute missing values in a feature set.
Parameters
----------
features: array-like {n_samples, n_features}
A feature matrix
Returns
-------
array-like {n_samples, n_features}
"""
if self.verbosit... | python | def _impute_values(self, features):
"""Impute missing values in a feature set.
Parameters
----------
features: array-like {n_samples, n_features}
A feature matrix
Returns
-------
array-like {n_samples, n_features}
"""
if self.verbosit... | [
"def",
"_impute_values",
"(",
"self",
",",
"features",
")",
":",
"if",
"self",
".",
"verbosity",
">",
"1",
":",
"print",
"(",
"'Imputing missing values in feature set'",
")",
"if",
"self",
".",
"_fitted_imputer",
"is",
"None",
":",
"self",
".",
"_fitted_impute... | Impute missing values in a feature set.
Parameters
----------
features: array-like {n_samples, n_features}
A feature matrix
Returns
-------
array-like {n_samples, n_features} | [
"Impute",
"missing",
"values",
"in",
"a",
"feature",
"set",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1116-L1135 | train | Impute missing values in a feature set. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/base.py | TPOTBase._check_dataset | def _check_dataset(self, features, target, sample_weight=None):
"""Check if a dataset has a valid feature set and labels.
Parameters
----------
features: array-like {n_samples, n_features}
Feature matrix
target: array-like {n_samples} or None
List of clas... | python | def _check_dataset(self, features, target, sample_weight=None):
"""Check if a dataset has a valid feature set and labels.
Parameters
----------
features: array-like {n_samples, n_features}
Feature matrix
target: array-like {n_samples} or None
List of clas... | [
"def",
"_check_dataset",
"(",
"self",
",",
"features",
",",
"target",
",",
"sample_weight",
"=",
"None",
")",
":",
"# Check sample_weight",
"if",
"sample_weight",
"is",
"not",
"None",
":",
"try",
":",
"sample_weight",
"=",
"np",
".",
"array",
"(",
"sample_we... | Check if a dataset has a valid feature set and labels.
Parameters
----------
features: array-like {n_samples, n_features}
Feature matrix
target: array-like {n_samples} or None
List of class labels for prediction
sample_weight: array-like {n_samples} (opti... | [
"Check",
"if",
"a",
"dataset",
"has",
"a",
"valid",
"feature",
"set",
"and",
"labels",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1137-L1205 | train | Checks if a dataset has a valid feature set and labels. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/base.py | TPOTBase._compile_to_sklearn | def _compile_to_sklearn(self, expr):
"""Compile a DEAP pipeline into a sklearn pipeline.
Parameters
----------
expr: DEAP individual
The DEAP pipeline to be compiled
Returns
-------
sklearn_pipeline: sklearn.pipeline.Pipeline
"""
skle... | python | def _compile_to_sklearn(self, expr):
"""Compile a DEAP pipeline into a sklearn pipeline.
Parameters
----------
expr: DEAP individual
The DEAP pipeline to be compiled
Returns
-------
sklearn_pipeline: sklearn.pipeline.Pipeline
"""
skle... | [
"def",
"_compile_to_sklearn",
"(",
"self",
",",
"expr",
")",
":",
"sklearn_pipeline_str",
"=",
"generate_pipeline_code",
"(",
"expr_to_tree",
"(",
"expr",
",",
"self",
".",
"_pset",
")",
",",
"self",
".",
"operators",
")",
"sklearn_pipeline",
"=",
"eval",
"(",... | Compile a DEAP pipeline into a sklearn pipeline.
Parameters
----------
expr: DEAP individual
The DEAP pipeline to be compiled
Returns
-------
sklearn_pipeline: sklearn.pipeline.Pipeline | [
"Compile",
"a",
"DEAP",
"pipeline",
"into",
"a",
"sklearn",
"pipeline",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1208-L1223 | train | Compile a DEAP pipeline into a sklearn pipeline. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/base.py | TPOTBase._set_param_recursive | def _set_param_recursive(self, pipeline_steps, parameter, value):
"""Recursively iterate through all objects in the pipeline and set a given parameter.
Parameters
----------
pipeline_steps: array-like
List of (str, obj) tuples from a scikit-learn pipeline or related object
... | python | def _set_param_recursive(self, pipeline_steps, parameter, value):
"""Recursively iterate through all objects in the pipeline and set a given parameter.
Parameters
----------
pipeline_steps: array-like
List of (str, obj) tuples from a scikit-learn pipeline or related object
... | [
"def",
"_set_param_recursive",
"(",
"self",
",",
"pipeline_steps",
",",
"parameter",
",",
"value",
")",
":",
"for",
"(",
"_",
",",
"obj",
")",
"in",
"pipeline_steps",
":",
"recursive_attrs",
"=",
"[",
"'steps'",
",",
"'transformer_list'",
",",
"'estimators'",
... | Recursively iterate through all objects in the pipeline and set a given parameter.
Parameters
----------
pipeline_steps: array-like
List of (str, obj) tuples from a scikit-learn pipeline or related object
parameter: str
The parameter to assign a value for in each... | [
"Recursively",
"iterate",
"through",
"all",
"objects",
"in",
"the",
"pipeline",
"and",
"set",
"a",
"given",
"parameter",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1225-L1251 | train | Recursively iterate through all objects in a pipeline and set a given parameter. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/base.py | TPOTBase._stop_by_max_time_mins | def _stop_by_max_time_mins(self):
"""Stop optimization process once maximum minutes have elapsed."""
if self.max_time_mins:
total_mins_elapsed = (datetime.now() - self._start_datetime).total_seconds() / 60.
if total_mins_elapsed >= self.max_time_mins:
raise Keyboa... | python | def _stop_by_max_time_mins(self):
"""Stop optimization process once maximum minutes have elapsed."""
if self.max_time_mins:
total_mins_elapsed = (datetime.now() - self._start_datetime).total_seconds() / 60.
if total_mins_elapsed >= self.max_time_mins:
raise Keyboa... | [
"def",
"_stop_by_max_time_mins",
"(",
"self",
")",
":",
"if",
"self",
".",
"max_time_mins",
":",
"total_mins_elapsed",
"=",
"(",
"datetime",
".",
"now",
"(",
")",
"-",
"self",
".",
"_start_datetime",
")",
".",
"total_seconds",
"(",
")",
"/",
"60.",
"if",
... | Stop optimization process once maximum minutes have elapsed. | [
"Stop",
"optimization",
"process",
"once",
"maximum",
"minutes",
"have",
"elapsed",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1253-L1258 | train | Stop optimization process once maximum minutes have elapsed. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/base.py | TPOTBase._combine_individual_stats | def _combine_individual_stats(self, operator_count, cv_score, individual_stats):
"""Combine the stats with operator count and cv score and preprare to be written to _evaluated_individuals
Parameters
----------
operator_count: int
number of components in the pipeline
... | python | def _combine_individual_stats(self, operator_count, cv_score, individual_stats):
"""Combine the stats with operator count and cv score and preprare to be written to _evaluated_individuals
Parameters
----------
operator_count: int
number of components in the pipeline
... | [
"def",
"_combine_individual_stats",
"(",
"self",
",",
"operator_count",
",",
"cv_score",
",",
"individual_stats",
")",
":",
"stats",
"=",
"deepcopy",
"(",
"individual_stats",
")",
"# Deepcopy, since the string reference to predecessor should be cloned",
"stats",
"[",
"'oper... | Combine the stats with operator count and cv score and preprare to be written to _evaluated_individuals
Parameters
----------
operator_count: int
number of components in the pipeline
cv_score: float
internal cross validation score
individual_stats: dictio... | [
"Combine",
"the",
"stats",
"with",
"operator",
"count",
"and",
"cv",
"score",
"and",
"preprare",
"to",
"be",
"written",
"to",
"_evaluated_individuals"
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1260-L1287 | train | Combine the stats with operator count and cv score and preprare to be written to _evaluated_individuals
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/base.py | TPOTBase._evaluate_individuals | def _evaluate_individuals(self, population, features, target, sample_weight=None, groups=None):
"""Determine the fit of the provided individuals.
Parameters
----------
population: a list of DEAP individual
One individual is a list of pipeline operators and model parameters t... | python | def _evaluate_individuals(self, population, features, target, sample_weight=None, groups=None):
"""Determine the fit of the provided individuals.
Parameters
----------
population: a list of DEAP individual
One individual is a list of pipeline operators and model parameters t... | [
"def",
"_evaluate_individuals",
"(",
"self",
",",
"population",
",",
"features",
",",
"target",
",",
"sample_weight",
"=",
"None",
",",
"groups",
"=",
"None",
")",
":",
"# Evaluate the individuals with an invalid fitness",
"individuals",
"=",
"[",
"ind",
"for",
"i... | Determine the fit of the provided individuals.
Parameters
----------
population: a list of DEAP individual
One individual is a list of pipeline operators and model parameters that can be
compiled by DEAP into a callable function
features: numpy.ndarray {n_samples... | [
"Determine",
"the",
"fit",
"of",
"the",
"provided",
"individuals",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1289-L1407 | train | Evaluate the individuals and return the score of the results. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/base.py | TPOTBase._preprocess_individuals | def _preprocess_individuals(self, individuals):
"""Preprocess DEAP individuals before pipeline evaluation.
Parameters
----------
individuals: a list of DEAP individual
One individual is a list of pipeline operators and model parameters that can be
compiled by DEA... | python | def _preprocess_individuals(self, individuals):
"""Preprocess DEAP individuals before pipeline evaluation.
Parameters
----------
individuals: a list of DEAP individual
One individual is a list of pipeline operators and model parameters that can be
compiled by DEA... | [
"def",
"_preprocess_individuals",
"(",
"self",
",",
"individuals",
")",
":",
"# update self._pbar.total",
"if",
"not",
"(",
"self",
".",
"max_time_mins",
"is",
"None",
")",
"and",
"not",
"self",
".",
"_pbar",
".",
"disable",
"and",
"self",
".",
"_pbar",
".",... | Preprocess DEAP individuals before pipeline evaluation.
Parameters
----------
individuals: a list of DEAP individual
One individual is a list of pipeline operators and model parameters that can be
compiled by DEAP into a callable function
Returns
-------... | [
"Preprocess",
"DEAP",
"individuals",
"before",
"pipeline",
"evaluation",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1409-L1492 | train | Preprocess DEAP individuals before pipeline evaluation. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/base.py | TPOTBase._update_evaluated_individuals_ | def _update_evaluated_individuals_(self, result_score_list, eval_individuals_str, operator_counts, stats_dicts):
"""Update self.evaluated_individuals_ and error message during pipeline evaluation.
Parameters
----------
result_score_list: list
A list of CV scores for evaluate... | python | def _update_evaluated_individuals_(self, result_score_list, eval_individuals_str, operator_counts, stats_dicts):
"""Update self.evaluated_individuals_ and error message during pipeline evaluation.
Parameters
----------
result_score_list: list
A list of CV scores for evaluate... | [
"def",
"_update_evaluated_individuals_",
"(",
"self",
",",
"result_score_list",
",",
"eval_individuals_str",
",",
"operator_counts",
",",
"stats_dicts",
")",
":",
"for",
"result_score",
",",
"individual_str",
"in",
"zip",
"(",
"result_score_list",
",",
"eval_individuals... | Update self.evaluated_individuals_ and error message during pipeline evaluation.
Parameters
----------
result_score_list: list
A list of CV scores for evaluated pipelines
eval_individuals_str: list
A list of strings for evaluated pipelines
operator_counts... | [
"Update",
"self",
".",
"evaluated_individuals_",
"and",
"error",
"message",
"during",
"pipeline",
"evaluation",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1494-L1519 | train | Update self. evaluated_individuals_ and error message during pipeline evaluation. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/base.py | TPOTBase._update_pbar | def _update_pbar(self, pbar_num=1, pbar_msg=None):
"""Update self._pbar and error message during pipeline evaluation.
Parameters
----------
pbar_num: int
How many pipelines has been processed
pbar_msg: None or string
Error message
Returns
... | python | def _update_pbar(self, pbar_num=1, pbar_msg=None):
"""Update self._pbar and error message during pipeline evaluation.
Parameters
----------
pbar_num: int
How many pipelines has been processed
pbar_msg: None or string
Error message
Returns
... | [
"def",
"_update_pbar",
"(",
"self",
",",
"pbar_num",
"=",
"1",
",",
"pbar_msg",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"self",
".",
"_pbar",
",",
"type",
"(",
"None",
")",
")",
":",
"if",
"self",
".",
"verbosity",
">",
"2",
"and",
... | Update self._pbar and error message during pipeline evaluation.
Parameters
----------
pbar_num: int
How many pipelines has been processed
pbar_msg: None or string
Error message
Returns
-------
None | [
"Update",
"self",
".",
"_pbar",
"and",
"error",
"message",
"during",
"pipeline",
"evaluation",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1521-L1539 | train | Update self. _pbar and error message during pipeline evaluation. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/base.py | TPOTBase._random_mutation_operator | def _random_mutation_operator(self, individual, allow_shrink=True):
"""Perform a replacement, insertion, or shrink mutation on an individual.
Parameters
----------
individual: DEAP individual
A list of pipeline operators and model parameters that can be
compiled ... | python | def _random_mutation_operator(self, individual, allow_shrink=True):
"""Perform a replacement, insertion, or shrink mutation on an individual.
Parameters
----------
individual: DEAP individual
A list of pipeline operators and model parameters that can be
compiled ... | [
"def",
"_random_mutation_operator",
"(",
"self",
",",
"individual",
",",
"allow_shrink",
"=",
"True",
")",
":",
"if",
"self",
".",
"tree_structure",
":",
"mutation_techniques",
"=",
"[",
"partial",
"(",
"gp",
".",
"mutInsert",
",",
"pset",
"=",
"self",
".",
... | Perform a replacement, insertion, or shrink mutation on an individual.
Parameters
----------
individual: DEAP individual
A list of pipeline operators and model parameters that can be
compiled by DEAP into a callable function
allow_shrink: bool (True)
... | [
"Perform",
"a",
"replacement",
"insertion",
"or",
"shrink",
"mutation",
"on",
"an",
"individual",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1564-L1623 | train | Perform a replacement insertion or shrink mutation on an individual. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/base.py | TPOTBase._gen_grow_safe | def _gen_grow_safe(self, pset, min_, max_, type_=None):
"""Generate an expression where each leaf might have a different depth between min_ and max_.
Parameters
----------
pset: PrimitiveSetTyped
Primitive set from which primitives are selected.
min_: int
... | python | def _gen_grow_safe(self, pset, min_, max_, type_=None):
"""Generate an expression where each leaf might have a different depth between min_ and max_.
Parameters
----------
pset: PrimitiveSetTyped
Primitive set from which primitives are selected.
min_: int
... | [
"def",
"_gen_grow_safe",
"(",
"self",
",",
"pset",
",",
"min_",
",",
"max_",
",",
"type_",
"=",
"None",
")",
":",
"def",
"condition",
"(",
"height",
",",
"depth",
",",
"type_",
")",
":",
"\"\"\"Stop when the depth is equal to height or when a node should be a term... | Generate an expression where each leaf might have a different depth between min_ and max_.
Parameters
----------
pset: PrimitiveSetTyped
Primitive set from which primitives are selected.
min_: int
Minimum height of the produced trees.
max_: int
... | [
"Generate",
"an",
"expression",
"where",
"each",
"leaf",
"might",
"have",
"a",
"different",
"depth",
"between",
"min_",
"and",
"max_",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1625-L1650 | train | Generate an expression where each leaf might have a different depth between min_ and max_. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/base.py | TPOTBase._operator_count | def _operator_count(self, individual):
"""Count the number of pipeline operators as a measure of pipeline complexity.
Parameters
----------
individual: list
A grown tree with leaves at possibly different depths
dependending on the condition function.
Ret... | python | def _operator_count(self, individual):
"""Count the number of pipeline operators as a measure of pipeline complexity.
Parameters
----------
individual: list
A grown tree with leaves at possibly different depths
dependending on the condition function.
Ret... | [
"def",
"_operator_count",
"(",
"self",
",",
"individual",
")",
":",
"operator_count",
"=",
"0",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"individual",
")",
")",
":",
"node",
"=",
"individual",
"[",
"i",
"]",
"if",
"type",
"(",
"node",
")",
"is",
... | Count the number of pipeline operators as a measure of pipeline complexity.
Parameters
----------
individual: list
A grown tree with leaves at possibly different depths
dependending on the condition function.
Returns
-------
operator_count: int
... | [
"Count",
"the",
"number",
"of",
"pipeline",
"operators",
"as",
"a",
"measure",
"of",
"pipeline",
"complexity",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1653-L1672 | train | Count the number of pipeline operators in a grown tree. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/base.py | TPOTBase._update_val | def _update_val(self, val, result_score_list):
"""Update values in the list of result scores and self._pbar during pipeline evaluation.
Parameters
----------
val: float or "Timeout"
CV scores
result_score_list: list
A list of CV scores
Returns
... | python | def _update_val(self, val, result_score_list):
"""Update values in the list of result scores and self._pbar during pipeline evaluation.
Parameters
----------
val: float or "Timeout"
CV scores
result_score_list: list
A list of CV scores
Returns
... | [
"def",
"_update_val",
"(",
"self",
",",
"val",
",",
"result_score_list",
")",
":",
"self",
".",
"_update_pbar",
"(",
")",
"if",
"val",
"==",
"'Timeout'",
":",
"self",
".",
"_update_pbar",
"(",
"pbar_msg",
"=",
"(",
"'Skipped pipeline #{0} due to time out. '",
... | Update values in the list of result scores and self._pbar during pipeline evaluation.
Parameters
----------
val: float or "Timeout"
CV scores
result_score_list: list
A list of CV scores
Returns
-------
result_score_list: list
... | [
"Update",
"values",
"in",
"the",
"list",
"of",
"result",
"scores",
"and",
"self",
".",
"_pbar",
"during",
"pipeline",
"evaluation",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1674-L1696 | train | Update the values in the list of result scores and self. _pbar during pipeline evaluation. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/base.py | TPOTBase._generate | def _generate(self, pset, min_, max_, condition, type_=None):
"""Generate a Tree as a list of lists.
The tree is build from the root to the leaves, and it stop growing when
the condition is fulfilled.
Parameters
----------
pset: PrimitiveSetTyped
Primitive s... | python | def _generate(self, pset, min_, max_, condition, type_=None):
"""Generate a Tree as a list of lists.
The tree is build from the root to the leaves, and it stop growing when
the condition is fulfilled.
Parameters
----------
pset: PrimitiveSetTyped
Primitive s... | [
"def",
"_generate",
"(",
"self",
",",
"pset",
",",
"min_",
",",
"max_",
",",
"condition",
",",
"type_",
"=",
"None",
")",
":",
"if",
"type_",
"is",
"None",
":",
"type_",
"=",
"pset",
".",
"ret",
"expr",
"=",
"[",
"]",
"height",
"=",
"np",
".",
... | Generate a Tree as a list of lists.
The tree is build from the root to the leaves, and it stop growing when
the condition is fulfilled.
Parameters
----------
pset: PrimitiveSetTyped
Primitive set from which primitives are selected.
min_: int
Mini... | [
"Generate",
"a",
"Tree",
"as",
"a",
"list",
"of",
"lists",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L1699-L1762 | train | Generate a tree as a list of lists. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/builtins/feature_transformers.py | CategoricalSelector.transform | def transform(self, X):
"""Select categorical features and transform them using OneHotEncoder.
Parameters
----------
X: numpy ndarray, {n_samples, n_components}
New data, where n_samples is the number of samples and n_components is the number of components.
Returns
... | python | def transform(self, X):
"""Select categorical features and transform them using OneHotEncoder.
Parameters
----------
X: numpy ndarray, {n_samples, n_components}
New data, where n_samples is the number of samples and n_components is the number of components.
Returns
... | [
"def",
"transform",
"(",
"self",
",",
"X",
")",
":",
"selected",
"=",
"auto_select_categorical_features",
"(",
"X",
",",
"threshold",
"=",
"self",
".",
"threshold",
")",
"X_sel",
",",
"_",
",",
"n_selected",
",",
"_",
"=",
"_X_selected",
"(",
"X",
",",
... | Select categorical features and transform them using OneHotEncoder.
Parameters
----------
X: numpy ndarray, {n_samples, n_components}
New data, where n_samples is the number of samples and n_components is the number of components.
Returns
-------
array-like,... | [
"Select",
"categorical",
"features",
"and",
"transform",
"them",
"using",
"OneHotEncoder",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/builtins/feature_transformers.py#L63-L83 | train | Select categorical features and transform them using OneHotEncoder. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/builtins/feature_transformers.py | ContinuousSelector.transform | def transform(self, X):
"""Select continuous features and transform them using PCA.
Parameters
----------
X: numpy ndarray, {n_samples, n_components}
New data, where n_samples is the number of samples and n_components is the number of components.
Returns
---... | python | def transform(self, X):
"""Select continuous features and transform them using PCA.
Parameters
----------
X: numpy ndarray, {n_samples, n_components}
New data, where n_samples is the number of samples and n_components is the number of components.
Returns
---... | [
"def",
"transform",
"(",
"self",
",",
"X",
")",
":",
"selected",
"=",
"auto_select_categorical_features",
"(",
"X",
",",
"threshold",
"=",
"self",
".",
"threshold",
")",
"_",
",",
"X_sel",
",",
"n_selected",
",",
"_",
"=",
"_X_selected",
"(",
"X",
",",
... | Select continuous features and transform them using PCA.
Parameters
----------
X: numpy ndarray, {n_samples, n_components}
New data, where n_samples is the number of samples and n_components is the number of components.
Returns
-------
array-like, {n_samples... | [
"Select",
"continuous",
"features",
"and",
"transform",
"them",
"using",
"PCA",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/builtins/feature_transformers.py#L140-L160 | train | Select continuous features and transform them using PCA. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/builtins/stacking_estimator.py | StackingEstimator.fit | def fit(self, X, y=None, **fit_params):
"""Fit the StackingEstimator meta-transformer.
Parameters
----------
X: array-like of shape (n_samples, n_features)
The training input samples.
y: array-like, shape (n_samples,)
The target values (integers that corr... | python | def fit(self, X, y=None, **fit_params):
"""Fit the StackingEstimator meta-transformer.
Parameters
----------
X: array-like of shape (n_samples, n_features)
The training input samples.
y: array-like, shape (n_samples,)
The target values (integers that corr... | [
"def",
"fit",
"(",
"self",
",",
"X",
",",
"y",
"=",
"None",
",",
"*",
"*",
"fit_params",
")",
":",
"self",
".",
"estimator",
".",
"fit",
"(",
"X",
",",
"y",
",",
"*",
"*",
"fit_params",
")",
"return",
"self"
] | Fit the StackingEstimator meta-transformer.
Parameters
----------
X: array-like of shape (n_samples, n_features)
The training input samples.
y: array-like, shape (n_samples,)
The target values (integers that correspond to classes in classification, real numbers i... | [
"Fit",
"the",
"StackingEstimator",
"meta",
"-",
"transformer",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/builtins/stacking_estimator.py#L50-L68 | train | Fit the StackingEstimator meta - transformer. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/builtins/stacking_estimator.py | StackingEstimator.transform | def transform(self, X):
"""Transform data by adding two synthetic feature(s).
Parameters
----------
X: numpy ndarray, {n_samples, n_components}
New data, where n_samples is the number of samples and n_components is the number of components.
Returns
-------
... | python | def transform(self, X):
"""Transform data by adding two synthetic feature(s).
Parameters
----------
X: numpy ndarray, {n_samples, n_components}
New data, where n_samples is the number of samples and n_components is the number of components.
Returns
-------
... | [
"def",
"transform",
"(",
"self",
",",
"X",
")",
":",
"X",
"=",
"check_array",
"(",
"X",
")",
"X_transformed",
"=",
"np",
".",
"copy",
"(",
"X",
")",
"# add class probabilities as a synthetic feature",
"if",
"issubclass",
"(",
"self",
".",
"estimator",
".",
... | Transform data by adding two synthetic feature(s).
Parameters
----------
X: numpy ndarray, {n_samples, n_components}
New data, where n_samples is the number of samples and n_components is the number of components.
Returns
-------
X_transformed: array-like, s... | [
"Transform",
"data",
"by",
"adding",
"two",
"synthetic",
"feature",
"(",
"s",
")",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/builtins/stacking_estimator.py#L70-L92 | train | Transform data by adding two synthetic features. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/metrics.py | balanced_accuracy | def balanced_accuracy(y_true, y_pred):
"""Default scoring function: balanced accuracy.
Balanced accuracy computes each class' accuracy on a per-class basis using a
one-vs-rest encoding, then computes an unweighted average of the class accuracies.
Parameters
----------
y_true: numpy.ndarray {n_... | python | def balanced_accuracy(y_true, y_pred):
"""Default scoring function: balanced accuracy.
Balanced accuracy computes each class' accuracy on a per-class basis using a
one-vs-rest encoding, then computes an unweighted average of the class accuracies.
Parameters
----------
y_true: numpy.ndarray {n_... | [
"def",
"balanced_accuracy",
"(",
"y_true",
",",
"y_pred",
")",
":",
"all_classes",
"=",
"list",
"(",
"set",
"(",
"np",
".",
"append",
"(",
"y_true",
",",
"y_pred",
")",
")",
")",
"all_class_accuracies",
"=",
"[",
"]",
"for",
"this_class",
"in",
"all_clas... | Default scoring function: balanced accuracy.
Balanced accuracy computes each class' accuracy on a per-class basis using a
one-vs-rest encoding, then computes an unweighted average of the class accuracies.
Parameters
----------
y_true: numpy.ndarray {n_samples}
True class labels
y_pred:... | [
"Default",
"scoring",
"function",
":",
"balanced",
"accuracy",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/metrics.py#L30-L66 | train | Default scoring function for balanced accuracy. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/builtins/zero_count.py | ZeroCount.transform | def transform(self, X, y=None):
"""Transform data by adding two virtual features.
Parameters
----------
X: numpy ndarray, {n_samples, n_components}
New data, where n_samples is the number of samples and n_components
is the number of components.
y: None
... | python | def transform(self, X, y=None):
"""Transform data by adding two virtual features.
Parameters
----------
X: numpy ndarray, {n_samples, n_components}
New data, where n_samples is the number of samples and n_components
is the number of components.
y: None
... | [
"def",
"transform",
"(",
"self",
",",
"X",
",",
"y",
"=",
"None",
")",
":",
"X",
"=",
"check_array",
"(",
"X",
")",
"n_features",
"=",
"X",
".",
"shape",
"[",
"1",
"]",
"X_transformed",
"=",
"np",
".",
"copy",
"(",
"X",
")",
"non_zero_vector",
"=... | Transform data by adding two virtual features.
Parameters
----------
X: numpy ndarray, {n_samples, n_components}
New data, where n_samples is the number of samples and n_components
is the number of components.
y: None
Unused
Returns
-... | [
"Transform",
"data",
"by",
"adding",
"two",
"virtual",
"features",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/builtins/zero_count.py#L38-L66 | train | Transform data by adding two virtual features. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/operator_utils.py | source_decode | def source_decode(sourcecode, verbose=0):
"""Decode operator source and import operator class.
Parameters
----------
sourcecode: string
a string of operator source (e.g 'sklearn.feature_selection.RFE')
verbose: int, optional (default: 0)
How much information TPOT communicates while ... | python | def source_decode(sourcecode, verbose=0):
"""Decode operator source and import operator class.
Parameters
----------
sourcecode: string
a string of operator source (e.g 'sklearn.feature_selection.RFE')
verbose: int, optional (default: 0)
How much information TPOT communicates while ... | [
"def",
"source_decode",
"(",
"sourcecode",
",",
"verbose",
"=",
"0",
")",
":",
"tmp_path",
"=",
"sourcecode",
".",
"split",
"(",
"'.'",
")",
"op_str",
"=",
"tmp_path",
".",
"pop",
"(",
")",
"import_str",
"=",
"'.'",
".",
"join",
"(",
"tmp_path",
")",
... | Decode operator source and import operator class.
Parameters
----------
sourcecode: string
a string of operator source (e.g 'sklearn.feature_selection.RFE')
verbose: int, optional (default: 0)
How much information TPOT communicates while it's running.
0 = none, 1 = minimal, 2 = ... | [
"Decode",
"operator",
"source",
"and",
"import",
"operator",
"class",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/operator_utils.py#L47-L86 | train | Decode an operator source and import operator class. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/operator_utils.py | set_sample_weight | def set_sample_weight(pipeline_steps, sample_weight=None):
"""Recursively iterates through all objects in the pipeline and sets sample weight.
Parameters
----------
pipeline_steps: array-like
List of (str, obj) tuples from a scikit-learn pipeline or related object
sample_weight: array-like
... | python | def set_sample_weight(pipeline_steps, sample_weight=None):
"""Recursively iterates through all objects in the pipeline and sets sample weight.
Parameters
----------
pipeline_steps: array-like
List of (str, obj) tuples from a scikit-learn pipeline or related object
sample_weight: array-like
... | [
"def",
"set_sample_weight",
"(",
"pipeline_steps",
",",
"sample_weight",
"=",
"None",
")",
":",
"sample_weight_dict",
"=",
"{",
"}",
"if",
"not",
"isinstance",
"(",
"sample_weight",
",",
"type",
"(",
"None",
")",
")",
":",
"for",
"(",
"pname",
",",
"obj",
... | Recursively iterates through all objects in the pipeline and sets sample weight.
Parameters
----------
pipeline_steps: array-like
List of (str, obj) tuples from a scikit-learn pipeline or related object
sample_weight: array-like
List of sample weight
Returns
-------
sample_w... | [
"Recursively",
"iterates",
"through",
"all",
"objects",
"in",
"the",
"pipeline",
"and",
"sets",
"sample",
"weight",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/operator_utils.py#L89-L114 | train | Recursively sets the sample weight of all objects in the object in the object in the object in the object in the object in the object in the object in the object in the object in the object in the object in the object in the object in the object in the object in the object in the object in the object in the object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/operator_utils.py | TPOTOperatorClassFactory | def TPOTOperatorClassFactory(opsourse, opdict, BaseClass=Operator, ArgBaseClass=ARGType, verbose=0):
"""Dynamically create operator class.
Parameters
----------
opsourse: string
operator source in config dictionary (key)
opdict: dictionary
operator params in config dictionary (value... | python | def TPOTOperatorClassFactory(opsourse, opdict, BaseClass=Operator, ArgBaseClass=ARGType, verbose=0):
"""Dynamically create operator class.
Parameters
----------
opsourse: string
operator source in config dictionary (key)
opdict: dictionary
operator params in config dictionary (value... | [
"def",
"TPOTOperatorClassFactory",
"(",
"opsourse",
",",
"opdict",
",",
"BaseClass",
"=",
"Operator",
",",
"ArgBaseClass",
"=",
"ARGType",
",",
"verbose",
"=",
"0",
")",
":",
"class_profile",
"=",
"{",
"}",
"dep_op_list",
"=",
"{",
"}",
"# list of nested estim... | Dynamically create operator class.
Parameters
----------
opsourse: string
operator source in config dictionary (key)
opdict: dictionary
operator params in config dictionary (value)
regression: bool
True if it can be used in TPOTRegressor
classification: bool
True... | [
"Dynamically",
"create",
"operator",
"class",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/operator_utils.py#L138-L303 | train | Dynamically create an operator class. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/driver.py | positive_integer | def positive_integer(value):
"""Ensure that the provided value is a positive integer.
Parameters
----------
value: int
The number to evaluate
Returns
-------
value: int
Returns a positive integer
"""
try:
value = int(value)
except Exception:
rais... | python | def positive_integer(value):
"""Ensure that the provided value is a positive integer.
Parameters
----------
value: int
The number to evaluate
Returns
-------
value: int
Returns a positive integer
"""
try:
value = int(value)
except Exception:
rais... | [
"def",
"positive_integer",
"(",
"value",
")",
":",
"try",
":",
"value",
"=",
"int",
"(",
"value",
")",
"except",
"Exception",
":",
"raise",
"argparse",
".",
"ArgumentTypeError",
"(",
"'Invalid int value: \\'{}\\''",
".",
"format",
"(",
"value",
")",
")",
"if... | Ensure that the provided value is a positive integer.
Parameters
----------
value: int
The number to evaluate
Returns
-------
value: int
Returns a positive integer | [
"Ensure",
"that",
"the",
"provided",
"value",
"is",
"a",
"positive",
"integer",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/driver.py#L40-L59 | train | Ensure that the provided value is a positive integer. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
EpistasisLab/tpot | tpot/driver.py | float_range | def float_range(value):
"""Ensure that the provided value is a float integer in the range [0., 1.].
Parameters
----------
value: float
The number to evaluate
Returns
-------
value: float
Returns a float in the range (0., 1.)
"""
try:
value = float(value)
... | python | def float_range(value):
"""Ensure that the provided value is a float integer in the range [0., 1.].
Parameters
----------
value: float
The number to evaluate
Returns
-------
value: float
Returns a float in the range (0., 1.)
"""
try:
value = float(value)
... | [
"def",
"float_range",
"(",
"value",
")",
":",
"try",
":",
"value",
"=",
"float",
"(",
"value",
")",
"except",
"Exception",
":",
"raise",
"argparse",
".",
"ArgumentTypeError",
"(",
"'Invalid float value: \\'{}\\''",
".",
"format",
"(",
"value",
")",
")",
"if"... | Ensure that the provided value is a float integer in the range [0., 1.].
Parameters
----------
value: float
The number to evaluate
Returns
-------
value: float
Returns a float in the range (0., 1.) | [
"Ensure",
"that",
"the",
"provided",
"value",
"is",
"a",
"float",
"integer",
"in",
"the",
"range",
"[",
"0",
".",
"1",
".",
"]",
"."
] | b626271e6b5896a73fb9d7d29bebc7aa9100772e | https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/driver.py#L62-L81 | train | Ensure that the provided value is a float in the range [ 0 1. 0 ). | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.