MCPcopy Create free account

hub / github.com/bhavesh907/Crop-Classification / functions

Functions32 in github.com/bhavesh907/Crop-Classification

↓ 7 callersFunction_make_df
(n: int = 200)
tests/test_features.py:9
↓ 7 callersFunctioncompute_ndvi
Add per-timestamp NDVI columns (``t{t}_ndvi``) to *df*. NDVI = (NIR - Red) / (NIR + Red). A small epsilon avoids division by zero.
src/features.py:8
↓ 4 callersFunction_make_mock_image
(n_rows: int, n_cols: int, seed: int = 0)
tests/test_preprocess.py:16
↓ 4 callersFunction_make_mock_roi
(n_rows: int, n_cols: int)
tests/test_preprocess.py:21
↓ 4 callersFunctionget_feature_array
Return ``(X, y)`` where X has shape ``(n, n_timestamps * features_per_step)``. Feature order within each timestep: [b0, b1, …, b{N_BANDS-1},
src/features.py:22
↓ 1 callersFunction_load_image
(path: Path)
src/preprocess.py:36
↓ 1 callersFunction_load_roi
(path: Path)
src/preprocess.py:29
↓ 1 callersFunction_plot_confusion_matrix
(cm: np.ndarray, labels: list[str], model_type: str)
src/evaluate.py:43
↓ 1 callersFunctionbuild_cnn
1-D CNN over the temporal axis with global average pooling.
src/models.py:29
↓ 1 callersFunctionbuild_dataset
Return a DataFrame with shape (n_classes * n_samples, n_timestamps*n_bands + 1). Columns are named ``t{t}_b{b}`` for timestamp t, band b, pl
src/preprocess.py:47
↓ 1 callersFunctionbuild_lstm
Bidirectional LSTM — the recommended architecture for temporal spectral data. Processing the sequence in both directions captures phenologic
src/models.py:53
↓ 1 callersFunctionbuild_mlp
Fully-connected baseline operating on the flat feature vector.
src/models.py:7
↓ 1 callersFunctionevaluate
Print and save: - Per-class precision / recall / F1 report - Confusion matrix PNG - Training curve PNG (if *history* passed separatel
src/evaluate.py:15
↓ 1 callersFunctionload_dataset
(path: Path = PROCESSED_CSV)
src/preprocess.py:107
↓ 1 callersFunctionmain
()
scripts/train.py:29
↓ 1 callersFunctionmain
()
scripts/preprocess.py:26
↓ 1 callersFunctionplot_training_curve
Save loss and accuracy curves from a Keras History object.
src/evaluate.py:65
↓ 1 callersFunctionsave_dataset
(df: pd.DataFrame, path: Path = PROCESSED_CSV)
src/preprocess.py:101
↓ 1 callersFunctiontrain
Train a crop-classification model and return evaluation artefacts. Parameters ---------- df : pd.DataFrame Output of ``prepr
src/train.py:20
Methodmock_load_image
(path)
tests/test_preprocess.py:50
Methodmock_load_image
(path)
tests/test_preprocess.py:119
Functiontest_compute_ndvi_adds_columns
()
tests/test_features.py:20
Methodtest_dataset_column_count
Dataset must have N_TIMESTAMPS * N_BANDS band columns + 1 class column.
tests/test_preprocess.py:63
Functiontest_feature_array_temporal_reshape
Flat array must reshape cleanly to (n, T, F) without reordering data.
tests/test_features.py:65
Functiontest_get_feature_array_shape
()
tests/test_features.py:51
Functiontest_get_feature_array_without_ndvi
()
tests/test_features.py:59
Functiontest_ndvi_does_not_mutate_input
()
tests/test_features.py:44
Functiontest_ndvi_formula
Spot-check NDVI = (NIR - Red) / (NIR + Red) for a known pixel.
tests/test_features.py:34
Functiontest_ndvi_range
()
tests/test_features.py:27
Methodtest_no_duplicate_pixel_indices_within_class
Each class block should have unique pixel locations (no replacement).
tests/test_preprocess.py:83
Methodtest_same_indices_used_per_timestamp
Call build_dataset with mocked GDAL and assert that _load_image is called with the *same* row/col index arrays for every timestamp.
tests/test_preprocess.py:35
Methodtest_samples_capped_by_available_pixels
When n_samples > available pixels, all available pixels are used.
tests/test_preprocess.py:111